mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
FUCK
This commit is contained in:
parent
2b9d43891a
commit
9ef7668702
@ -20,6 +20,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider {
|
||||
@ -89,6 +91,8 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
||||
}
|
||||
|
||||
public static class InventoryCrate extends ItemInventory {
|
||||
|
||||
public static Random rand = new Random();
|
||||
|
||||
public InventoryCrate(EntityPlayer player, ItemStack crate) {
|
||||
this.player = player;
|
||||
@ -145,6 +149,8 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
||||
// Preserve existing NBT so we keep lock data and piders
|
||||
NBTTagCompound nbt = target.stackTagCompound != null ? target.stackTagCompound : new NBTTagCompound();
|
||||
int invSize = this.getSizeInventory();
|
||||
|
||||
nbt.removeTag("stacklock");
|
||||
|
||||
for(int i = 0; i < invSize; i++) {
|
||||
|
||||
@ -159,8 +165,10 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
||||
nbt.setTag("slot" + i, slot);
|
||||
}
|
||||
|
||||
if (nbt.hasNoTags()) {
|
||||
if(nbt.hasNoTags()) {
|
||||
nbt = null;
|
||||
} else {
|
||||
nbt.setLong("stacklock", rand.nextLong()); // add shit that prevents crates from stacking
|
||||
}
|
||||
|
||||
target.setTagCompound(nbt);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user