Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/deprecations-cleanup' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Dec 24, 2024
2 parents f3b258d + f6eab71 commit 6a9ce86
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ public boolean supportsBatchMode() {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (aPlayer.isSneaking()) {
batchMode = !batchMode;
if (batchMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,23 +588,22 @@ protected boolean supportsSlotAutomation(int aSlot) {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (!aPlayer.isSneaking()) {
if (mode == 0) return false;
inputSeparation = !inputSeparation;
GTUtility.sendChatToPlayer(
aPlayer,
StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation);
return true;
} else {
batchMode = !batchMode;
if (batchMode) {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
} else {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
}
return true;
}
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javax.annotation.Nonnull;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
Expand All @@ -39,8 +38,8 @@
import net.minecraftforge.fluids.FluidStack;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;

import bartworks.API.BorosilicateGlass;
Expand Down Expand Up @@ -222,7 +221,7 @@ public void loadNBTData(NBTTagCompound aNBT) {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (!aPlayer.isSneaking()) {
this.inputSeparation = !this.inputSeparation;
GTUtility.sendChatToPlayer(
Expand Down Expand Up @@ -329,12 +328,12 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
}

@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
this.glassTier = 0;
this.setCoilLevel(HeatingCoilLevel.None);
return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true);
return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, env, false, true);
}

public void setCoilLevel(HeatingCoilLevel aCoilLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@
import static gregtech.api.util.GTStructureUtility.buildHatchAdder;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;

import bartworks.API.BorosilicateGlass;
Expand Down Expand Up @@ -160,7 +159,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (aPlayer.isSneaking()) {
this.batchMode = !this.batchMode;
if (this.batchMode) {
Expand All @@ -185,11 +184,10 @@ public void construct(ItemStack aStack, boolean aHintsOnly) {
}

@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
return this
.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true);
return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, env, false, true);
}
// -------------- TEC TECH COMPAT ----------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
Expand All @@ -36,9 +35,9 @@
import net.minecraftforge.fluids.FluidStack;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;

import bartworks.common.configs.Configuration;
Expand Down Expand Up @@ -327,12 +326,11 @@ public void construct(ItemStack stackSize, boolean hintsOnly) {
}

@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
this.mHeight = 0;
int built = this
.survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true);
int built = this.survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, env, false, true);
if (built >= 0) return built;
int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height
for (int i = 1; i < tTotalHeight - 1; i++) {
Expand All @@ -344,8 +342,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource
5 * this.mHeight,
0,
realBudget,
source,
actor,
env,
false,
true);
if (built >= 0) return built;
Expand All @@ -358,8 +355,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource
5 * this.mHeight,
0,
realBudget,
source,
actor,
env,
false,
true);
}
Expand All @@ -374,7 +370,7 @@ public void loadNBTData(NBTTagCompound aNBT) {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (aPlayer.isSneaking()) {
this.batchMode = !this.batchMode;
if (this.batchMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import javax.annotation.Nonnull;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
Expand All @@ -43,8 +42,8 @@
import net.minecraftforge.fluids.FluidStack;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IItemSource;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;

import bartworks.API.BorosilicateGlass;
Expand Down Expand Up @@ -246,11 +245,10 @@ public void construct(ItemStack aStack, boolean aHintsOnly) {
}

@Override
public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) {
public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) {
if (this.mMachine) return -1;
int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5);
return this
.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true);
return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, env, false, true);
}
// -------------- TEC TECH COMPAT ----------------

Expand Down Expand Up @@ -429,7 +427,7 @@ public boolean supportsBatchMode() {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
if (aPlayer.isSneaking()) {
batchMode = !batchMode;
if (batchMode) {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/ggfab/mte/MTEAdvAssLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
import gregtech.api.util.OverclockCalculator;
import gregtech.api.util.VoidProtectionHelper;
import gregtech.api.util.shutdown.ShutDownReason;
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gregtech.common.tileentities.machines.MTEHatchInputBusME;
import gregtech.common.tileentities.machines.MTEHatchInputME;
import mcp.mobius.waila.api.IWailaConfigHandler;
Expand Down Expand Up @@ -432,12 +433,12 @@ public void loadNBTData(NBTTagCompound aNBT) {
}

/**
* roughly the same as {@link #criticalStopMachine()}, but does not attempt to send a halting sound if world is not
* Does a critical shutdown of the machine, but does not attempt to send a halting sound if world is not
* loaded. also supports setting a stop reason
*/
private void criticalStopMachine(String reason) {
int oMaxProgresstime = mMaxProgresstime;
stopMachine();
stopMachine(ShutDownReasonRegistry.NONE);
// don't do these at all if the machine wasn't working before anyway
if (oMaxProgresstime > 0) {
if (getBaseMetaTileEntity().getWorld() != null) sendSound(INTERRUPT_SOUND_INDEX);
Expand Down Expand Up @@ -993,7 +994,7 @@ public boolean supportsBatchMode() {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
batchMode = !batchMode;
if (batchMode) {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
batchMode = !batchMode;
if (batchMode) {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.metatileentity.implementations.MTEHatchInput;
import gregtech.api.metatileentity.implementations.MTEHatchInputBus;
import gregtech.api.metatileentity.implementations.MTEHatchOutput;
import gregtech.api.objects.GTRenderedTexture;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.check.CheckRecipeResult;
Expand All @@ -48,7 +43,6 @@
import gregtech.api.util.GTUtility;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.OverclockCalculator;
import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti;

public class MTEFuelRefineFactory extends MTETooltipMultiBlockBaseEM implements IConstructable, ISurvivalConstructable {

Expand Down Expand Up @@ -229,59 +223,16 @@ protected void setProcessingLogicPower(ProcessingLogic logic) {
logic.setAvailableAmperage(1);
}

public final boolean addToFRFList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
} else {
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) {
return false;
} else {
if (aMetaTileEntity instanceof MTEHatch) {
((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
}
if (aMetaTileEntity instanceof MTEHatchInput) {
return this.mInputHatches.add((MTEHatchInput) aMetaTileEntity);
} else if (aMetaTileEntity instanceof MTEHatchOutput) {
return this.mOutputHatches.add((MTEHatchOutput) aMetaTileEntity);
} else if (aMetaTileEntity instanceof MTEHatchInputBus) {
return this.mInputBusses.add((MTEHatchInputBus) aMetaTileEntity);
} else if (aMetaTileEntity instanceof MTEHatchEnergy) {
return this.mEnergyHatches.add((MTEHatchEnergy) aMetaTileEntity);
} else if (aMetaTileEntity instanceof MTEHatchEnergyMulti) {
return this.eEnergyMulti.add((MTEHatchEnergyMulti) aMetaTileEntity);
} else {
return false;
}
}
}
}

@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new MTEFuelRefineFactory(this.mName);
}

@Override
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}

@Override
public int getDamageToComponent(ItemStack aStack) {
return 0;
}

@Override
public boolean explodesOnComponentBreak(ItemStack aStack) {
return true;
}

@Override
public boolean isCorrectMachinePart(ItemStack aStack) {
return true;
}

@Override
public String[] getInfoData() {
String[] infoData = new String[super.getInfoData().length + 1];
Expand All @@ -292,7 +243,7 @@ public String[] getInfoData() {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
float aX, float aY, float aZ, ItemStack aTool) {
batchMode = !batchMode;
if (batchMode) {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
Expand Down
Loading

0 comments on commit 6a9ce86

Please sign in to comment.