mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
copy constructors
This commit is contained in:
parent
abecde44c8
commit
b46e10e835
3 changed files with 12 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue