mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-23 21:49:45 +00:00
Add safeguard against drops not being the same as capturedrops. Moved capturing of drops out of armor and knapsack stuff.
This commit is contained in:
1 parent
03755be47d
commit
312fd47360
3 files changed
+14
-4
No files matched your search
@@ -241,7 +241,7 @@ public class ArmorExtended implements IInventory
|
||||
public void dropItems ()
|
||||
{
|
||||
EntityPlayer player = parent.get();
|
||||
player.captureDrops = true;
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (this.inventory[i] != null)
|
||||
@@ -250,7 +250,6 @@ public class ArmorExtended implements IInventory
|
||||
this.inventory[i] = null;
|
||||
}
|
||||
}
|
||||
player.captureDrops = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -161,7 +161,7 @@ public class KnapsackInventory implements IInventory
|
||||
public void dropItems ()
|
||||
{
|
||||
EntityPlayer player = parent.get();
|
||||
player.captureDrops = true;
|
||||
|
||||
for (int i = 0; i < inventory.length; ++i)
|
||||
{
|
||||
if (this.inventory[i] != null)
|
||||
@@ -170,7 +170,6 @@ public class KnapsackInventory implements IInventory
|
||||
this.inventory[i] = null;
|
||||
}
|
||||
}
|
||||
player.captureDrops = false;
|
||||
}
|
||||
|
||||
public void unequipItems ()
|
||||
|
||||
@@ -261,8 +261,20 @@ public class TPlayerHandler
|
||||
else
|
||||
stats.hunger = evt.entityPlayer.getFoodStats().getFoodLevel();
|
||||
|
||||
if (evt.entityPlayer.capturedDrops != evt.drops)
|
||||
{
|
||||
evt.entityPlayer.capturedDrops.clear();
|
||||
}
|
||||
|
||||
evt.entityPlayer.captureDrops = true;
|
||||
stats.armor.dropItems();
|
||||
stats.knapsack.dropItems();
|
||||
evt.entityPlayer.captureDrops = false;
|
||||
|
||||
if (evt.entityPlayer.capturedDrops != evt.drops)
|
||||
{
|
||||
evt.drops.addAll(evt.entityPlayer.capturedDrops);
|
||||
}
|
||||
|
||||
playerStats.put(evt.entityPlayer.getPersistentID(), stats);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user