Rework Project Red Project Bench and Autocrafting Bench - #63
Rework Project Red Project Bench and Autocrafting Bench#63PLASMAchicken wants to merge 26 commits into
Conversation
3fc1b09 to
f810218
Compare
Ranzuu
left a comment
There was a problem hiding this comment.
Localization
en_US.lang
> item.projectred.expansion.plan.name=Recipe Plan
item.projectred.expansion.plan.tooltip.output=Output: %s
item.projectred.expansion.plan.tooltip.inputs=Inputs:
item.projectred.expansion.plan.tooltip.empty=Empty
Co-authored-by: Ranzu <66495944+Ranzuu@users.noreply.github.com>
Co-Authored-By: Ranzu <66495944+Ranzuu@users.noreply.github.com>
| Keyboard.KEY_RSHIFT | ||
| ) | ||
| if ( | ||
| !this.recursive && (`type` eq IItemRenderer.ItemRenderType.INVENTORY) && isShiftHeld |
There was a problem hiding this comment.
I think it would make sense to check this.recursive first and early out since it avoids Keyboard.isKeyDown checks (also makes it clearer that it is a bypass for this function)
Especially since you already have two if statements
| tile.currentInputs, | ||
| storage | ||
| ) | ||
| ) && tile.currentRecipe.matches(tile.invCrafting, tile.world) |
There was a problem hiding this comment.
It appears this matches logic could be lifted as an early out to avoid duplicating it
| FMLCommonHandler | ||
| .instance() | ||
| .firePlayerCraftingEvent(player, stack, invCrafting) | ||
| FMLCommonHandler.instance.firePlayerCraftingEvent( |
There was a problem hiding this comment.
Where did the () go?
TIL Scala is totally okay without parens here but I think it should be consistent with the rest of the file.
|
|
||
| if (remainder != null && gridStack != null) { | ||
| // Case 1: No plan active AND this grid slot is now empty → put remainder back in grid | ||
| if (!tile.isPlanRecipe && (gridStack.isItemEqual(remainder))) { |
There was a problem hiding this comment.
I don't understand how gridStack.isItemEqual(remainder) means it is now empty
| recipe.matches(tile.invCrafting, world) | ||
| } | ||
|
|
||
| private var i = 0 |
There was a problem hiding this comment.
Holly shadowing, I know it is old code but this should be renamed
| if (!tile.isPlanRecipe) increment() | ||
| val start = i | ||
| do { | ||
| val stack2 = storage(i) |
There was a problem hiding this comment.
Renaming these from 1/2 to something more descriptive would also be nice
| storage(i) = null; | ||
| } | ||
|
|
||
| val copy = stack2.copy(); |
There was a problem hiding this comment.
I don't know if it is worth it but would skipping the copy when the item is deleted be beneficial?
Changelog:
Autocrafter + Project Bench fixed OreDict check-> Autocrafter + Project Bench removed OreDict check because it ignores NBT check
Ports #16 to Project Bench
Fix https://github.com/GTNewHorizons/Dupes-Exploits-GTNH/issues/216
Fix https://github.com/GTNewHorizons/Dupes-Exploits-GTNH/issues/220
Fix https://github.com/GTNewHorizons/Dupes-Exploits-GTNH/issues/224
Fix https://github.com/GTNewHorizons/Dupes-Exploits-GTNH/issues/311
Fix Project Bench uses 100% of Tool durability for 1 Item GT-New-Horizons-Modpack#22236
Fix ProjectRed Expansion Auto Crafting Bench duplicates Fresh Milk GT-New-Horizons-Modpack#14537
Fix [ProjectRed Expansion] Can't see accurately what is the item in Recipe Plan while holding LEFT/RIGHT SHIFT on the Project or Auto Crafting Bench GT-New-Horizons-Modpack#14182
Fix ProjectRed project bench instantly breaking tools GT-New-Horizons-Modpack#14127
Fix Project bench consumes GT tools GT-New-Horizons-Modpack#11423