Add Impulse Hopper #73
No reviewers
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/impulse"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Co-authored-by: ferriarnus ferriarnus@users.noreply.github.com
Description
The Impulse Hopper. Updates #23 to 1.19.x
Todo
Checklist:
@ -7,6 +7,7 @@ public enum Scalers implements IScaler {FIXED((v, l) -> v),Is that really the right formula?
DEV_ENERGY_TRANSFER has 120 as base value, which would be for
level 1: 14400 FE
level 2: 57600 FE
level 3: 129600 FE
I guess the correct formula would be
v * Math.pow(l,2)but the normal pow has the same "problem", we might need to revisit that
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;reverse checking order as shouldActTick is the likely faster computation
rename to follow java standards
use one type of spacing
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;Fixed in next commit
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;Fixed in next commit
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;Fixed in next commit
@ -7,6 +7,7 @@ public enum Scalers implements IScaler {FIXED((v, l) -> v),@ferriarnus Can you check if this is intended?
@ -7,6 +7,7 @@ public enum Scalers implements IScaler {FIXED((v, l) -> v),Hmm could be. I added it a while ago based on 1.12, but it seems agnor is right.
Mostly a handful of questions, looking good though 👍
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;Don't worry about these capacitor todos. I imagine this PR will merge before #72 so I'll handle these here :)
Not anything needing changed, more of a dev note :)
@ -29,3 +31,3 @@/*** Consume energy from storage.* @apiNote This is capped to {@link #getMaxEnergyUse()}, for uncapped use {@link #takeEnergy(int)} instead.*Maybe instead of this, mutation operations should have a simulate boolean akin to Forge's energy API?
@ -20,3 +20,3 @@throw new RuntimeException("Ghost slot can be externally modified!!");if (!layout.guiCanInsert(index) || !layout.guiCanExtract(index))if (!layout.guiCanInsert(index))throw new RuntimeException("Ghost slot cannot be modified by the player!");Why was this change again @ferriarnus, I remember you explained it but it slips my mind
@ -0,0 +1,39 @@package com.enderio.machines.common.menu;What is this commented method left for?
@ -0,0 +1,39 @@package com.enderio.machines.common.menu;It's one of mine, but I think it was fixed with your slot impl? Or maybe not cause dragging logic is a pain.
@ -20,3 +20,3 @@throw new RuntimeException("Ghost slot can be externally modified!!");if (!layout.guiCanInsert(index) || !layout.guiCanExtract(index))if (!layout.guiCanInsert(index))throw new RuntimeException("Ghost slot cannot be modified by the player!");I don't know what this exactly does but trying to open the container in-game without that line causes the exception(thrown under that line) to arise.
@ -0,0 +1,39 @@package com.enderio.machines.common.menu;Dragging looks like it is fixed. Removing the commented code
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;fixed
Impulse Hopper should be feature complete now. Please check it.
Only thing left missing are GhostSlot related:
@ -29,3 +31,3 @@/*** Consume energy from storage.* @apiNote This is capped to {@link #getMaxEnergyUse()}, for uncapped use {@link #takeEnergy(int)} instead.*This can be done as this method isn't used anywhere else. Should I make the change ?
@ -0,0 +1,61 @@package com.enderio.machines.client.gui.screen;add spaces
formatting
@ -0,0 +1,102 @@package com.enderio.machines.common.blockentity;first check the condition of the second check as that one should be faster.
then checkfor empty as that one is faster. and or that check with ItemStack#tagMatches, as this will check for NBT and CapNBT and not only if the items are identical
make methods private that should not be called from outside
@ -0,0 +82,4 @@result = stack.copy();result.setCount(ghost.getCount());} else if (stack.is(result.getItem())) {result.setCount(result.getCount() + ghost.getCount());Is this check not always true, because of the check in canPass? So the last else with a continue should never be able to run
@ -48,6 +46,8 @@ public class MachineBlockEntities {public static final BlockEntityEntry<SlicerBlockEntity> SLICE_AND_SPLICE = register("slice_and_splice", SlicerBlockEntity::new,MachineBlocks.SLICE_AND_SPLICE);@ -0,0 +1,39 @@package com.enderio.machines.common.menu;wrong Nullable Annotation (use jetbrains) and import it instead of the fullname
@ -29,3 +31,3 @@/*** Consume energy from storage.* @apiNote This is capped to {@link #getMaxEnergyUse()}, for uncapped use {@link #takeEnergy(int)} instead.*I'd say so, aye please
@ -29,3 +31,3 @@/*** Consume energy from storage.* @apiNote This is capped to {@link #getMaxEnergyUse()}, for uncapped use {@link #takeEnergy(int)} instead.*Done!
I'm happy with this, thanks for your hard work!
This is now good codewise, but some things appeared during testing:
If you want to I can search for those errors, lmk