TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Ingot Piles instacool items

AnodeCathode opened this issue ยท 2 comments

commented

Describe the bug
Make sure to include:

  1. What did you expect to happen? TFC to not let me put white hot ingots on a pile
  2. What actually happened instead (i.e. what was the bug): TFC let me place them. Thus insta-cooling them
  • TFC Version: 0.X.X.152
  • Were any other mods included? Can you reproduce it without these other mods? Yes
  • If necessary, what other mods (including versions) MUST be present to experience the bug? None
commented

Similar thing happens with metal sheets as you can put them down to insta cool them

commented

This is a result of the way both things are coded - they don't store the stacks used to create them at all, only the metal and count (ingot piles), or faces (sheets). There are two options:

  1. Enforce only cold ingots sheets can be placed. (This needs to be more general than just ignoring IItemHeat - we need to essentially verify that when placing from a stack initialStack, that ItemStack.areItemStacksEqual(initialStack.split(1), new ItemStack(initialStack.getItem())), as that's exactly the logic that will be done upon pickup.)

  2. Rewrite / Extend both ingot piles and sheets to hold actual stacks. This would involve:

For ingot piles:

  • Add a 64 Item stack inventory to the TE. A simple queue / list would do here, no need for an IItemHandler imo, although it wouldn't hurt.
  • Make rendering either dynamically render each stack as the metal of the ingot it contains, or keep the one-metal-per-stack requirement and the existing exposition of getMetal on the ingot pile TE.
  • Extent ingot piles placement to not be hardcoded to ItemIngot and instead be event handler.

For sheets:

  • These are separate blocks per metal, with state driven models. (this is a good thing and we'd prefer to keep it this way if possible. Making it TE / TESR based would be a hassle, difficult to deal with in future and just generally unpleasant. For reference in 1.15 these can become entirely state driven (no TE needed for getActualState)
  • Keeping the one-metal-per-block restriction, these would also need to hold a six item inventory.
  • Again, move hardcoded sheet placement from ItemSheet to event handler.

Finally, some forward-thinking (1.15) notes:

  • sheets can become completely state blocks with no TE required.
  • the drops from both of these when broken will be loot tables, and much easier to handle if they don't store internal inventory.
  • this is a further reaching problem than just these two blocks. Any food for instance (pumpkins + melons, vanilla carrots + potatoes) suffer from this issue and trying to extent this philosophy may be more work than it's worth.