copy constructors

This commit is contained in:
Oth3r 2025-02-11 14:51:06 -06:00
commit b46e10e835
3 changed files with 12 additions and 9 deletions

View file

@ -28,6 +28,12 @@ public class CustomBlock {
this.blockStates = blockStates;
}
public CustomBlock(CustomBlock customBlock) {
this.blockIds = new ArrayList<>(customBlock.blockIds);
this.blockTags = new ArrayList<>(customBlock.blockTags);
this.blockStates = new ArrayList<>(customBlock.blockStates);
}
public ArrayList<String> getBlockIds() {
return blockIds;
}

View file

@ -43,15 +43,7 @@ public class ServerConfig implements CustomFile<ServerConfig> {
public ServerConfig() {}
public ServerConfig(ServerConfig serverConfig) {
this.version = serverConfig.version;
this.lang = serverConfig.lang;
this.keepActive = serverConfig.keepActive;
this.sitWhileSeated = serverConfig.sitWhileSeated;
this.presetBlocks = serverConfig.presetBlocks;
this.customEnabled = serverConfig.customEnabled;
this.sittingBlocks = serverConfig.sittingBlocks;
this.blacklistedBlocks = serverConfig.blacklistedBlocks;
this.interactionBlocks = serverConfig.interactionBlocks;
loadFileData(serverConfig);
}
public ServerConfig(Double version, String lang, boolean keepActive, boolean sitWhileSeated,

View file

@ -22,4 +22,9 @@ public class SittingBlock extends CustomBlock {
super(blockIds, blockTags, blockStates);
this.sittingHeight = sittingHeight;
}
public SittingBlock(SittingBlock sittingBlock) {
super(sittingBlock);
this.sittingHeight = sittingBlock.sittingHeight;
}
}