use of mod.azure.hwg.entity.HWGEntity in project HWG by cybercat-mods.
the class BalrogItem method inventoryTick.
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (world.isClient) {
if (((PlayerEntity) entity).getMainHandStack().getItem() instanceof BalrogItem && ClientInit.reload.isPressed() && selected) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBoolean(true);
ClientPlayNetworking.send(HWGMod.BALROG, passedData);
world.playSound((PlayerEntity) null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.ITEM_FIRECHARGE_USE, SoundCategory.PLAYERS, 1.0F, 1.5F);
}
}
if (!(entity instanceof HWGEntity) && selected) {
((LivingEntity) entity).addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 1, 1, false, false, false));
}
}
use of mod.azure.hwg.entity.HWGEntity in project HWG by cybercat-mods.
the class Minigun method inventoryTick.
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (world.isClient) {
if (((PlayerEntity) entity).getMainHandStack().getItem() instanceof Minigun && ClientInit.reload.isPressed() && selected) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBoolean(true);
ClientPlayNetworking.send(HWGMod.MINIGUN, passedData);
}
}
if (!(entity instanceof HWGEntity) && selected) {
((LivingEntity) entity).addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 1, 1, false, false, false));
}
}
Aggregations