Remove unnecessary interfaces & port more traits#4560
Closed
gustovafing wants to merge 9 commits into1.20.1-v8.0.0from
Closed
Remove unnecessary interfaces & port more traits#4560gustovafing wants to merge 9 commits into1.20.1-v8.0.0from
gustovafing wants to merge 9 commits into1.20.1-v8.0.0from
Conversation
TechLord22
reviewed
Feb 7, 2026
Comment on lines
+190
to
+196
| } else if (held.isEmpty()) { | ||
| var drained = cache.extractItem(0, player.isShiftKeyDown() ? stored.getMaxStackSize() : 1, false); | ||
| if (!drained.isEmpty()) { | ||
| if (!player.addItem(drained)) { | ||
| Block.popResourceFromFace(world, getBlockPos(), getFrontFacing(), drained); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
This is supposed to be on left click?
| } | ||
|
|
||
| @SubscribeEvent | ||
| public static void onLeftClickBlock(PlayerInteractEvent.LeftClickBlock event) { |
Member
There was a problem hiding this comment.
What replaced this functionality?
Comment on lines
+117
to
+121
| public void setOnFire() { | ||
| setOnFire(getLevel(), getBlockPos(), fireChance); | ||
| } | ||
|
|
||
| private static void setOnFire(Level level, BlockPos pos, double additionalFireChance) { |
Member
There was a problem hiding this comment.
Merge together into public void setOnFire()
Comment on lines
+106
to
+110
| public void doExplosion(float power) { | ||
| doExplosion(getLevel(), getBlockPos(), power); | ||
| } | ||
|
|
||
| public static void doExplosion(Level level, BlockPos pos, float explosionPower) { |
Member
There was a problem hiding this comment.
Merge into public void doExplosion(float explosionPower).
| if (side == null || inputsEnergy(side)) { | ||
| if (voltage > getInputVoltage()) { | ||
| machine.doExplosion(GTUtil.getExplosionPower(voltage)); | ||
| ExplodableMachineTrait.doExplosion(getLevel(), getBlockPos(), GTUtil.getExplosionPower(voltage)); |
Member
There was a problem hiding this comment.
This should get the trait and do the explosion via that. Don't use a static method.
| this.upkeepEUt = upkeepEUt; | ||
| this.maxEUt = maxEUt; | ||
| this.canBeDamaged = canBeDamaged; | ||
| this.isDamaged = false; |
Comment on lines
+52
to
+55
| public <T extends MachineTrait> Optional<T> getTraitOptional(MachineTraitType<T> type) { | ||
| return Optional.ofNullable(getTrait(type)); | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
We don't want to be using Optional. Remove.
| this.advanced = advanced; | ||
| } | ||
|
|
||
| public static HPCAComponentTrait createHPCATrait(HPCAComponentPartMachine machine, boolean isAdvanced) { |
| @Override | ||
| public boolean canBeDamaged() { | ||
| return false; | ||
| public static HPCAComponentTrait createHPCATrait(HPCAComponentPartMachine machine, boolean isAdvanced) { |
Comment on lines
+654
to
+661
| public static void doExplosion(Level level, BlockPos pos, float explosionPower) { | ||
| level.removeBlock(pos, false); | ||
| level.explode(null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, | ||
| explosionPower, ConfigHolder.INSTANCE.machines.doesExplosionDamagesTerrain ? | ||
| Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); | ||
| } | ||
|
|
||
| public static void setOnFire(Level level, BlockPos pos, double additionalFireChance) { |
Member
There was a problem hiding this comment.
These are ok to exist external to the trait, but GT should never be calling them when a trait is accessible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What