aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-28 18:25:02 +0900
committerGitHub <noreply@github.com>2023-05-28 11:25:02 +0200
commit7b8bcd9e5e9a52085b8cfafd3bede48ccd51d31a (patch)
tree559297f2aef0169955e2ad043a2226950c04990a /src/main/java/gtPlusPlus/xmod/gregtech/api
parente010c8be798fda1d564880d64bde438d01ecf519 (diff)
downloadGT5-Unofficial-7b8bcd9e5e9a52085b8cfafd3bede48ccd51d31a.tar.gz
GT5-Unofficial-7b8bcd9e5e9a52085b8cfafd3bede48ccd51d31a.tar.bz2
GT5-Unofficial-7b8bcd9e5e9a52085b8cfafd3bede48ccd51d31a.zip
Update to new void protection API (#640)
* Update to new void protection API * Update method names * Update GT
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 6841f93ebb..9f91edc07d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -26,7 +26,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -51,6 +50,7 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
+import gregtech.api.enums.VoidingMode;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.IIconContainer;
@@ -131,12 +131,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
public GregtechMeta_MultiBlockBase(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
- voidExcess = false;
}
public GregtechMeta_MultiBlockBase(final String aName) {
super(aName);
- voidExcess = false;
}
public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
@@ -607,10 +605,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs)
.setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes)
- .enableConsumption().enableOutputCalculation().setEUtModifier(aEUPercent / 100.0f);
- if (!voidExcess) {
- helper.enableVoidProtection(this);
- }
+ .enableConsumption().enableOutputCalculation().setEUtModifier(aEUPercent / 100.0f).setController(this);
if (batchMode) {
helper.enableBatchMode(128);
@@ -816,10 +811,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs)
.setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes)
- .enableConsumption().enableOutputCalculation();
- if (!voidExcess) {
- helper.enableVoidProtection(this);
- }
+ .enableConsumption().enableOutputCalculation().setController(this);
if (batchMode) {
helper.enableBatchMode(128);
@@ -1633,7 +1625,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
super.loadNBTData(aNBT);
this.mTotalRunTime = aNBT.getLong("mTotalRunTime");
if (!aNBT.hasKey(VOID_EXCESS_NBT_KEY)) {
- voidExcess = aNBT.getBoolean("mVoidExcess");
+ voidingMode = aNBT.getBoolean("mVoidExcess") ? VoidingMode.VOID_ALL : VoidingMode.VOID_NONE;
}
if (!aNBT.hasKey(BATCH_MODE_NBT_KEY)) {
batchMode = aNBT.getBoolean("mUseMultiparallelMode");
@@ -1883,18 +1875,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
}
@Override
- public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
- float aX, float aY, float aZ) {
- boolean tSuper = super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ);
- if (aPlayer.isSneaking()) return tSuper;
- voidExcess = !voidExcess;
- aPlayer.addChatMessage(
- new ChatComponentTranslation(
- voidExcess ? "interaction.voidexcess.enabled" : "interaction.voidexcess.disabled"));
- return true;
- }
-
- @Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
if (aPlayer.isSneaking()) {
@@ -2151,12 +2131,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
private static final ConcurrentHashMap<String, ItemStack> mToolStacks = new ConcurrentHashMap<>();
@Override
- protected boolean isVoidExcessButtonEnabled() {
+ public boolean supportsVoidProtection() {
return true;
}
@Override
- protected boolean isBatchModeButtonEnabled() {
+ public boolean supportsBatchMode() {
return true;
}