1.12.2; not well tested; book integration still broken

This commit is contained in:
2018-02-08 19:37:21 +01:00
parent 1c07cfc5ee
commit 17ae55c359
58 changed files with 612 additions and 340 deletions

View File

@@ -31,8 +31,10 @@ public class TraitCongenial extends AbstractTrait {
@SubscribeEvent
public void onEntityKill(LivingDeathEvent e) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && !e.getSource().getTrueSource().world.isRemote && e.getEntity() instanceof EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && !e.getSource().getTrueSource().world.isRemote &&
e.getEntity() instanceof EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource())
.getHeldItemMainhand()), identifier)) {
ItemStack tool = ((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand();
String name = e.getEntity().getName();
NBTTagCompound tag = TagUtil.getExtraTag(tool);
@@ -48,7 +50,8 @@ public class TraitCongenial extends AbstractTrait {
}
@Override
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
newDamage, boolean isCritical) {
World w = player.getEntityWorld();
if (!w.isRemote) {
NBTTagCompound tag = TagUtil.getExtraTag(tool);