Skip to content

Commit

Permalink
Disable wirecutter interaction on EOH when it's working (GTNewHorizon…
Browse files Browse the repository at this point in the history
…s#3710)

Co-authored-by: Maya <[email protected]>
Co-authored-by: Martin Robertz <[email protected]>
  • Loading branch information
3 people authored Dec 27, 2024
1 parent 29a106c commit 85b17a1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
Expand Down Expand Up @@ -938,17 +939,30 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ, ItemStack aTool) {
if (astralArrayAmount != 0) {
while (astralArrayAmount >= 64) {
if (recipeRunning) {
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("eoh.rightclick.wirecutter.1"));
} else {
long originalAmount = astralArrayAmount;
while (astralArrayAmount >= 64) {
if (aPlayer.inventory.getFirstEmptyStack() != -1) {
aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(64));
astralArrayAmount -= 64;
} else {
break;
}
}
if (aPlayer.inventory.getFirstEmptyStack() != -1) {
aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(64));
astralArrayAmount -= 64;
} else {
break;
aPlayer.inventory
.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(astralArrayAmount));
astralArrayAmount = 0;
}
if (originalAmount - astralArrayAmount > 0) {
GTUtility.sendChatToPlayer(
aPlayer,
StatCollector.translateToLocalFormatted(
"eoh.rightclick.wirecutter.2",
GTUtility.formatNumbers(originalAmount - astralArrayAmount)));
}
}
if (aPlayer.inventory.getFirstEmptyStack() != -1) {
aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(astralArrayAmount));
astralArrayAmount = 0;
}
}
return true;
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/tectech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ gt.blockcasingsBA0.11.desc.1=Can survive at least one big bang, maybe two...
achievement.gt.blockcasingsBA0.10=Reinforced Temporal Structure Casing
gt.blockcasingsBA0.10.desc.0=Resistant to temporal shearing from time dilation differences.
gt.blockcasingsBA0.10.desc.1=This block can last an eternity without any decay.

eoh.rightclick.wirecutter.1=Can't retrieve Astral Array Fabricators when the machine is working!
eoh.rightclick.wirecutter.2=Retrieved %s Astral Array Fabricators

# Antimatter
gt.blockmachines.antimatterForge.name=Semi-Stable Antimatter Stabilization Sequencer
Expand Down

0 comments on commit 85b17a1

Please sign in to comment.