mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-14 01:14:18 +00:00
Temporary fix for belts being activatable after death #1217
This does not solve the problem, only prevent the crash. It'll cause clientside desyncs until the belt is re-equipped.
This commit is contained in:
1 parent
139b1fb1b0
commit
224a3d45df
2 files changed
+9
-6
No files matched your search
@@ -28,6 +28,9 @@ public class PlayerAbilityHelper
|
||||
{
|
||||
NBTTagList slots = new NBTTagList();
|
||||
InventoryPlayer hotbar = player.inventory;
|
||||
ItemStack belt = armor.inventory[3];
|
||||
if(belt == null)
|
||||
return;
|
||||
|
||||
NBTTagCompound itemTag;
|
||||
|
||||
@@ -43,7 +46,6 @@ public class PlayerAbilityHelper
|
||||
hotbar.mainInventory[i] = null;
|
||||
}
|
||||
|
||||
ItemStack belt = armor.inventory[3];
|
||||
NBTTagList replaceSlots = belt.getTagCompound().getTagList("Inventory", 10);
|
||||
for (int i = 0; i < replaceSlots.tagCount(); ++i)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import mantle.player.PlayerUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.Entity.EnumEntitySize;
|
||||
@@ -20,6 +21,7 @@ import net.minecraft.nbt.*;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
@@ -237,13 +239,15 @@ public class TPlayerHandler
|
||||
@SubscribeEvent
|
||||
public void playerDeath (LivingDeathEvent event)
|
||||
{
|
||||
if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer)
|
||||
if(!(event.entity instanceof EntityPlayer))
|
||||
return;
|
||||
|
||||
if (!event.entity.worldObj.isRemote)
|
||||
{
|
||||
TPlayerStats properties = (TPlayerStats) event.entity.getExtendedProperties(TPlayerStats.PROP_NAME);
|
||||
properties.hunger = ((EntityPlayer) event.entity).getFoodStats().getFoodLevel();
|
||||
playerStats.put(((EntityPlayer) event.entity).getPersistentID(), properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -362,7 +366,4 @@ public class TPlayerHandler
|
||||
TConstruct.logger.error(e.getMessage() != null ? e.getMessage() : "UNKOWN DL ERROR", e);
|
||||
}
|
||||
}
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user