mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
changed blacklisted blocks into a customblock list
This commit is contained in:
parent
6609800f88
commit
ed86b67c18
2 changed files with 6 additions and 4 deletions
|
@ -36,7 +36,7 @@ public class ServerConfig implements CustomFile<ServerConfig> {
|
|||
@SerializedName("custom-blocks")
|
||||
private ArrayList<SittingBlock> sittingBlocks = FileData.Defaults.SITTING_BLOCKS;
|
||||
@SerializedName("blacklisted-blocks")
|
||||
private ArrayList<String> blacklistedBlocks = new ArrayList<>();
|
||||
private ArrayList<CustomBlock> blacklistedBlocks = FileData.Defaults.BLACKLISTED_BLOCKS;
|
||||
|
||||
public ServerConfig() {}
|
||||
|
||||
|
@ -51,7 +51,9 @@ public class ServerConfig implements CustomFile<ServerConfig> {
|
|||
this.blacklistedBlocks = serverConfig.blacklistedBlocks;
|
||||
}
|
||||
|
||||
public ServerConfig(Double version, String lang, boolean keepActive, boolean sitWhileSeated, PresetBlocks presetBlocks, boolean customEnabled, ArrayList<SittingBlock> sittingBlocks, ArrayList<String> blacklistedBlocks) {
|
||||
public ServerConfig(Double version, String lang, boolean keepActive, boolean sitWhileSeated,
|
||||
PresetBlocks presetBlocks, boolean customEnabled,
|
||||
ArrayList<SittingBlock> sittingBlocks, ArrayList<CustomBlock> blacklistedBlocks) {
|
||||
this.version = version;
|
||||
this.lang = lang;
|
||||
this.keepActive = keepActive;
|
||||
|
@ -90,7 +92,7 @@ public class ServerConfig implements CustomFile<ServerConfig> {
|
|||
return sittingBlocks;
|
||||
}
|
||||
|
||||
public ArrayList<String> getBlacklistedBlocks() {
|
||||
public ArrayList<CustomBlock> getBlacklistedBlocks() {
|
||||
return blacklistedBlocks;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ public class Utl {
|
|||
// only if custom is enabled
|
||||
if (config.isCustomEnabled()) {
|
||||
// if the block is on the blacklist, false
|
||||
if (config.getBlacklistedBlocks().contains(getBlockID(blockState))) return null;
|
||||
if (config.getBlacklistedBlocks().stream().anyMatch(c -> c.isValid(blockState))) return null;
|
||||
|
||||
for (SittingBlock sittingBlock : config.getSittingBlocks()) {
|
||||
// if the block is valid, true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue