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.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider {
|
public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider {
|
||||||
@ -90,6 +92,8 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
|
|
||||||
public static class InventoryCrate extends ItemInventory {
|
public static class InventoryCrate extends ItemInventory {
|
||||||
|
|
||||||
|
public static Random rand = new Random();
|
||||||
|
|
||||||
public InventoryCrate(EntityPlayer player, ItemStack crate) {
|
public InventoryCrate(EntityPlayer player, ItemStack crate) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.target = crate;
|
this.target = crate;
|
||||||
@ -146,6 +150,8 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
NBTTagCompound nbt = target.stackTagCompound != null ? target.stackTagCompound : new NBTTagCompound();
|
NBTTagCompound nbt = target.stackTagCompound != null ? target.stackTagCompound : new NBTTagCompound();
|
||||||
int invSize = this.getSizeInventory();
|
int invSize = this.getSizeInventory();
|
||||||
|
|
||||||
|
nbt.removeTag("stacklock");
|
||||||
|
|
||||||
for(int i = 0; i < invSize; i++) {
|
for(int i = 0; i < invSize; i++) {
|
||||||
|
|
||||||
ItemStack stack = this.getStackInSlot(i);
|
ItemStack stack = this.getStackInSlot(i);
|
||||||
@ -159,8 +165,10 @@ public class ItemBlockStorageCrate extends ItemBlockBase implements IGUIProvider
|
|||||||
nbt.setTag("slot" + i, slot);
|
nbt.setTag("slot" + i, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasNoTags()) {
|
if(nbt.hasNoTags()) {
|
||||||
nbt = null;
|
nbt = null;
|
||||||
|
} else {
|
||||||
|
nbt.setLong("stacklock", rand.nextLong()); // add shit that prevents crates from stacking
|
||||||
}
|
}
|
||||||
|
|
||||||
target.setTagCompound(nbt);
|
target.setTagCompound(nbt);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user