use of icbm.classic.api.events.RadarGunTraceEvent in project ICBM-Classic by BuiltBrokenModding.
the class ItemRadarGun method trace.
public boolean trace(BlockPos pos, EntityPlayer player) {
ItemStack stack = player.inventory.getCurrentItem();
if (stack != null && stack.getItem() == this) {
RadarGunTraceEvent event = new RadarGunTraceEvent(player.world, pos, player);
if (// event was canceled
MinecraftForge.EVENT_BUS.post(event))
return false;
if (// someone set the pos in the event to null, use original data
event.pos == null)
setLocation(stack, new Location(player.world, pos.getX(), pos.getY(), pos.getZ()));
else
setLocation(stack, new Location(player.world, event.pos.getX(), event.pos.getY(), event.pos.getZ()));
LanguageUtility.addChatToPlayer(player, "gps.pos.set.name");
System.out.println(getLocation(stack));
}
return true;
}
Aggregations