Production Ready Cupboards

Today I realized that chests suck. I thought of something between a drawer and a chest. I don’t know what this thing, basically a box with a door, is properly called in English: cupboard or shelf or whatever.

I decided to copy & modify gregtech/tileentity/inventories/MultiTileEntityDrawerQuad.java. By trial and error, It took me some time to get it to work somewhat :monkey:

The problem is it works as expected only with certain inventory sizes. Here it’s 36:

Strange GUI rendering with size 54 (that’s the one I want to use). Nothing can be moved in it by dragging, but with shift-click, which causes game to crash.

45 and 72 causes this missing texture or whatever it is. Items can’t be moved in it normally either, and doing so by shift-clicking causes a crash:

Could you help me and point to what’s causing the problem?

Here is the the code on pastebin.

And I hooked it in gregtech/loaders/b/Loader_MultiTileEntities.java:

aRegistry.add("Cupboard (" + aMat.getLocal() + ")", "Storage", 4200+aID, 32751, MultiTileEntityCupboard.class, aMat.mToolQuality, 16, aMachine, UT.NBT.make(NBT_MATERIAL, aMat    , NBT_HARDNESS, aHardness  , NBT_RESISTANCE, aResistance), "CCC", "CCC", "CCC", 'T', OP.screw.dat(aMat), 'C', aRegistry.getItem(aID));

Also, where can I find those crafting codes? So I can change recipe to something more meaningful.

1 Like

Ah yeah the problem is Greg did not account for all possible Inventory Sizes. You will have to rewrite the GUI to get any Number of Slots that I did not plan ahead for.

HOWEVER! For the Doublechest Sized Inventory, I would recommend just copypasting the GT6 Chests GUI 1:1, it should for the most part work perfectly fine. ^^

I would like to, but I can’t even find what to copy-paste. I’m tired of this for today (having to restart MC after another compilation is time-consuming as hell); I will examine the code carefully and try it later on.

1 Like

The MultiTileEntityChest is somewhere in the gregapi.block.multitileentity.example section. There should be somethign that returns a new GUI and something that returns Common instance, which both are needed to get it to work.

1 Like