SteamWar/BauSystem
Archiviert
13
0

Simplify TNTTracer_12

Simplify TNTTracer_15
Dieser Commit ist enthalten in:
jojo 2020-12-27 21:56:09 +01:00
Ursprung a19e0436fb
Commit c3f9a61826
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.bausystem.tracer;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -31,7 +32,7 @@ public class TNTTracer_12 {
} }
public static boolean inWater(World world, Vector tntPosition) { public static boolean inWater(World world, Vector tntPosition) {
Material material = tntPosition.toLocation(world).getBlock().getType(); Material material = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ()).getType();
return material == Material.WATER || material == Material.STATIONARY_WATER; return material == Material.WATER || material == Material.STATIONARY_WATER;
} }

Datei anzeigen

@ -34,7 +34,7 @@ public class TNTTracer_15 {
} }
public static boolean inWater(World world, Vector tntPosition) { public static boolean inWater(World world, Vector tntPosition) {
Block block = tntPosition.toLocation(world).getBlock(); Block block = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ());
if(block.getType() == Material.WATER) if(block.getType() == Material.WATER)
return true; return true;