use of mod.azure.doom.entity.projectiles.ShotgunShellEntity in project MCDoom by AzureDoom.
the class Shotgun method createArrow.
public ShotgunShellEntity createArrow(World worldIn, ItemStack stack, LivingEntity shooter) {
float j = EnchantmentHelper.getLevel(Enchantments.POWER, stack);
ShotgunShellEntity arrowentity = new ShotgunShellEntity(worldIn, shooter, (DoomMod.config.weapons.shotgun_damage + (j * 2.0F)));
return arrowentity;
}
use of mod.azure.doom.entity.projectiles.ShotgunShellEntity in project MCDoom by AzureDoom.
the class SuperShotgun method onStoppedUsing.
@Override
public void onStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int remainingUseTicks) {
if (entityLiving instanceof PlayerEntity) {
PlayerEntity playerentity = (PlayerEntity) entityLiving;
if (stack.getDamage() < (stack.getMaxDamage() - 2)) {
if (playerentity.getMainHandStack().getItem() instanceof SuperShotgun) {
playerentity.getItemCooldownManager().set(this, 24);
if (!worldIn.isClient) {
ShotgunShellEntity abstractarrowentity = createArrow(worldIn, stack, playerentity);
abstractarrowentity.setVelocity(playerentity, playerentity.getPitch(), playerentity.getYaw() + 1, 0.0F, 1.0F * 3.0F, 1.0F);
worldIn.spawnEntity(abstractarrowentity);
ShotgunShellEntity abstractarrowentity1 = createArrow(worldIn, stack, playerentity);
abstractarrowentity1.setVelocity(playerentity, playerentity.getPitch(), playerentity.getYaw() - 1, 0.0F, 1.0F * 3.0F, 1.0F);
worldIn.spawnEntity(abstractarrowentity1);
stack.damage(2, entityLiving, p -> p.sendToolBreakStatus(entityLiving.getActiveHand()));
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.SUPER_SHOTGUN_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F);
final int id = GeckoLibUtil.guaranteeIDForStack(stack, (ServerWorld) worldIn);
GeckoLibNetwork.syncAnimation(playerentity, this, id, ANIM_OPEN);
for (PlayerEntity otherPlayer : PlayerLookup.tracking(playerentity)) {
GeckoLibNetwork.syncAnimation(otherPlayer, this, id, ANIM_OPEN);
}
worldIn.setBlockState(playerentity.getCameraBlockPos(), DoomBlocks.TICKING_LIGHT_BLOCK.getDefaultState());
}
}
} else {
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.EMPTY, SoundCategory.PLAYERS, 1.0F, 1.5F);
((PlayerProperties) playerentity).setHasMeatHook(false);
}
}
}
use of mod.azure.doom.entity.projectiles.ShotgunShellEntity in project MCDoom by AzureDoom.
the class Shotgun method onStoppedUsing.
@Override
public void onStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int remainingUseTicks) {
if (entityLiving instanceof PlayerEntity) {
PlayerEntity playerentity = (PlayerEntity) entityLiving;
if (stack.getDamage() < (stack.getMaxDamage() - 1)) {
playerentity.getItemCooldownManager().set(this, 10);
if (!worldIn.isClient) {
ShotgunShellEntity abstractarrowentity = createArrow(worldIn, stack, playerentity);
abstractarrowentity.setVelocity(playerentity, playerentity.getPitch(), playerentity.getYaw(), 0.0F, 1.0F * 3.0F, 1.0F);
stack.damage(1, entityLiving, p -> p.sendToolBreakStatus(entityLiving.getActiveHand()));
worldIn.spawnEntity(abstractarrowentity);
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.SHOTGUN_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.5F);
if (!worldIn.isClient) {
final int id = GeckoLibUtil.guaranteeIDForStack(stack, (ServerWorld) worldIn);
GeckoLibNetwork.syncAnimation(playerentity, this, id, ANIM_OPEN);
for (PlayerEntity otherPlayer : PlayerLookup.tracking(playerentity)) {
GeckoLibNetwork.syncAnimation(otherPlayer, this, id, ANIM_OPEN);
}
}
worldIn.setBlockState(playerentity.getCameraBlockPos(), DoomBlocks.TICKING_LIGHT_BLOCK.getDefaultState());
}
} else {
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.EMPTY, SoundCategory.PLAYERS, 1.0F, 1.5F);
}
}
}
use of mod.azure.doom.entity.projectiles.ShotgunShellEntity in project MCDoom by AzureDoom.
the class SuperShotgun method createArrow.
public ShotgunShellEntity createArrow(World worldIn, ItemStack stack, LivingEntity shooter) {
float j = EnchantmentHelper.getLevel(Enchantments.POWER, stack);
ShotgunShellEntity arrowentity = new ShotgunShellEntity(worldIn, shooter, (DoomMod.config.weapons.shotgun_damage + (j * 2.0F)));
return arrowentity;
}
use of mod.azure.doom.entity.projectiles.ShotgunShellEntity in project MCDoom by AzureDoom.
the class DShotgun method onStoppedUsing.
@Override
public void onStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int remainingUseTicks) {
if (entityLiving instanceof PlayerEntity) {
PlayerEntity playerentity = (PlayerEntity) entityLiving;
if (stack.getDamage() < (stack.getMaxDamage() - 1)) {
playerentity.getItemCooldownManager().set(this, 10);
if (!worldIn.isClient) {
ShotgunShellEntity abstractarrowentity = createArrow(worldIn, stack, playerentity);
abstractarrowentity.setVelocity(playerentity, playerentity.getPitch(), playerentity.getYaw(), 0.0F, 1.0F * 3.0F, 1.0F);
stack.damage(1, entityLiving, p -> p.sendToolBreakStatus(entityLiving.getActiveHand()));
worldIn.spawnEntity(abstractarrowentity);
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.SHOTGUN_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.5F);
if (!worldIn.isClient) {
final int id = GeckoLibUtil.guaranteeIDForStack(stack, (ServerWorld) worldIn);
GeckoLibNetwork.syncAnimation(playerentity, this, id, ANIM_OPEN);
for (PlayerEntity otherPlayer : PlayerLookup.tracking(playerentity)) {
GeckoLibNetwork.syncAnimation(otherPlayer, this, id, ANIM_OPEN);
}
}
worldIn.setBlockState(playerentity.getCameraBlockPos(), DoomBlocks.TICKING_LIGHT_BLOCK.getDefaultState());
}
} else {
worldIn.playSound((PlayerEntity) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.EMPTY, SoundCategory.PLAYERS, 1.0F, 1.5F);
}
}
}
Aggregations