diff --git a/PGM/src/main/java/tc/oc/pgm/listeners/WorldProblemMatchModule.java b/PGM/src/main/java/tc/oc/pgm/listeners/WorldProblemMatchModule.java index 8665339..e8eb018 100644 --- a/PGM/src/main/java/tc/oc/pgm/listeners/WorldProblemMatchModule.java +++ b/PGM/src/main/java/tc/oc/pgm/listeners/WorldProblemMatchModule.java @@ -19,11 +19,14 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.ChunkLoadEvent; +import tc.oc.api.docs.SemanticVersion; import tc.oc.api.util.Permissions; import tc.oc.commons.bukkit.util.BlockVectorSet; import tc.oc.commons.bukkit.util.ChunkPosition; import tc.oc.commons.bukkit.util.NMSHacks; import tc.oc.pgm.events.ListenerScope; +import tc.oc.pgm.map.MapProto; +import tc.oc.pgm.map.ProtoVersions; import tc.oc.pgm.match.Match; import tc.oc.pgm.match.MatchModule; import tc.oc.pgm.match.MatchScope; @@ -35,8 +38,9 @@ public class WorldProblemMatchModule extends MatchModule implements Listener { private final Set repairedChunks = new HashSet<>(); private final BlockVectorSet block36Locations = new BlockVectorSet(); - - private @Inject World world; + + @Inject private @MapProto SemanticVersion proto; + @Inject private World world; @Inject WorldProblemMatchModule(Match match) { super(match); @@ -99,13 +103,14 @@ public class WorldProblemMatchModule extends MatchModule implements Listener { ironDoor.setType(Material.BARRIER, false); } } - - // Remove all block 36 and remember the ones at y=0 so VoidFilter can check them - for(Block block36 : chunk.getBlocks(Material.PISTON_MOVING_PIECE)) { - if(block36.getY() == 0) { - block36Locations.add(block36.getX(), block36.getY(), block36.getZ()); + if (proto.isOlderThan(ProtoVersions.ENABLE_BLOCK_36)) { + // Remove all block 36 and remember the ones at y=0 so VoidFilter can check them + for(Block block36 : chunk.getBlocks(Material.PISTON_MOVING_PIECE)) { + if(block36.getY() == 0) { + block36Locations.add(block36.getX(), block36.getY(), block36.getZ()); + } + block36.setType(Material.AIR, false); } - block36.setType(Material.AIR, false); } } } diff --git a/PGM/src/main/java/tc/oc/pgm/map/ProtoVersions.java b/PGM/src/main/java/tc/oc/pgm/map/ProtoVersions.java index bdd035c..62ca0e1 100644 --- a/PGM/src/main/java/tc/oc/pgm/map/ProtoVersions.java +++ b/PGM/src/main/java/tc/oc/pgm/map/ProtoVersions.java @@ -41,7 +41,10 @@ public class ProtoVersions { // Various changes to support dynamic filters public static final SemanticVersion DYNAMIC_FILTERS = new SemanticVersion(1, 4, 2); + + // Enable block 36 to be used, protos before this will remove it from the map + public static final SemanticVersion ENABLE_BLOCK_36 = new SemanticVersion(1, 4, 3); // Current version - change this whenever we bump the proto - public static final SemanticVersion CURRENT = DYNAMIC_FILTERS; + public static final SemanticVersion CURRENT = ENABLE_BLOCK_36; }