Skip to content

Commit

Permalink
增加vanilla.preventPistonPushTileEntity选项 (Fixed Luohuayu#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luohuayu committed Jul 26, 2022
1 parent 53c04ea commit d4bc4dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion patches/net/minecraft/block/BlockPistonBase.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
+ // CatServer start - prevent move or break tileentity or some block
+ boolean cancell = false;
+ for (BlockPos blockPos : moved) {
+ if (worldIn.getTileEntity(blockPos) != null) {
+ if (catserver.server.CatServer.getConfig().preventPistonPushTileEntity && worldIn.getTileEntity(blockPos) != null) {
+ cancell = true;
+ break;
+ }
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/catserver/server/CatServerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class CatServerConfig {

public boolean fixPlayBossSoundToOtherWorld = true;
public boolean fixLessCrystalRespawnDragon = false;
public boolean preventPistonPushTileEntity = true;
public boolean preventPistonPushRail = false;
public boolean preventPistonPushSlimeBlock = false;
public boolean limitFastClickGUI = false;
Expand Down Expand Up @@ -76,6 +77,7 @@ public void loadConfig() {
// vanilla
fixPlayBossSoundToOtherWorld = getOrWriteBooleanConfig("vanilla.fixPlayBossSoundToOtherWorld", fixPlayBossSoundToOtherWorld);
fixLessCrystalRespawnDragon = getOrWriteBooleanConfig("vanilla.fixLessCrystalRespawnDragon", fixLessCrystalRespawnDragon);
preventPistonPushTileEntity = getOrWriteBooleanConfig("vanilla.preventPistonPushTileEntity", preventPistonPushTileEntity);
preventPistonPushRail = getOrWriteBooleanConfig("vanilla.preventPistonPushRail", preventPistonPushRail);
preventPistonPushSlimeBlock = getOrWriteBooleanConfig("vanilla.preventPistonPushSlimeBlock", preventPistonPushRail);
limitFastClickGUI = getOrWriteBooleanConfig("vanilla.limitFastClickGUI", limitFastClickGUI);
Expand Down

0 comments on commit d4bc4dc

Please sign in to comment.