Skip to content

Commit

Permalink
Merge branch 'master' (early part) into improve-structure-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursivePineapple committed Feb 3, 2025
2 parents 37023cd + 59c3ed2 commit a2df4ac
Show file tree
Hide file tree
Showing 293 changed files with 1,670 additions and 5,731 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies {
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.8:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.2-1.7.10:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.3-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-533-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.28-gtnh:dev")
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/ggfab/mte/MTELinkedInputBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,8 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {

@Override
public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (!getBaseMetaTileEntity().getCoverBehaviorAtSideNew(side)
.isGUIClickable(
side,
getBaseMetaTileEntity().getCoverIDAtSide(side),
getBaseMetaTileEntity().getComplexCoverDataAtSide(side),
getBaseMetaTileEntity()))
return;
if (!getBaseMetaTileEntity().getCoverInfoAtSide(side)
.isGUIClickable()) return;
if (aPlayer.isSneaking()) {
if (this.mRealInventory == null) {
aPlayer.addChatMessage(new ChatComponentTranslation("ggfab.info.linked_input_bus.no_channel"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve
new TextWidget(StatCollector.translateToLocal("gui.NeutronActivator.0"))
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(
new TextWidget().setStringSupplier(() -> numberFormat.format(eV / 1_000_000d) + " MeV")
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.IntegerSyncer(() -> eV, val -> eV = val));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,14 +649,14 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve
() -> StatCollector.translateToLocal("gui.YOTTank.0") + " " + numberFormat.format(mStorage) + " L")
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorage, val -> mStorage = val))
.widget(
new TextWidget()
.setStringSupplier(() -> StatCollector.translateToLocal("gui.YOTTank.1") + " " + getFluidName())
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val))
.widget(
new TextWidget()
Expand All @@ -666,15 +666,15 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve
+ " L")
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.BigIntegerSyncer(() -> mStorageCurrent, val -> mStorageCurrent = val))
.widget(
new TextWidget()
.setStringSupplier(
() -> StatCollector.translateToLocal("gui.YOTTank.3") + " " + getLockedFluidName())
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setTextAlignment(Alignment.CenterLeft)
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.FluidStackSyncer(() -> mLockedFluid, val -> mLockedFluid = val))
.widget(new FakeSyncWidget.BooleanSyncer(() -> isFluidLocked, val -> isFluidLocked = val))
.widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcessEnabled, val -> voidExcessEnabled = val));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
stopMachine(ShutDownReasonRegistry.STRUCTURE_INCOMPLETE);
}
}
aBaseMetaTileEntity
.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64));
setErrorDisplayID((getErrorDisplayID() & ~127) | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
} else {
doActivitySound(getActivitySoundLoop());
Expand Down Expand Up @@ -584,7 +583,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve
+ " EU")
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.LongSyncer(this::maxEUStore, val -> energyStorageCache = val))
.widget(
new TextWidget()
Expand All @@ -594,7 +593,7 @@ protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inve
+ " EU")
.setTextAlignment(Alignment.CenterLeft)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0))
.setEnabled(widget -> getErrorDisplayID() == 0))
.widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar));
}

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/goodgenerator/main/GoodGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import goodgenerator.common.CommonProxy;
import goodgenerator.crossmod.thaumcraft.Research;
import goodgenerator.items.GGMaterial;
Expand Down Expand Up @@ -41,8 +39,6 @@ public final class GoodGenerator {
@SidedProxy(clientSide = "goodgenerator.client.ClientProxy", serverSide = "goodgenerator.common.CommonProxy")
public static CommonProxy proxy;

public static SimpleNetworkWrapper CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);

static {}

@Mod.Instance(GoodGenerator.MOD_ID)
Expand Down
87 changes: 0 additions & 87 deletions src/main/java/goodgenerator/network/MessageMTEBase.java

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/gregtech/api/enums/MetaTileEntityIDs.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ public enum MetaTileEntityIDs {
QUADRUPLE_INPUT_HATCHES_MAX(719),
Nuclear_Salt_Processing_Plant(749),
ThoriumReactor(751),
TreeFarmer_Structural(752),
Boiler_Advanced_LV(753),
Boiler_Advanced_MV(754),
Boiler_Advanced_HV(755),
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/gregtech/api/factory/test/TestFactoryHatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import mcp.mobius.waila.api.IWailaDataAccessor;
import tectech.thing.metaTileEntity.hatch.MTEBaseFactoryHatch;
import tectech.util.CommonValues;
import tectech.util.TTUtility;

public class TestFactoryHatch extends MTEBaseFactoryHatch implements TestFactoryElement {

Expand All @@ -36,7 +35,6 @@ public TestFactoryHatch(int aID, String aName, String aNameRegional, int aTier)
StatCollector.translateToLocal("gt.blockmachines.hatch.datain.desc.0"),
StatCollector.translateToLocal("gt.blockmachines.hatch.datain.desc.1"),
EnumChatFormatting.AQUA + StatCollector.translateToLocal("gt.blockmachines.hatch.datain.desc.2") });
TTUtility.setTier(aTier, this);
}

protected TestFactoryHatch(TestFactoryHatch prototype) {
Expand Down
53 changes: 10 additions & 43 deletions src/main/java/gregtech/api/gui/modularui/GTUIInfos.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.api.net.GTPacketSendCoverData;
import gregtech.api.util.CoverBehaviorBase;
import gregtech.common.covers.CoverInfo;

public class GTUIInfos {

Expand Down Expand Up @@ -70,26 +70,16 @@ public static void init() {}
.container((player, world, x, y, z) -> {
final TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof ICoverable gtTileEntity)) return null;
final CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side);
return createCoverContainer(
player,
cover::createWindow,
te::markDirty,
gtTileEntity.getCoverIDAtSide(side),
side,
gtTileEntity);
return gtTileEntity.getCoverInfoAtSide(side)
.createCoverContainer(player);
})
.gui((player, world, x, y, z) -> {
if (!world.isRemote) return null;
final TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof ICoverable gtTileEntity)) return null;
final CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side);
return createCoverGuiContainer(
player,
cover::createWindow,
gtTileEntity.getCoverIDAtSide(side),
side,
gtTileEntity);
ModularUIContainer container = gtTileEntity.getCoverInfoAtSide(side)
.createCoverContainer(player);
return (container == null) ? null : new ModularGui(container);
})
.build());
}
Expand All @@ -109,17 +99,14 @@ public static void openGTTileEntityUI(IHasWorldObjectAndCoords aTileEntity, Enti
}

/**
* Opens cover UI, created by {@link CoverBehaviorBase#createWindow}.
* Opens cover UI, created by {@link CoverInfo#createWindow}.
*/
public static void openCoverUI(ICoverable tileEntity, EntityPlayer player, ForgeDirection side) {
if (tileEntity.isClientSide()) return;

CoverInfo coverInfo = tileEntity.getCoverInfoAtSide(side);
GTValues.NW.sendToPlayer(
new GTPacketSendCoverData(
side,
tileEntity.getCoverIDAtSide(side),
tileEntity.getComplexCoverDataAtSide(side),
tileEntity),
new GTPacketSendCoverData(side, coverInfo.getCoverID(), coverInfo.getCoverData(), tileEntity),
(EntityPlayerMP) player);

coverUI.get(side)
Expand Down Expand Up @@ -157,27 +144,7 @@ private static ModularGui createTileEntityGuiContainer(EntityPlayer player,
windowCreator,
null,
containerConstructor);
if (container == null) return null;
return new ModularGui(container);
}

private static ModularUIContainer createCoverContainer(EntityPlayer player,
Function<CoverUIBuildContext, ModularWindow> windowCreator, Runnable onWidgetUpdate, int coverID,
ForgeDirection side, ICoverable tile) {
final CoverUIBuildContext buildContext = new CoverUIBuildContext(player, coverID, side, tile, false);
final ModularWindow window = windowCreator.apply(buildContext);
if (window == null) return null;
return new ModularUIContainer(new ModularUIContext(buildContext, onWidgetUpdate), window);
}

@SideOnly(Side.CLIENT)
private static ModularGui createCoverGuiContainer(EntityPlayer player,
Function<CoverUIBuildContext, ModularWindow> windowCreator, int coverID, ForgeDirection side, ICoverable tile) {
final ModularUIContainer container = createCoverContainer(player, windowCreator, null, coverID, side, tile);
if (container == null) {
return null;
}
return new ModularGui(container);
return (container == null) ? null : new ModularGui(container);
}

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import net.minecraftforge.common.util.ForgeDirection;

import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.CoverBehavior;
import gregtech.api.util.ISerializableObject;
import gregtech.common.covers.CoverInfo;

/**
* Implemented by the MetaTileEntity of the Redstone Circuit Block
Expand Down Expand Up @@ -36,11 +37,11 @@ public interface IRedstoneCircuitBlock {
/**
* If this Side is Covered up and therefor not doing any Redstone
*/
CoverBehavior getCover(ForgeDirection side);
CoverInfo getCover(ForgeDirection side);

int getCoverID(ForgeDirection side);

int getCoverVariable(ForgeDirection side);
ISerializableObject getCoverData(ForgeDirection side);

/**
* returns whatever Block-ID is adjacent to the Redstone Circuit Block
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit a2df4ac

Please sign in to comment.