1.14 obsidian exploit patch.

This commit is contained in:
ProSavage 2019-07-18 14:53:25 -05:00
parent 7233e8e819
commit 3f20d67fd7
2 changed files with 14 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId>
<version>1.6.9.5-U0.2.1-1.4-BETA</version>
<version>1.6.9.5-U0.2.1-1.4.1-BETA</version>
<packaging>jar</packaging>
<name>SaberFactions</name>

View File

@ -28,11 +28,24 @@ public class FactionsExploitListener implements Listener {
// thanks to ObGenBlocker and WorldGuard for this method
Block block = event.getToBlock();
// Added this so it wont die on 1.14 :)
if (SaberFactions.plugin.mc114) {
Material source = event.getBlock().getType();
Material target = block.getType();
if ((target == Material.REDSTONE_WIRE || target == Material.TRIPWIRE) && (source == Material.AIR || source == Material.LEGACY_STATIONARY_LAVA || source == Material.LEGACY_LAVA)) {
block.setType(Material.AIR);
}
return;
}
// run this for all versions below 1.14
int source = event.getBlock().getType().getId();
int target = block.getType().getId();
if ((target == 55 || target == 132) && (source == 0 || source == 10 || source == 11)) {
block.setType(Material.AIR);
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)