File tree Expand file tree Collapse file tree
worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit
worldguard-core/src/main/java/com/sk89q/worldguard/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,6 +192,8 @@ public void loadConfiguration() {
192192
193193 noPhysicsGravel = getBoolean ("physics.no-physics-gravel" , false );
194194 noPhysicsSand = getBoolean ("physics.no-physics-sand" , false );
195+ noPhysicsConcretePowder = getBoolean ("physics.no-physics-concrete-powder" , false );
196+ noPhysicsAnvil = getBoolean ("physics.no-physics-anvil" ,false );
195197 ropeLadders = getBoolean ("physics.vine-like-rope-ladders" , false );
196198 allowPortalAnywhere = getBoolean ("physics.allow-portal-anywhere" , false );
197199 preventWaterDamage = new HashSet <>(convertLegacyBlocks (getStringList ("physics.disable-water-damage-blocks" , null )));
Original file line number Diff line number Diff line change @@ -371,6 +371,16 @@ public void onBlockPhysics(BlockPhysicsEvent event) {
371371 return ;
372372 }
373373
374+ if ((Materials .isConcretePowder (id ) && wcfg .noPhysicsConcretePowder )) {
375+ event .setCancelled (true );
376+ return ;
377+ }
378+
379+ if ((Materials .isAnvil (id ) && wcfg .noPhysicsAnvil )) {
380+ event .setCancelled (true );
381+ return ;
382+ }
383+
374384 if (id == Material .NETHER_PORTAL && wcfg .allowPortalAnywhere ) {
375385 event .setCancelled (true );
376386 return ;
Original file line number Diff line number Diff line change 2828import com .sk89q .worldguard .bukkit .cause .Cause ;
2929import com .sk89q .worldguard .bukkit .util .Entities ;
3030import com .sk89q .worldguard .bukkit .util .InteropUtils ;
31+ import com .sk89q .worldguard .bukkit .util .Materials ;
3132import com .sk89q .worldguard .config .ConfigurationManager ;
3233import com .sk89q .worldguard .config .WorldConfiguration ;
3334import com .sk89q .worldguard .protection .ApplicableRegionSet ;
@@ -825,6 +826,16 @@ public void onEntityChangeBlock(EntityChangeBlockEvent event) {
825826 event .setCancelled (true );
826827 return ;
827828 }
829+
830+ if ((Materials .isConcretePowder (id ) && wcfg .noPhysicsConcretePowder )) {
831+ event .setCancelled (true );
832+ return ;
833+ }
834+
835+ if ((Materials .isAnvil (id ) && wcfg .noPhysicsAnvil )) {
836+ event .setCancelled (true );
837+ return ;
838+ }
828839 } else if (ent instanceof Enderman ) {
829840 if (wcfg .disableEndermanGriefing ) {
830841 event .setCancelled (true );
Original file line number Diff line number Diff line change @@ -1558,4 +1558,23 @@ public static boolean isAmethystGrowth(Material mat) {
15581558 public static boolean isSculkGrowth (Material mat ) {
15591559 return mat == Material .SCULK || mat == Material .SCULK_VEIN ;
15601560 }
1561+
1562+ public static boolean isConcretePowder (Material mat ) {
1563+ return mat == Material .BLACK_CONCRETE_POWDER
1564+ || mat == Material .BLUE_CONCRETE_POWDER
1565+ || mat == Material .BROWN_CONCRETE_POWDER
1566+ || mat == Material .CYAN_CONCRETE_POWDER
1567+ || mat == Material .GRAY_CONCRETE_POWDER
1568+ || mat == Material .GREEN_CONCRETE_POWDER
1569+ || mat == Material .LIGHT_BLUE_CONCRETE_POWDER
1570+ || mat == Material .YELLOW_CONCRETE_POWDER
1571+ || mat == Material .LIGHT_GRAY_CONCRETE_POWDER
1572+ || mat == Material .LIME_CONCRETE_POWDER
1573+ || mat == Material .MAGENTA_CONCRETE_POWDER
1574+ || mat == Material .ORANGE_CONCRETE_POWDER
1575+ || mat == Material .PINK_CONCRETE_POWDER
1576+ || mat == Material .PURPLE_CONCRETE_POWDER
1577+ || mat == Material .RED_CONCRETE_POWDER
1578+ || mat == Material .WHITE_CONCRETE_POWDER ;
1579+ }
15611580}
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ public abstract class WorldConfiguration {
8181 public boolean pumpkinScuba ;
8282 public boolean noPhysicsGravel ;
8383 public boolean noPhysicsSand ;
84+ public boolean noPhysicsConcretePowder ;
85+ public boolean noPhysicsAnvil ;
8486 public boolean ropeLadders ;
8587 public boolean allowPortalAnywhere ;
8688 public Set <String > preventWaterDamage ;
You can’t perform that action at this time.
0 commit comments