remove ItemTool subclassing
This commit is contained in:
parent
37f912cb6d
commit
acc43e2d42
24 changed files with 101 additions and 216 deletions
|
@ -30,7 +30,6 @@ import common.attributes.Attribute;
|
|||
import common.collect.Lists;
|
||||
import common.collect.Sets;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.init.ItemRegistry;
|
||||
import common.inventory.Container;
|
||||
import common.inventory.InventoryPlayer;
|
||||
|
@ -142,15 +141,6 @@ public abstract class GuiContainer extends Gui
|
|||
}
|
||||
}
|
||||
|
||||
int damage = stack.getItem().getAttackDamageBonus();
|
||||
damage += EnchantmentHelper.getDamageModifier(stack);
|
||||
if(damage != 0) {
|
||||
if(damage > 0)
|
||||
list.add(Color.BLUE + String.format("+%d Angriffsschaden", damage));
|
||||
else
|
||||
list.add(Color.RED + String.format("-%d Angriffsschaden", damage));
|
||||
}
|
||||
|
||||
Map<Attribute, Float> mods = stack.getAttributeModifiers(null);
|
||||
|
||||
if(!mods.isEmpty()) {
|
||||
|
|
|
@ -900,11 +900,6 @@ public class ClientPlayer implements IClientPlayer
|
|||
{
|
||||
this.gm.effectRenderer.spawnCritParticles(entity);
|
||||
}
|
||||
else if (packetIn.getAnimationType() == 5)
|
||||
{
|
||||
this.gm.effectRenderer.spawnCritParticles(entity);
|
||||
this.gm.effectRenderer.spawnCritParticles(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,14 @@ import common.init.Blocks;
|
|||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.model.GuiPosition;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.HarvestTool;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -62,7 +63,7 @@ public class BlockDeadBush extends BlockBush
|
|||
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS)
|
||||
{
|
||||
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
|
||||
dropItem(worldIn, pos, new ItemStack(Items.deadbush));
|
||||
|
|
|
@ -10,7 +10,7 @@ import common.init.Items;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.model.GuiPosition;
|
||||
|
@ -19,6 +19,7 @@ import common.properties.PropertyEnum;
|
|||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.HarvestTool;
|
||||
import common.util.Identifyable;
|
||||
import common.util.Facing.Axis;
|
||||
import common.vars.Vars;
|
||||
|
@ -169,7 +170,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (worldIn.client || player.getCurrentEquippedItem() == null || !(player.getCurrentEquippedItem().getItem() instanceof ItemShears) || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player))
|
||||
if (worldIn.client || player.getCurrentEquippedItem() == null || !(player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS) || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player))
|
||||
{
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
|
@ -191,7 +192,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
}
|
||||
else if (!worldIn.client)
|
||||
{
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS)
|
||||
{
|
||||
this.onHarvest(worldIn, pos, iblockstate, player);
|
||||
worldIn.setBlockToAir(pos.down());
|
||||
|
|
|
@ -14,13 +14,14 @@ import common.init.WoodType;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyBool;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.HarvestTool;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
@ -279,7 +280,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
}
|
||||
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te) {
|
||||
if(!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears) {
|
||||
if(!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS) {
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -7,13 +7,14 @@ import common.init.Blocks;
|
|||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.model.GuiPosition;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.HarvestTool;
|
||||
import common.util.Identifyable;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
|
@ -91,7 +92,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS)
|
||||
{
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.init.Blocks;
|
|||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -21,6 +21,7 @@ import common.util.BlockPos;
|
|||
import common.util.BoundingBox;
|
||||
import common.util.Clientside;
|
||||
import common.util.Facing;
|
||||
import common.util.HarvestTool;
|
||||
import common.vars.Vars;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.State;
|
||||
|
@ -403,7 +404,7 @@ public class BlockVine extends Block
|
|||
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS)
|
||||
{
|
||||
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.entity.Entity;
|
|||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.StackSize;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.model.ModelRotation;
|
||||
|
@ -20,6 +20,7 @@ import common.util.BlockPos;
|
|||
import common.util.BoundingBox;
|
||||
import common.util.Clientside;
|
||||
import common.util.Facing;
|
||||
import common.util.HarvestTool;
|
||||
import common.world.IBlockAccess;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.State;
|
||||
|
@ -127,7 +128,7 @@ public class BlockTripWire extends Block
|
|||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS)
|
||||
{
|
||||
worldIn.setState(pos, state.withProperty(DISARMED, Boolean.valueOf(true)), 4);
|
||||
}
|
||||
|
|
|
@ -7,10 +7,11 @@ import common.entity.Entity;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.tool.ItemAxe;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.rng.Random;
|
||||
import common.util.Displayable;
|
||||
import common.util.ExtMath;
|
||||
import common.util.HarvestTool;
|
||||
import common.util.Identifyable;
|
||||
import common.vars.Vars;
|
||||
|
||||
|
@ -229,7 +230,7 @@ public enum Enchantment implements Displayable, Identifyable
|
|||
|
||||
public boolean canApply(ItemStack stack)
|
||||
{
|
||||
return stack.getItem() instanceof ItemAxe ? true : super.canApply(stack);
|
||||
return (stack.getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.AXE) || super.canApply(stack);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -352,7 +353,7 @@ public enum Enchantment implements Displayable, Identifyable
|
|||
|
||||
public boolean canApply(ItemStack stack)
|
||||
{
|
||||
return stack.isItemStackDamageable() ? true : super.canApply(stack);
|
||||
return stack.isItemStackDamageable() || super.canApply(stack);
|
||||
}
|
||||
},
|
||||
FORTUNE("fortune", 2, EnchantmentType.DIGGER, "Glück") {
|
||||
|
@ -486,7 +487,7 @@ public enum Enchantment implements Displayable, Identifyable
|
|||
}
|
||||
|
||||
public boolean canApply(ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemAxe ? true : super.canApply(stack);
|
||||
return (stack.getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.AXE) || super.canApply(stack);
|
||||
}
|
||||
|
||||
public void onEntityDamaged(EntityLiving user, Entity target, int level) {
|
||||
|
|
|
@ -6,7 +6,6 @@ import common.item.material.ItemArmor;
|
|||
import common.item.tool.ItemFishingRod;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemSword;
|
||||
|
||||
public enum EnchantmentType
|
||||
{
|
||||
|
@ -44,9 +43,12 @@ public enum EnchantmentType
|
|||
return armor.armorType == UsageSlot.HEAD ? this == ARMOR_HEAD : (armor.armorType == UsageSlot.LEGS ? this == ARMOR_LEGS : (armor.armorType == UsageSlot.BODY ? this == ARMOR_TORSO : (armor.armorType == UsageSlot.FEET ? this == ARMOR_FEET : false)));
|
||||
}
|
||||
}
|
||||
else if(item instanceof ItemTool tool) {
|
||||
return this == DIGGER || (tool.getToolType().isMelee() && this == WEAPON);
|
||||
}
|
||||
else
|
||||
{
|
||||
return item instanceof ItemSword ? this == WEAPON : (item instanceof ItemTool ? this == DIGGER : (item instanceof ItemBow ? this == BOW : (item instanceof ItemFishingRod ? this == FISHING_ROD : false)));
|
||||
return item instanceof ItemBow ? this == BOW : (item instanceof ItemFishingRod ? this == FISHING_ROD : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,13 @@ import common.inventory.InventoryCrafting;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.pathfinding.PathNavigateGround;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.HarvestTool;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -175,7 +176,7 @@ public class EntitySheep extends EntityAnimal
|
|||
{
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemShears /* && this.worldObj.dimension.getDimensionId() != 2 */ && !this.getSheared() && !this.isChild())
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemTool tool && tool.getToolType() == HarvestTool.SHEARS && !this.getSheared() && !this.isChild())
|
||||
{
|
||||
if (!this.worldObj.client)
|
||||
{
|
||||
|
|
|
@ -67,7 +67,6 @@ import common.item.tool.ItemKey;
|
|||
import common.item.tool.ItemTool;
|
||||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemGunBase;
|
||||
import common.item.weapon.ItemSword;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.IPlayer;
|
||||
import common.packet.CPacketPlayerPosition;
|
||||
|
@ -680,16 +679,14 @@ public abstract class EntityNPC extends EntityLiving
|
|||
{
|
||||
if(!this.worldObj.client && !Vars.damageMobs)
|
||||
return false;
|
||||
int f = this.getAttackDamage();
|
||||
int i = 0;
|
||||
|
||||
if (entityIn instanceof EntityLiving)
|
||||
{
|
||||
f += EnchantmentHelper.getDamageModifier(this.getHeldItem());
|
||||
i += EnchantmentHelper.getKnockbackModifier(this);
|
||||
}
|
||||
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), f);
|
||||
boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackDamage());
|
||||
|
||||
if (flag)
|
||||
{
|
||||
|
@ -1314,15 +1311,12 @@ public abstract class EntityNPC extends EntityLiving
|
|||
|
||||
if(old != null) {
|
||||
if(slot == 0) {
|
||||
if(stack.getItem() instanceof ItemSword && !(old.getItem() instanceof ItemSword)) {
|
||||
if(stack.getItem() instanceof ItemTool t1 && t1.getToolType().isMelee() && !(old.getItem() instanceof ItemTool t2 && t2.getToolType().isMelee())) {
|
||||
flag = true;
|
||||
}
|
||||
else if(stack.getItem() instanceof ItemSword && old.getItem() instanceof ItemSword) {
|
||||
ItemSword itemsword = (ItemSword)stack.getItem();
|
||||
ItemSword itemsword1 = (ItemSword)old.getItem();
|
||||
|
||||
if(itemsword.getAttackDamageBonus() != itemsword1.getAttackDamageBonus()) {
|
||||
flag = itemsword.getAttackDamageBonus() > itemsword1.getAttackDamageBonus();
|
||||
else if(stack.getItem() instanceof ItemTool itemsword && itemsword.getToolType().isMelee() && old.getItem() instanceof ItemTool itemsword1 && itemsword1.getToolType().isMelee()) {
|
||||
if(itemsword.getAttackDamageBonus(stack) != itemsword1.getAttackDamageBonus(old)) {
|
||||
flag = itemsword.getAttackDamageBonus(stack) > itemsword1.getAttackDamageBonus(old);
|
||||
}
|
||||
else {
|
||||
flag = stack.getItemDamage() > old.getItemDamage() || stack.isItemEnchanted() && !old.isItemEnchanted();
|
||||
|
@ -1334,7 +1328,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
else if(stack.getItem() instanceof ItemGunBase && !(old.getItem() instanceof ItemBow)) {
|
||||
flag = true;
|
||||
}
|
||||
else if(stack.getItem() instanceof ItemBow && !(old.getItem() instanceof ItemBow) && !(old.getItem() instanceof ItemSword)) {
|
||||
else if(stack.getItem() instanceof ItemBow && !(old.getItem() instanceof ItemBow) && !(old.getItem() instanceof ItemTool tool && tool.getToolType().isMelee())) {
|
||||
flag = true;
|
||||
}
|
||||
else {
|
||||
|
@ -2093,16 +2087,6 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.client.spawnCritParticles(entityHit);
|
||||
}
|
||||
|
||||
public void onEnchantmentCritical(Entity entityHit)
|
||||
{
|
||||
if(this.connection != null)
|
||||
this.connection.onEnchantmentCritical(entityHit);
|
||||
else if(this.client != null) {
|
||||
this.client.spawnCritParticles(entityHit);
|
||||
this.client.spawnCritParticles(entityHit);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this entity is sneaking.
|
||||
*/
|
||||
|
@ -3218,7 +3202,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
}
|
||||
|
||||
public int getAttackDamage() {
|
||||
int damage = this.attackDamageBase + (this.getHeldItem() == null ? 0 : this.getHeldItem().getItem().getAttackDamageBonus());
|
||||
int damage = this.attackDamageBase + (this.getHeldItem() != null && this.getHeldItem().getItem() instanceof ItemTool tool ? tool.getAttackDamageBonus(this.getHeldItem()) : 0);
|
||||
return Math.max(0, damage + (this.hasEffect(Effect.STRENGTH) ? (damage / 2) * (this.getEffect(Effect.STRENGTH).getAmplifier() + 1) : 0) - (this.hasEffect(Effect.WEAKNESS) ? (damage / 5) * (this.getEffect(Effect.WEAKNESS).getAmplifier() + 1) : 0));
|
||||
}
|
||||
|
||||
|
@ -3586,36 +3570,22 @@ public abstract class EntityNPC extends EntityLiving
|
|||
if (!targetEntity.hitByEntity(this))
|
||||
{
|
||||
int f = this.getAttackDamage();
|
||||
int i = 0;
|
||||
int f1 = // 0;
|
||||
|
||||
// if (targetEntity instanceof EntityLivingBase)
|
||||
// {
|
||||
// f1 = EnchantmentHelper.getModifierForCreature(this.getHeldItem());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// f1 =
|
||||
EnchantmentHelper.getDamageModifier(this.getHeldItem());
|
||||
// }
|
||||
|
||||
i = i + EnchantmentHelper.getKnockbackModifier(this);
|
||||
int i = EnchantmentHelper.getKnockbackModifier(this);
|
||||
|
||||
if (this.isSprinting())
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
if (f > 0 || f1 > 0)
|
||||
if (f > 0)
|
||||
{
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInLiquid() && !this.hasEffect(Effect.BLINDNESS) && this.vehicle == null && targetEntity instanceof EntityLiving;
|
||||
|
||||
if (flag && f > 0)
|
||||
if (flag)
|
||||
{
|
||||
f = (int)((float)f * 1.5F);
|
||||
}
|
||||
|
||||
f = f + f1;
|
||||
boolean flag1 = false;
|
||||
int j = EnchantmentHelper.getFireAspectModifier(this);
|
||||
|
||||
|
@ -3654,11 +3624,6 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.onCriticalHit(targetEntity);
|
||||
}
|
||||
|
||||
if (f1 > 0.0F)
|
||||
{
|
||||
this.onEnchantmentCritical(targetEntity);
|
||||
}
|
||||
|
||||
this.setLastAttack(targetEntity);
|
||||
|
||||
if (targetEntity instanceof EntityLiving)
|
||||
|
|
|
@ -51,7 +51,6 @@ import common.item.spawner.ItemBoat;
|
|||
import common.item.spawner.ItemMinecart;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.item.tool.ItemAxe;
|
||||
import common.item.tool.ItemCamera;
|
||||
import common.item.tool.ItemWhip;
|
||||
import common.item.tool.ItemEditor;
|
||||
|
@ -63,11 +62,9 @@ import common.item.tool.ItemKey;
|
|||
import common.item.tool.ItemLead;
|
||||
import common.item.tool.ItemMagnet;
|
||||
import common.item.tool.ItemNameTag;
|
||||
import common.item.tool.ItemPickaxe;
|
||||
import common.item.tool.ItemSaddle;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemShovel;
|
||||
import common.item.tool.ItemSpaceNavigator;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.item.tool.ItemWeatherToken;
|
||||
import common.item.weapon.ItemAmmo;
|
||||
import common.item.weapon.ItemArrow;
|
||||
|
@ -76,11 +73,11 @@ import common.item.weapon.ItemBoltgun;
|
|||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemExterminator;
|
||||
import common.item.weapon.ItemRocketLauncher;
|
||||
import common.item.weapon.ItemSword;
|
||||
import common.item.weapon.ItemTrident;
|
||||
import common.log.Log;
|
||||
import common.util.Pair;
|
||||
import common.util.Color;
|
||||
import common.util.HarvestTool;
|
||||
import common.util.Util;
|
||||
import common.world.Weather;
|
||||
|
||||
|
@ -131,16 +128,16 @@ public abstract class ItemRegistry {
|
|||
|
||||
private static void registerTools(ToolMaterial material, String name, String prefix) {
|
||||
if(material.hasTools()) {
|
||||
register(name + "_shovel", (new ItemShovel(material)).setDisplay(prefix + "schaufel"));
|
||||
register(name + "_pickaxe", (new ItemPickaxe(material)).setDisplay(prefix + "spitzhacke"));
|
||||
register(name + "_axe", (new ItemAxe(material)).setDisplay(prefix + "axt"));
|
||||
register(name + "_shovel", (new ItemTool(material, HarvestTool.SHOVEL)).setDisplay(prefix + "schaufel"));
|
||||
register(name + "_pickaxe", (new ItemTool(material, HarvestTool.PICKAXE)).setDisplay(prefix + "spitzhacke"));
|
||||
register(name + "_axe", (new ItemTool(material, HarvestTool.AXE)).setDisplay(prefix + "axt"));
|
||||
}
|
||||
if(material.hasExtras()) {
|
||||
register(name + "_shears", (new ItemShears(material)).setDisplay(prefix + "schere"));
|
||||
register(name + "_shears", (new ItemTool(material, HarvestTool.SHEARS)).setDisplay(prefix + "schere"));
|
||||
register(name + "_horse_armor", (new ItemHorseArmor(material, name)).setDisplay(prefix + "pferderüstung"));
|
||||
}
|
||||
if(material.hasWeapons()) {
|
||||
register(name + "_sword", (new ItemSword(material)).setDisplay(prefix + "schwert"));
|
||||
register(name + "_sword", (new ItemTool(material, HarvestTool.SWORD)).setDisplay(prefix + "schwert"));
|
||||
}
|
||||
if(material.hasArmor()) {
|
||||
register(name + "_helmet", (new ItemArmor(material, name, UsageSlot.HEAD)).setDisplay(prefix == null ? "Kappe" : prefix + "helm"));
|
||||
|
|
|
@ -38,7 +38,7 @@ import common.item.spawner.ItemBoat;
|
|||
import common.item.spawner.ItemMinecart;
|
||||
import common.item.spawner.ItemMobTemplate;
|
||||
import common.item.spawner.ItemCharTemplate;
|
||||
import common.item.tool.ItemAxe;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.item.tool.ItemCamera;
|
||||
import common.item.tool.ItemWhip;
|
||||
import common.item.tool.ItemEditor;
|
||||
|
@ -50,10 +50,7 @@ import common.item.tool.ItemKey;
|
|||
import common.item.tool.ItemLead;
|
||||
import common.item.tool.ItemMagnet;
|
||||
import common.item.tool.ItemNameTag;
|
||||
import common.item.tool.ItemPickaxe;
|
||||
import common.item.tool.ItemSaddle;
|
||||
import common.item.tool.ItemShears;
|
||||
import common.item.tool.ItemShovel;
|
||||
import common.item.tool.ItemSpaceNavigator;
|
||||
import common.item.tool.ItemWeatherToken;
|
||||
import common.item.weapon.ItemAmmo;
|
||||
|
@ -63,7 +60,6 @@ import common.item.weapon.ItemBoltgun;
|
|||
import common.item.weapon.ItemBow;
|
||||
import common.item.weapon.ItemExterminator;
|
||||
import common.item.weapon.ItemRocketLauncher;
|
||||
import common.item.weapon.ItemSword;
|
||||
import common.item.weapon.ItemTrident;
|
||||
import common.util.Util;
|
||||
|
||||
|
@ -103,7 +99,7 @@ public abstract class Items {
|
|||
public static final ItemArmor ardite_helmet = get("ardite_helmet");
|
||||
public static final ItemArmor ardite_leggings = get("ardite_leggings");
|
||||
public static final Item ardite_ore = get("ardite_ore");
|
||||
public static final ItemSword ardite_sword = get("ardite_sword");
|
||||
public static final ItemTool ardite_sword = get("ardite_sword");
|
||||
public static final ItemArrow arrow = get("arrow");
|
||||
public static final Item arsenic_block = get("arsenic_block");
|
||||
public static final Item arsenic_ore = get("arsenic_ore");
|
||||
|
@ -301,7 +297,7 @@ public abstract class Items {
|
|||
public static final Item dead_bush = get("dead_bush");
|
||||
public static final Item deadbush = get("deadbush");
|
||||
public static final Item diamond = get("diamond");
|
||||
public static final ItemAxe diamond_axe = get("diamond_axe");
|
||||
public static final ItemTool diamond_axe = get("diamond_axe");
|
||||
public static final Item diamond_block = get("diamond_block");
|
||||
public static final ItemArmor diamond_boots = get("diamond_boots");
|
||||
public static final ItemArmor diamond_chestplate = get("diamond_chestplate");
|
||||
|
@ -309,10 +305,10 @@ public abstract class Items {
|
|||
public static final ItemHorseArmor diamond_horse_armor = get("diamond_horse_armor");
|
||||
public static final ItemArmor diamond_leggings = get("diamond_leggings");
|
||||
public static final Item diamond_ore = get("diamond_ore");
|
||||
public static final ItemPickaxe diamond_pickaxe = get("diamond_pickaxe");
|
||||
public static final ItemShears diamond_shears = get("diamond_shears");
|
||||
public static final ItemShovel diamond_shovel = get("diamond_shovel");
|
||||
public static final ItemSword diamond_sword = get("diamond_sword");
|
||||
public static final ItemTool diamond_pickaxe = get("diamond_pickaxe");
|
||||
public static final ItemTool diamond_shears = get("diamond_shears");
|
||||
public static final ItemTool diamond_shovel = get("diamond_shovel");
|
||||
public static final ItemTool diamond_sword = get("diamond_sword");
|
||||
public static final ItemDie die_10 = get("die_10");
|
||||
public static final ItemDie die_12 = get("die_12");
|
||||
public static final ItemDie die_20 = get("die_20");
|
||||
|
@ -357,7 +353,7 @@ public abstract class Items {
|
|||
public static final Item glass_pane = get("glass_pane");
|
||||
public static final Item glowstone = get("glowstone");
|
||||
public static final Item glowing_powder = get("glowing_powder");
|
||||
public static final ItemAxe gold_axe = get("gold_axe");
|
||||
public static final ItemTool gold_axe = get("gold_axe");
|
||||
public static final Item gold_block = get("gold_block");
|
||||
public static final ItemArmor gold_boots = get("gold_boots");
|
||||
public static final ItemArmor gold_chestplate = get("gold_chestplate");
|
||||
|
@ -367,10 +363,10 @@ public abstract class Items {
|
|||
public static final ItemArmor gold_leggings = get("gold_leggings");
|
||||
public static final Item gold_nugget = get("gold_nugget");
|
||||
public static final Item gold_ore = get("gold_ore");
|
||||
public static final ItemPickaxe gold_pickaxe = get("gold_pickaxe");
|
||||
public static final ItemShears gold_shears = get("gold_shears");
|
||||
public static final ItemShovel gold_shovel = get("gold_shovel");
|
||||
public static final ItemSword gold_sword = get("gold_sword");
|
||||
public static final ItemTool gold_pickaxe = get("gold_pickaxe");
|
||||
public static final ItemTool gold_shears = get("gold_shears");
|
||||
public static final ItemTool gold_shovel = get("gold_shovel");
|
||||
public static final ItemTool gold_sword = get("gold_sword");
|
||||
public static final ItemAppleGold golden_apple = get("golden_apple");
|
||||
public static final ItemAppleGold charged_apple = get("charged_apple");
|
||||
public static final ItemBucket goo_bucket = get("goo_bucket");
|
||||
|
@ -388,11 +384,11 @@ public abstract class Items {
|
|||
public static final Item green_glass_pane = get("green_glass_pane");
|
||||
public static final Item green_wool = get("green_wool");
|
||||
public static final Item gunpowder = get("gunpowder");
|
||||
public static final ItemAxe gyriyn_axe = get("gyriyn_axe");
|
||||
public static final ItemTool gyriyn_axe = get("gyriyn_axe");
|
||||
public static final Item gyriyn_block = get("gyriyn_block");
|
||||
public static final Item gyriyn_ore = get("gyriyn_ore");
|
||||
public static final ItemPickaxe gyriyn_pickaxe = get("gyriyn_pickaxe");
|
||||
public static final ItemShovel gyriyn_shovel = get("gyriyn_shovel");
|
||||
public static final ItemTool gyriyn_pickaxe = get("gyriyn_pickaxe");
|
||||
public static final ItemTool gyriyn_shovel = get("gyriyn_shovel");
|
||||
public static final Item hardened_clay = get("hardened_clay");
|
||||
public static final Item hay_block = get("hay_block");
|
||||
public static final Item heavy_weighted_pressure_plate = get("heavy_weighted_pressure_plate");
|
||||
|
@ -405,7 +401,7 @@ public abstract class Items {
|
|||
public static final Item iodine_block = get("iodine_block");
|
||||
public static final Item iodine_ore = get("iodine_ore");
|
||||
public static final ItemMetal iodine_powder = get("iodine_powder");
|
||||
public static final ItemAxe iron_axe = get("iron_axe");
|
||||
public static final ItemTool iron_axe = get("iron_axe");
|
||||
public static final Item iron_bars = get("iron_bars");
|
||||
public static final Item iron_block = get("iron_block");
|
||||
public static final ItemArmor iron_boots = get("iron_boots");
|
||||
|
@ -416,10 +412,10 @@ public abstract class Items {
|
|||
public static final ItemMetal iron_ingot = get("iron_ingot");
|
||||
public static final ItemArmor iron_leggings = get("iron_leggings");
|
||||
public static final Item iron_ore = get("iron_ore");
|
||||
public static final ItemPickaxe iron_pickaxe = get("iron_pickaxe");
|
||||
public static final ItemShears iron_shears = get("iron_shears");
|
||||
public static final ItemShovel iron_shovel = get("iron_shovel");
|
||||
public static final ItemSword iron_sword = get("iron_sword");
|
||||
public static final ItemTool iron_pickaxe = get("iron_pickaxe");
|
||||
public static final ItemTool iron_shears = get("iron_shears");
|
||||
public static final ItemTool iron_shovel = get("iron_shovel");
|
||||
public static final ItemTool iron_sword = get("iron_sword");
|
||||
public static final Item iron_trapdoor = get("iron_trapdoor");
|
||||
public static final Item jungle_door = get("jungle_door");
|
||||
public static final Item jungle_fence = get("jungle_fence");
|
||||
|
@ -509,16 +505,16 @@ public abstract class Items {
|
|||
public static final Item neptunium_block = get("neptunium_block");
|
||||
public static final ItemMetal neptunium_ingot = get("neptunium_ingot");
|
||||
public static final Item neptunium_ore = get("neptunium_ore");
|
||||
public static final ItemAxe nichun_axe = get("nichun_axe");
|
||||
public static final ItemTool nichun_axe = get("nichun_axe");
|
||||
public static final Item nichun_block = get("nichun_block");
|
||||
public static final ItemArmor nichun_boots = get("nichun_boots");
|
||||
public static final ItemArmor nichun_chestplate = get("nichun_chestplate");
|
||||
public static final ItemArmor nichun_helmet = get("nichun_helmet");
|
||||
public static final ItemArmor nichun_leggings = get("nichun_leggings");
|
||||
public static final Item nichun_ore = get("nichun_ore");
|
||||
public static final ItemPickaxe nichun_pickaxe = get("nichun_pickaxe");
|
||||
public static final ItemShovel nichun_shovel = get("nichun_shovel");
|
||||
public static final ItemSword nichun_sword = get("nichun_sword");
|
||||
public static final ItemTool nichun_pickaxe = get("nichun_pickaxe");
|
||||
public static final ItemTool nichun_shovel = get("nichun_shovel");
|
||||
public static final ItemTool nichun_sword = get("nichun_sword");
|
||||
public static final Item nickel_block = get("nickel_block");
|
||||
public static final ItemMetal nickel_ingot = get("nickel_ingot");
|
||||
public static final Item nickel_ore = get("nickel_ore");
|
||||
|
@ -683,14 +679,14 @@ public abstract class Items {
|
|||
public static final Item stick = get("stick");
|
||||
public static final Item sticky_piston = get("sticky_piston");
|
||||
public static final Item stone = get("stone");
|
||||
public static final ItemAxe stone_axe = get("stone_axe");
|
||||
public static final ItemTool stone_axe = get("stone_axe");
|
||||
public static final Item stone_button = get("stone_button");
|
||||
public static final ItemPickaxe stone_pickaxe = get("stone_pickaxe");
|
||||
public static final ItemTool stone_pickaxe = get("stone_pickaxe");
|
||||
public static final Item stone_pressure_plate = get("stone_pressure_plate");
|
||||
public static final ItemShovel stone_shovel = get("stone_shovel");
|
||||
public static final ItemTool stone_shovel = get("stone_shovel");
|
||||
public static final Item stone_slab = get("stone_slab");
|
||||
public static final Item stone_stairs = get("stone_stairs");
|
||||
public static final ItemSword stone_sword = get("stone_sword");
|
||||
public static final ItemTool stone_sword = get("stone_sword");
|
||||
public static final Item stonebrick = get("stonebrick");
|
||||
public static final Item stonebrick_slab = get("stonebrick_slab");
|
||||
public static final Item stonebrick_stairs = get("stonebrick_stairs");
|
||||
|
@ -702,16 +698,16 @@ public abstract class Items {
|
|||
public static final Item sunflower = get("sunflower");
|
||||
public static final Item syringa = get("syringa");
|
||||
public static final Item tallgrass = get("tallgrass");
|
||||
public static final ItemAxe thetium_axe = get("thetium_axe");
|
||||
public static final ItemTool thetium_axe = get("thetium_axe");
|
||||
public static final Item thetium_block = get("thetium_block");
|
||||
public static final ItemArmor thetium_boots = get("thetium_boots");
|
||||
public static final ItemArmor thetium_chestplate = get("thetium_chestplate");
|
||||
public static final ItemArmor thetium_helmet = get("thetium_helmet");
|
||||
public static final ItemArmor thetium_leggings = get("thetium_leggings");
|
||||
public static final Item thetium_ore = get("thetium_ore");
|
||||
public static final ItemPickaxe thetium_pickaxe = get("thetium_pickaxe");
|
||||
public static final ItemShovel thetium_shovel = get("thetium_shovel");
|
||||
public static final ItemSword thetium_sword = get("thetium_sword");
|
||||
public static final ItemTool thetium_pickaxe = get("thetium_pickaxe");
|
||||
public static final ItemTool thetium_shovel = get("thetium_shovel");
|
||||
public static final ItemTool thetium_sword = get("thetium_sword");
|
||||
public static final Item thi_fragment = get("thi_fragment");
|
||||
public static final Item tian = get("tian");
|
||||
public static final Item tian_door = get("tian_door");
|
||||
|
@ -786,10 +782,10 @@ public abstract class Items {
|
|||
public static final Item white_glass_pane = get("white_glass_pane");
|
||||
public static final Item white_tulip = get("white_tulip");
|
||||
public static final Item white_wool = get("white_wool");
|
||||
public static final ItemAxe wood_axe = get("wood_axe");
|
||||
public static final ItemPickaxe wood_pickaxe = get("wood_pickaxe");
|
||||
public static final ItemShovel wood_shovel = get("wood_shovel");
|
||||
public static final ItemSword wood_sword = get("wood_sword");
|
||||
public static final ItemTool wood_axe = get("wood_axe");
|
||||
public static final ItemTool wood_pickaxe = get("wood_pickaxe");
|
||||
public static final ItemTool wood_shovel = get("wood_shovel");
|
||||
public static final ItemTool wood_sword = get("wood_sword");
|
||||
public static final Item wooden_button = get("wooden_button");
|
||||
public static final Item wooden_pressure_plate = get("wooden_pressure_plate");
|
||||
public static final Item workbench = get("workbench");
|
||||
|
|
|
@ -5,6 +5,7 @@ import common.entity.npc.EntityNPC;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemArmor;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -420,9 +421,9 @@ public class InventoryPlayer implements IInventory
|
|||
{
|
||||
float f = 1.0F;
|
||||
|
||||
if (this.mainInventory[this.currentItem] != null)
|
||||
if (this.mainInventory[this.currentItem] != null && this.mainInventory[this.currentItem].getItem() instanceof ItemTool tool && blockIn.getMiningTool() == tool.getToolType())
|
||||
{
|
||||
f *= this.mainInventory[this.currentItem].getItem().getStrVsBlock(this.mainInventory[this.currentItem], blockIn);
|
||||
f *= tool.getToolMaterial().getEfficiency();
|
||||
}
|
||||
|
||||
return f;
|
||||
|
@ -517,7 +518,7 @@ public class InventoryPlayer implements IInventory
|
|||
if(!block.getMaterial().isToolRequired())
|
||||
return true;
|
||||
ItemStack stack = this.getStackInSlot(this.currentItem);
|
||||
return stack != null && stack.getItem().canHarvestBlock(block);
|
||||
return stack != null && stack.getItem() instanceof ItemTool tool && block.getMiningTool() == tool.getToolType() && (!tool.getToolType().isLevelled() || tool.getToolMaterial().getHarvestLevel() >= block.getMiningLevel());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -196,10 +196,6 @@ public class Item {
|
|||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public float getStrVsBlock(ItemStack stack, Block state) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
public int getUseCooldown(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) {
|
||||
return 0;
|
||||
|
@ -223,10 +219,6 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canHarvestBlock(Block blockIn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean itemInteractionForEntity(ItemStack stack, EntityNPC playerIn, EntityLiving target) {
|
||||
return false;
|
||||
}
|
||||
|
@ -254,10 +246,6 @@ public class Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
public int getAttackDamageBonus() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map, UsageSlot slot) {
|
||||
if(this.block != null)
|
||||
this.block.getModifiers(map, slot);
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.init.ToolMaterial;
|
||||
import common.util.HarvestTool;
|
||||
|
||||
public class ItemAxe extends ItemTool {
|
||||
public ItemAxe(ToolMaterial material) {
|
||||
super(material, HarvestTool.AXE);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.init.ToolMaterial;
|
||||
import common.util.HarvestTool;
|
||||
|
||||
public class ItemPickaxe extends ItemTool {
|
||||
public ItemPickaxe(ToolMaterial material) {
|
||||
super(material, HarvestTool.PICKAXE);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.init.ToolMaterial;
|
||||
import common.util.HarvestTool;
|
||||
|
||||
public class ItemShears extends ItemTool {
|
||||
public ItemShears(ToolMaterial material) {
|
||||
super(material, HarvestTool.SHEARS);
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.init.ToolMaterial;
|
||||
import common.util.HarvestTool;
|
||||
|
||||
public class ItemShovel extends ItemTool {
|
||||
public ItemShovel(ToolMaterial material) {
|
||||
super(material, HarvestTool.SHOVEL);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package common.item.tool;
|
|||
import java.util.List;
|
||||
|
||||
import common.block.Block;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.ToolMaterial;
|
||||
|
@ -17,7 +18,7 @@ import common.util.Color;
|
|||
import common.util.HarvestTool;
|
||||
import common.world.World;
|
||||
|
||||
public abstract class ItemTool extends Item {
|
||||
public class ItemTool extends Item {
|
||||
private final ToolMaterial material;
|
||||
private final HarvestTool type;
|
||||
|
||||
|
@ -30,20 +31,23 @@ public abstract class ItemTool extends Item {
|
|||
this.setMagnetic();
|
||||
}
|
||||
|
||||
public boolean canHarvestBlock(Block block) {
|
||||
return block.getMiningTool() == this.type && (!this.type.isLevelled() || this.getToolMaterial().getHarvestLevel() >= block.getMiningLevel());
|
||||
}
|
||||
|
||||
public float getStrVsBlock(ItemStack stack, Block block) {
|
||||
return block.getMiningTool() == this.type ? (float)this.material.getEfficiency() : 1.0f;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
if(this.type.isLevelled())
|
||||
tooltip.add(Color.VIOLET + "Level " + (this.getToolMaterial().getHarvestLevel() + 1));
|
||||
tooltip.add(Color.DARK_GREEN + "+ " + (this.material.getEfficiency() - 1) + " Abbaueffizienz");
|
||||
int damage = this.getAttackDamageBonus(stack);
|
||||
if(damage != 0) {
|
||||
if(damage > 0)
|
||||
tooltip.add(Color.BLUE + String.format("+%d Angriffsschaden", damage));
|
||||
else
|
||||
tooltip.add(Color.RED + String.format("-%d Angriffsschaden", damage));
|
||||
}
|
||||
}
|
||||
|
||||
public int getAttackDamageBonus(ItemStack stack) {
|
||||
return this.type.getDamage() >= 0 ? (this.material.getDamage() + this.type.getDamage() + EnchantmentHelper.getDamageModifier(stack)) : 0;
|
||||
}
|
||||
|
||||
public boolean hitEntity(ItemStack stack, EntityLiving target, EntityLiving attacker) {
|
||||
|
@ -72,10 +76,6 @@ public abstract class ItemTool extends Item {
|
|||
public boolean getIsRepairable(ItemStack stack, ItemStack repair) {
|
||||
return this.material.isRepairItem(repair.getItem());
|
||||
}
|
||||
|
||||
public int getAttackDamageBonus() {
|
||||
return this.type.getDamage() >= 0 ? this.material.getDamage() + this.type.getDamage() : 0;
|
||||
}
|
||||
|
||||
public WieldType getWieldType() {
|
||||
return WieldType.TOOL;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package common.item.weapon;
|
||||
|
||||
import common.init.ToolMaterial;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.util.HarvestTool;
|
||||
|
||||
public class ItemSword extends ItemTool {
|
||||
public ItemSword(ToolMaterial material) {
|
||||
super(material, HarvestTool.SWORD);
|
||||
}
|
||||
}
|
|
@ -85,7 +85,6 @@ public interface IPlayer extends NetHandler {
|
|||
void onFinishedEffect(StatusEffect effect);
|
||||
void setPositionAndUpdate(double x, double y, double z);
|
||||
void onCriticalHit(Entity entity);
|
||||
void onEnchantmentCritical(Entity entity);
|
||||
void updateEffectMeta();
|
||||
void playSound(SoundEvent name, float volume);
|
||||
void updateEntity();
|
||||
|
|
|
@ -771,11 +771,6 @@ public class Player extends User implements Executor, IPlayer
|
|||
{
|
||||
this.getEntityWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 4));
|
||||
}
|
||||
|
||||
public void onEnchantmentCritical(Entity entityHit)
|
||||
{
|
||||
this.getEntityWorld().sendToAllTrackingAndSelf(this.entity, new SPacketAnimation(entityHit, 5));
|
||||
}
|
||||
|
||||
public void updateEffectMeta()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue