Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
87e3058
programmable circuit slot trait
gustovafing May 8, 2026
6c2189b
battery slot trait
gustovafing May 8, 2026
7dcba95
machine instance factory interface
gustovafing May 8, 2026
afccb51
remove drop save machine interface
gustovafing May 8, 2026
5fed085
add generic arg to machine instance factory
gustovafing May 9, 2026
29b1d71
add machine class generic arg to builders & condense hpca machine cla…
gustovafing May 9, 2026
17b2af4
clean up some more singleblock machine constructors, add javadocs
gustovafing May 9, 2026
22af07d
add ctor params for item bus/fluid hatch storages
gustovafing May 9, 2026
28a8f5d
more small changes
gustovafing May 10, 2026
09ca589
remove IWorkableMultiController
gustovafing May 15, 2026
89f2474
battery slot trait stuff
gustovafing May 15, 2026
afc4c4f
spotless
gustovafing May 16, 2026
2bbf45a
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing May 20, 2026
8855d8b
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing Jun 12, 2026
90d824b
Merge branch 'mui2-refactor' into gus/more-trait-stuff
gustovafing Jun 12, 2026
f13382f
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing Jun 22, 2026
a29c74b
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing Jun 28, 2026
5568547
add recipe logic modifier trait
gustovafing Jun 28, 2026
46e8b27
remove imultipart iface
gustovafing Jun 28, 2026
1fa83c7
spotless
gustovafing Jun 28, 2026
b805c24
fix
gustovafing Jun 28, 2026
9fb3c70
block trait attachment after load
gustovafing Jun 29, 2026
93544f5
tiny method signature change
gustovafing Jun 29, 2026
259b74d
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing Jun 30, 2026
ab72966
update mui
gustovafing Jun 30, 2026
004c26c
fix slot sizes
gustovafing Jul 2, 2026
d10854a
!=
gustovafing Jul 2, 2026
ef786f2
some util stuff for multis and some docs
gustovafing Jul 2, 2026
3fe55e9
yippee reorganising files
gustovafing Jul 2, 2026
0a8a0b7
fix
gustovafing Jul 3, 2026
c1969fa
Merge branch '1.20.1' into gus/more-trait-stuff
gustovafing Jul 3, 2026
552e192
fix the assline
gustovafing Jul 3, 2026
aaa7409
Merge branch 'gus/more-trait-stuff' of https://github.com/GregTechCEu…
gustovafing Jul 3, 2026
a27457c
spotless
gustovafing Jul 3, 2026
f0fceed
a few more tiny removals
gustovafing Jul 3, 2026
4456155
fix build error & spotless
gustovafing Jul 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions docs/content/Modpacks/Changes/v8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,8 @@ The constructors for a large number of machines have changed in order to simply

#### **All Machines**
- Replace the first constructor argument `IMachineBlockEntity holder` with `BlockEntityCreationInfo info`
#### `TieredEnergyMachine`
- Removed `createEnergyContainer` method
- Constructor now has an optional `NotifiableEnergyContainer` argument
#### `WorkableTieredMachine`
- Removed `createRecipeLogic`, `createImportItemHandler`, `createExportItemHandler`, `createImportFluidHandler`, `createExportFluidHandler` methods
- Added a new constructor:
- `BlockEntityCreationInfo info`
- `int tier`
- `RecipeLogic recipeLogic` Recipe logic, defaults to the standard `RecipeLogic` class.
- `int importSlots` Item import slots, defaults to the amount of slots in the machine's default recipe type.
- `int exportSlots` Same as above, but for item export slots.
- `int fluidImportSlots` As above, but for fluid import slots.
- `int fluidExportSlots` As above, but for fluid export slots.
- `boolean isEnergyEmitter` If this machine should emit/receiver energy.
- `Int2IntFunction tankScalingFunction` Fluid tank capacity scaling function.
#### `WorkableMultiblockMachine`, `WorkableElectricMultiblockMachine` and `SteamWorkableMachine`
- Removed `createRecipeLogic` method
- Constructor now has an optional `Supplier<RecipeLogic>` argument, defaults to the standard `RecipeLogic` class
#### Machines with `createX` functions (e.g. `createEnergyContainer`, `createRecipeLogic`)
- Creation functions have been removed in favor of arguments being passed into the constructor.

#### IMPORTANT MIGRATION NOTE:

Expand All @@ -110,6 +94,8 @@ When migrating, remove the `this` argument from the machine trait constructor an

A large number of machine feature interfaces have been removed, and have had their functionality merged into the standard MetaMachine class, or now use the new machine trait system:

- `IMultiPart` Use the `MultiblockPartMachine` class directly.
- `IWorkableMultiController` Use the `WorkableMultiblockMachine` class directly.
- `ITurbineMachine` Use the `LargeTurbineMachine` class directly.
- `IRotorHolderMachine` Use the `RotorHolderMachine` class directly.
- `IMultiController` Use the `MultiblockControllerMachine` class directly.
Expand All @@ -124,7 +110,7 @@ A large number of machine feature interfaces have been removed, and have had the
- `IHPCAComputationProvider` - Use `HPCAComputationProviderTrait`
- `IHPCACoolantProvider` - Use `HPCACoolantProviderTrait`
- `IFluidRendererMulti` - Use `MultiblockFluidRendererTrait`

- `IMaintenanceMachine` Use `MaintenanceHatchPartMachine`

## Connected texture reimplementation
The mod's connected texture logic has been reimplemented in GTM proper.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/Modpacks/Examples/Multiblocks/Greenhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ title: "Greenhouse"
## Multiblock
=== "JavaScript"
```js title="greenhouse_multiblock.js"
const $RecipeLogic = Java.loadClass('com.gregtechceu.gtceu.api.machine.trait.RecipeLogic')
const $RecipeLogic = Java.loadClass('com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeLogic')
const $List = Java.loadClass('java.util.List')

GTCEuStartupEvents.registry('gtceu:machine', event => {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/Modpacks/Examples/Parallel-Hatch-Part.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GTCEuStartupEvents.registry("gtceu:machine", (event) => {
}

const $RecipeLogic = Java.loadClass(
"com.gregtechceu.gtceu.api.machine.trait.RecipeLogic"
"com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeLogic"
);
builder
.langValue(name + " Parallel Control Hatch")
Expand Down
2 changes: 1 addition & 1 deletion gradle/forge.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jei = "15.20.0.115"
rei = "12.1.785"
emi = "1.1.22+1.20.1"
ae2 = "15.0.18"
mui = "3.3.0-SNAPSHOT"
mui = "3.3.1-SNAPSHOT"
kubejs = "2001.6.5-build.16"
rhino = "2001.2.3-build.10"
architectury = "9.2.14"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,8 @@ public void setPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, @Nullabl
machine.setOwnerUUID(sPlayer.getUUID());
}

if (machine instanceof IDropSaveMachine dropSaveMachine) {
CompoundTag tag = pStack.getTag();
if (tag != null) {
dropSaveMachine.loadFromItem(tag);
}
}
CompoundTag tag = pStack.getTag();
if (tag != null) machine.loadFromItem(tag);
}
}
}
Expand Down Expand Up @@ -187,10 +183,8 @@ public BlockState getStateForPlacement(BlockPlaceContext context) {
@Override
public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState state) {
ItemStack itemStack = super.getCloneItemStack(level, pos, state);
if (MetaMachine.getMachine(level, pos) instanceof IDropSaveMachine dropSaveMachine &&
dropSaveMachine.savePickClone()) {
dropSaveMachine.saveToItem(itemStack.getOrCreateTag());
}
var machine = MetaMachine.getMachine(level, pos);
if (machine != null) machine.saveToItem(itemStack.getOrCreateTag(), true);
return itemStack;
}

Expand Down Expand Up @@ -243,13 +237,11 @@ public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
BlockEntity be = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY);
if (be instanceof MetaMachine machine) {
machine.modifyDrops(drops);
if (machine instanceof IDropSaveMachine dropSaveMachine && dropSaveMachine.saveBreak()) {
for (ItemStack drop : drops) {
if (drop.getItem() instanceof MetaMachineItem item && item.getBlock() == this) {
dropSaveMachine.saveToItem(drop.getOrCreateTag());
// break here to not dupe contents if a machine drops multiple of itself for whatever reason.
break;
}
for (ItemStack drop : drops) {
if (drop.getItem() instanceof MetaMachineItem item && item.getBlock() == this) {
machine.saveToItem(drop.getOrCreateTag(), false);
// break here to not dupe contents if a machine drops multiple of itself for whatever reason.
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnknownNullability;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -101,6 +102,11 @@ public long getOffsetTimer() {
return level == null ? offset : (level.getServer().getTickCount() + offset);
}

@Override
public @UnknownNullability Level getLevel() {
return super.getLevel();
}

@Override
public void setRemoved() {
super.setRemoved();
Expand Down Expand Up @@ -327,7 +333,7 @@ public UITexture getPipeTexture(boolean isBlock) {

@Override
public @Nullable UITexture sideTips(Player player, BlockPos pos, BlockState state, Set<GTToolType> toolTypes,
Direction side) {
ItemStack held, Direction side) {
if (toolTypes.contains(getPipeTuneTool())) {
if (player.isShiftKeyDown() && this.canHaveBlockedFaces()) {
return getPipeTexture(isBlocked(side));
Expand All @@ -337,7 +343,7 @@ public UITexture getPipeTexture(boolean isBlock) {
}
var cover = coverContainer.getCoverAtSide(side);
if (cover != null) {
return cover.sideTips(player, pos, state, toolTypes, side);
return cover.sideTips(player, pos, state, toolTypes, held, side);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gregtechceu.gtceu.api.capability;

import com.gregtechceu.gtceu.api.machine.feature.multiblock.IMaintenanceMachine;
import com.gregtechceu.gtceu.common.capability.MedicalConditionTracker;

import net.minecraftforge.common.capabilities.Capability;
Expand All @@ -20,8 +19,6 @@ public class GTCapability {
.get(new CapabilityToken<>() {});
public static final Capability<IElectricItem> CAPABILITY_ELECTRIC_ITEM = CapabilityManager
.get(new CapabilityToken<>() {});
public static final Capability<IMaintenanceMachine> CAPABILITY_MAINTENANCE_MACHINE = CapabilityManager
.get(new CapabilityToken<>() {});
public static final Capability<ILaserContainer> CAPABILITY_LASER = CapabilityManager
.get(new CapabilityToken<>() {});
public static final Capability<IOpticalComputationProvider> CAPABILITY_COMPUTATION_PROVIDER = CapabilityManager
Expand All @@ -43,7 +40,6 @@ public static void register(RegisterCapabilitiesEvent event) {
event.register(IWorkable.class);
event.register(IControllable.class);
event.register(IElectricItem.class);
event.register(IMaintenanceMachine.class);
event.register(ILaserContainer.class);
event.register(IOpticalComputationProvider.class);
event.register(IDataAccessHatch.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gregtechceu.gtceu.api.capability;

import com.gregtechceu.gtceu.api.machine.feature.multiblock.IMaintenanceMachine;
import com.gregtechceu.gtceu.common.capability.MedicalConditionTracker;

import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -75,11 +74,6 @@ public static IEnergyStorage getForgeEnergy(Level level, BlockPos pos, @Nullable
return null;
}

@Nullable
public static IMaintenanceMachine getMaintenanceMachine(Level level, BlockPos pos, @Nullable Direction side) {
return getBlockEntityCapability(GTCapability.CAPABILITY_MAINTENANCE_MACHINE, level, pos, side);
}

@Nullable
public static ILaserContainer getLaser(Level level, BlockPos pos, @Nullable Direction side) {
return getBlockEntityCapability(GTCapability.CAPABILITY_LASER, level, pos, side);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.gregtechceu.gtceu.api.capability;

import com.gregtechceu.gtceu.api.machine.trait.NotifiableComputationContainer;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableComputationContainer;

/**
* Used in conjunction with {@link NotifiableComputationContainer}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.trait.NotifiableComputationContainer;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableComputationContainer;
import com.gregtechceu.gtceu.api.recipe.content.ContentModifier;
import com.gregtechceu.gtceu.api.recipe.content.SerializerInteger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.feature.IOverclockMachine;
import com.gregtechceu.gtceu.api.machine.feature.ITieredMachine;
import com.gregtechceu.gtceu.api.machine.trait.NotifiableEnergyContainer;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableEnergyContainer;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.chance.logic.ChanceLogic;
import com.gregtechceu.gtceu.api.recipe.content.Content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.trait.*;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableFluidTank;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerGroup;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerGroupDistinctness;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerList;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.content.Content;
import com.gregtechceu.gtceu.api.recipe.content.ContentModifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.gregtechceu.gtceu.api.capability.recipe;

import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerList;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerList;

import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.trait.*;
import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerGroup;
import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerGroupDistinctness;
import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerList;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableItemStackHandler;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerGroup;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerGroupDistinctness;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerList;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.content.Content;
import com.gregtechceu.gtceu.api.recipe.content.ContentModifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.trait.NotifiableRecipeHandlerTrait;
import com.gregtechceu.gtceu.api.machine.trait.notifiable.NotifiableRecipeHandlerTrait;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.content.Content;
import com.gregtechceu.gtceu.api.recipe.content.ContentModifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public boolean shouldRenderGrid(Player player, BlockPos pos, BlockState state, I

@Override
public @Nullable UITexture sideTips(Player player, BlockPos pos, BlockState state, Set<GTToolType> toolTypes,
Direction side) {
ItemStack held, Direction side) {
if (toolTypes.contains(GTToolType.CROWBAR)) {
return GTGuiTextures.TOOL_REMOVE_COVER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ default boolean shouldRenderGrid(Player player, BlockPos pos, BlockState state,
* @param pos Block pos
* @param state Block state
* @param toolTypes The GT tool types of the held item, if any
* @param held
* @param side The machine side which this grid segment correspond to
* @return The icon to be rendered, or null
*/
default @Nullable UITexture sideTips(Player player, BlockPos pos, BlockState state, Set<GTToolType> toolTypes,
Direction side) {
ItemStack held, Direction side) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.api.item.IGTTool;
import com.gregtechceu.gtceu.api.item.tool.aoe.AoESymmetrical;
import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerList;
import com.gregtechceu.gtceu.api.machine.trait.recipe.RecipeHandlerList;
import com.gregtechceu.gtceu.api.recipe.GTRecipe;
import com.gregtechceu.gtceu.api.recipe.RecipeHelper;
import com.gregtechceu.gtceu.api.recipe.content.Content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public MachineCoverContainer(MetaMachine machine) {
}

@Override
public MachineTraitType<?> getTraitType() {
public MachineTraitType<MachineCoverContainer> getTraitType() {
return TYPE;
}

Expand Down Expand Up @@ -90,10 +90,10 @@ public boolean shouldRenderGridOverlay(Player player, BlockPos pos, BlockState s

@Override
public @Nullable UITexture getGridOverlayIcon(Player player, BlockPos pos, BlockState state,
Set<GTToolType> toolTypes, Direction side) {
Set<GTToolType> toolTypes, ItemStack held, Direction side) {
var cover = getCoverAtSide(side);
if (cover != null) {
return cover.sideTips(player, pos, state, toolTypes, side);
return cover.sideTips(player, pos, state, toolTypes, held, side);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import lombok.Setter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.EnumMap;
Expand Down Expand Up @@ -61,10 +60,10 @@ public class MachineDefinition implements Supplier<MetaMachineBlock> {
private Supplier<BlockEntityType<? extends BlockEntity>> blockEntityTypeSupplier;
@Getter
@Setter
private @NotNull GTRecipeType @NotNull [] recipeTypes;
private GTRecipeType[] recipeTypes;
@Getter
@Setter
private int tier;
private int tier = -1;
@Getter
@Setter
private int defaultPaintingColor;
Expand All @@ -74,19 +73,15 @@ public class MachineDefinition implements Supplier<MetaMachineBlock> {
@Getter
@Setter
private boolean alwaysTryModifyRecipe;
@NotNull
@Getter
@Setter
private BiPredicate<IRecipeLogicMachine, GTRecipe> beforeWorking = (machine, recipe) -> true;
@NotNull
private BiPredicate<IRecipeLogicMachine, @Nullable GTRecipe> beforeWorking = (machine, recipe) -> true;
@Getter
@Setter
private Predicate<IRecipeLogicMachine> onWorking = (machine) -> true;
@NotNull
@Getter
@Setter
private Consumer<IRecipeLogicMachine> onWaiting = (machine) -> {};
@NotNull
@Getter
@Setter
private Consumer<IRecipeLogicMachine> afterWorking = (machine) -> {};
Expand Down Expand Up @@ -141,6 +136,10 @@ public MachineDefinition(ResourceLocation id) {
this.id = id;
}

public boolean isTiered() {
return tier != -1;
}

public final void registerDefaultState(MachineRenderState state) {
this.defaultRenderState = state;
}
Expand Down
Loading
Loading