-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creative Chests And Creative Tanks #334
Conversation
1b5efa7
to
85fc43f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both the chest and the tank need to override getParticleTexture
so that there are breaking particles. For an example of what to return, see MetaTileEntityBuffer
.
Both the chest and the tank failed to serialize their NBT when broken, resulting in loss of settings such as the stored item/fluid, if they were active, etc
src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityCreativeChest.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityCreativeTank.java
Show resolved
Hide resolved
public void writeItemStackData(NBTTagCompound itemStack) { | ||
super.writeItemStackData(itemStack); | ||
ItemStack stack = this.handler.getStackInSlot(0); | ||
if (stack != null && stack.getCount() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should check if the stack is not empty instead of the stack not being null. Because getStackInSlot
pulls from a NonNull List
|
||
private int itemsPerCycle = 1; | ||
private int ticksPerCycle = 1; | ||
private final ItemStackHandler handler = new ItemStackHandler(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about overriding getSlotLimit
for this ItemStackHandler
to return 1, just for a nicer display when adding something to the slot. Right now if you click in a stack of 4 of an item, the slot will display the stack of 4, which might be a bit confusing considering that the amount produced is set by the field entry and not the stacksize in the slot.
Simply adds creative chests and creative tanks to the game, which act much like creative emitters. They are configurable in which item/fluid is outputted, the quantities outputted each "cycle", and the length in ticks of said "cycle".
2021-12-12.11-01-40.mp4