|
@@ -400,10 +400,10 @@ public class ScriptEvents implements BlockHarvest, Craft {
|
|
handleEvent("bucket_use", (sc) -> {
|
|
handleEvent("bucket_use", (sc) -> {
|
|
setPlayer(sc, e.getPlayer());
|
|
setPlayer(sc, e.getPlayer());
|
|
RayTraceResult ray = e.getTarget();
|
|
RayTraceResult ray = e.getTarget();
|
|
- if(ray != null && ray.hitInfo != null && ray.hitInfo instanceof BlockPos) {
|
|
|
|
- BlockPos pos = (BlockPos) ray.hitInfo;
|
|
|
|
|
|
+ if(ray != null && ray instanceof BlockRayTraceResult
|
|
|
|
+ && ray.getType() == RayTraceResult.Type.BLOCK) {
|
|
sc.setVar("has_block", true);
|
|
sc.setVar("has_block", true);
|
|
- ScriptEvents.setBlock(sc, e.getWorld(), pos);
|
|
|
|
|
|
+ ScriptEvents.setBlock(sc, e.getWorld(), ((BlockRayTraceResult) ray).getPos());
|
|
} else {
|
|
} else {
|
|
sc.setVar("has_block", false);
|
|
sc.setVar("has_block", false);
|
|
}
|
|
}
|