Tracer-entity #147
@ -21,6 +21,9 @@ 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.block.data.BlockData;
|
||||||
|
import org.bukkit.block.data.Waterlogged;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -31,8 +34,15 @@ public class TNTTracer_15 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
public static boolean inWater(World world, Vector tntPosition) {
|
public static boolean inWater(World world, Vector tntPosition) {
|
||||||
Material material = tntPosition.toLocation(world).getBlock().getType();
|
Block block = tntPosition.toLocation(world).getBlock();
|
||||||
return material == Material.WATER;
|
if(block.getType() == Material.WATER)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
BlockData data = block.getBlockData();
|
||||||
|
if(!(data instanceof Waterlogged))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ((Waterlogged) data).isWaterlogged();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Hier scheint eine Überprüfung auf Waterlogged-Blöcke zu fehlen (vgl. FightSystem isWater)
Ist nun eingebaut