mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-03-01 15:54:34 +01:00
Remove unused code
This commit is contained in:
parent
9601109a21
commit
82c144fe64
1 changed files with 1 additions and 21 deletions
|
@ -3,25 +3,18 @@ package com.minelittlepony.unicopia.item;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.USounds;
|
import com.minelittlepony.unicopia.USounds;
|
||||||
import com.minelittlepony.unicopia.UTags;
|
|
||||||
import com.minelittlepony.unicopia.entity.PhysicsBodyProjectileEntity;
|
import com.minelittlepony.unicopia.entity.PhysicsBodyProjectileEntity;
|
||||||
import com.minelittlepony.unicopia.projectile.MagicProjectileEntity;
|
|
||||||
import com.minelittlepony.unicopia.projectile.ProjectileDelegate;
|
|
||||||
|
|
||||||
import net.minecraft.block.DispenserBlock;
|
import net.minecraft.block.DispenserBlock;
|
||||||
import net.minecraft.block.dispenser.ProjectileDispenserBehavior;
|
import net.minecraft.block.dispenser.ProjectileDispenserBehavior;
|
||||||
import net.minecraft.entity.FlyingItemEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
||||||
import net.minecraft.entity.projectile.ProjectileEntity;
|
import net.minecraft.entity.projectile.ProjectileEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.sound.SoundEvent;
|
import net.minecraft.sound.SoundEvent;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
|
||||||
import net.minecraft.util.math.Position;
|
import net.minecraft.util.math.Position;
|
||||||
import net.minecraft.world.GameRules;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class HeavyProjectileItem extends ProjectileItem implements ProjectileDelegate.BlockHitListener {
|
public class HeavyProjectileItem extends ProjectileItem {
|
||||||
|
|
||||||
public HeavyProjectileItem(Settings settings, float projectileDamage) {
|
public HeavyProjectileItem(Settings settings, float projectileDamage) {
|
||||||
super(settings, projectileDamage);
|
super(settings, projectileDamage);
|
||||||
|
@ -50,17 +43,4 @@ public class HeavyProjectileItem extends ProjectileItem implements ProjectileDel
|
||||||
protected SoundEvent getThrowSound(ItemStack stack) {
|
protected SoundEvent getThrowSound(ItemStack stack) {
|
||||||
return USounds.ENTITY_JAR_THROW;
|
return USounds.ENTITY_JAR_THROW;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact(MagicProjectileEntity projectile, BlockHitResult hit) {
|
|
||||||
if (!projectile.world.isClient && projectile.world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) {
|
|
||||||
float damage = projectile instanceof FlyingItemEntity ? getProjectileDamage(((FlyingItemEntity)projectile).getStack()) : 0;
|
|
||||||
|
|
||||||
if (damage > 0 && projectile.world.random.nextInt(90) == 0) {
|
|
||||||
if (projectile.world.getBlockState(hit.getBlockPos()).isIn(UTags.FRAGILE)) {
|
|
||||||
projectile.world.breakBlock(hit.getBlockPos(), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue