mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84052a1c42 | ||
|
|
554a08a515 | ||
|
|
55928c5234 | ||
|
|
65c5d3aec5 | ||
|
|
7737598e4f | ||
|
|
eb9845d3a0 | ||
|
|
7a61bb9dee |
No files matched your search
+20
-18
@@ -1,26 +1,27 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.7:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.4:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.60-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.10:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.30:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.110-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.30:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.61:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.14.27-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.14.93-GTNH:dev")
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.22:dev') {transitive = false}
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.30:dev') {transitive = false}
|
||||
compileOnly('ganymedes01.etfuturum:Et-Futurum-Requiem:2.6.48-GTNH:dev') {transitive = false}
|
||||
runtimeOnlyNonPublishable('com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.4:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-812-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.576:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.37-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.17:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.9-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.14-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.16-GTNH:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.11:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-997-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.14:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.79-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.28:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.26-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.26-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.48-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
@@ -28,6 +29,7 @@ dependencies {
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta66a:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.58:dev")
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.49:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.166:dev")
|
||||
compileOnly('curse.maven:automagy-222153:2285272')
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.26'
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ import crazypants.util.EE3Util;
|
||||
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = """
|
||||
required-after:CoFHLib@[1.7.10R1.0.3B3,);\
|
||||
required-after:endercore;\
|
||||
required-after:gtnhlib@[0.2.10,);\
|
||||
required-after:gtnhlib@[0.9.47,);\
|
||||
after:MineFactoryReloaded;\
|
||||
after:Forestry;\
|
||||
after:Waila@[1.5.8,);\
|
||||
@@ -214,7 +214,9 @@ public class EnderIO {
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static final boolean hasHP = Loader.isModLoaded("hodgepodge");
|
||||
public static final boolean hasEtFuturum = Loader.isModLoaded("etfuturum");
|
||||
public static final boolean hasWailaPlugins = Loader.isModLoaded("wailaplugins");
|
||||
public static final boolean hasAutomagy = Loader.isModLoaded("Automagy");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
|
||||
@@ -31,6 +31,7 @@ import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
@@ -239,7 +240,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
String priority = EnderIO.lang.localize("gui.conduit.item.priority");
|
||||
fr.drawString(priority, left + 12, top1 + 25, ColorUtil.getRGB(Color.black));
|
||||
fr.drawString(str, left + priLeft + priWidth - sw - gap, top1 + 25, ColorUtil.getRGB(Color.black));
|
||||
fr.drawString(str, left + priLeft + priWidth - sw - gap, top1 + 25, ColorUtils.priorityString.getColor());
|
||||
|
||||
if (insertFilterGui != null) insertFilterGui.renderCustomOptions(top1, par1, par2, par3);
|
||||
if (extractFilterGui != null) extractFilterGui.renderCustomOptions(top1, par1, par2, par3);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package crazypants.enderio.etfuturum;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import ganymedes01.etfuturum.elytra.IElytraPlayer;
|
||||
|
||||
public final class EtFuturumCompat {
|
||||
|
||||
private EtFuturumCompat() {}
|
||||
|
||||
public static boolean isElytraFlying(EntityPlayer player) {
|
||||
return EnderIO.hasEtFuturum && player instanceof IElytraPlayer
|
||||
&& ((IElytraPlayer) player).etfu$isElytraFlying();
|
||||
}
|
||||
|
||||
public static void stopElytraFlying(EntityPlayer player) {
|
||||
if (EnderIO.hasEtFuturum && player instanceof IElytraPlayer) {
|
||||
((IElytraPlayer) player).etfu$setElytraFlying(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,8 +328,10 @@ public class KeyTracker {
|
||||
}
|
||||
|
||||
private void handleGlide() {
|
||||
if (glideKey.isPressed()
|
||||
&& DarkSteelController.instance.isGliderUpgradeEquipped(Minecraft.getMinecraft().thePlayer)) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (glideKey.isPressed() && DarkSteelController.instance.isGliderUpgradeEquipped(player)
|
||||
&& (DarkSteelController.instance.isGlideActive(player)
|
||||
|| DarkSteelController.instance.canActivateGlide(player))) {
|
||||
toggleDarkSteelController(Type.GLIDE, "darksteel.upgrade.glider");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.etfuturum.EtFuturumCompat;
|
||||
import crazypants.enderio.item.darksteel.PacketUpgradeState.Type;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.GliderUpgrade;
|
||||
@@ -146,6 +147,8 @@ public class DarkSteelController {
|
||||
}
|
||||
|
||||
public void setActive(EntityPlayer player, Type type, boolean isActive) {
|
||||
if (type == Type.GLIDE && isActive && !canActivateGlide(player)) return;
|
||||
|
||||
EnumSet<Type> set = getActiveSet(player);
|
||||
if (isActive) {
|
||||
set.add(type);
|
||||
@@ -158,6 +161,10 @@ public class DarkSteelController {
|
||||
return isActive(player, Type.GLIDE);
|
||||
}
|
||||
|
||||
public boolean canActivateGlide(EntityPlayer player) {
|
||||
return !EtFuturumCompat.isElytraFlying(player);
|
||||
}
|
||||
|
||||
public boolean isSpeedActive(EntityPlayer player) {
|
||||
return isActive(player, Type.SPEED);
|
||||
}
|
||||
@@ -246,8 +253,10 @@ public class DarkSteelController {
|
||||
}
|
||||
|
||||
private void updateGlide(EntityPlayer player) {
|
||||
if (!isGlideActive(player) || !isGliderUpgradeEquipped(player)) {
|
||||
return;
|
||||
if (!isGlideActive(player) || !isGliderUpgradeEquipped(player)) return;
|
||||
|
||||
if (EtFuturumCompat.isElytraFlying(player)) {
|
||||
EtFuturumCompat.stopElytraFlying(player);
|
||||
}
|
||||
|
||||
if (!player.onGround && player.motionY < 0 && !player.isSneaking() && !player.isInWater()) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -140,4 +141,25 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 0, 1, 2, 3, 4, 5, 8, 12, 20, 24, 32, 36, 48, 60, 64 are 0-15 respectively
|
||||
// the power values are all possible values of the second slot to make automation possible
|
||||
// (it has to be able to differentiate from them all)
|
||||
@Override
|
||||
public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) {
|
||||
if (worldIn.getTileEntity(x, y, z) instanceof IInventory inv) {
|
||||
ItemStack stuff = inv.getStackInSlot(1);
|
||||
int size;
|
||||
return stuff == null ? 0
|
||||
: (size = stuff.stackSize) < 6 ? size
|
||||
: size < 40 ? size / 4 + (size < 28 ? 4 : 3)
|
||||
: size < 48 ? 12 : size < 60 ? 13 : size < 64 ? 14 : 15;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,6 @@ public class ContainerEnchanter extends ContainerEnderTileEntity<TileEnchanter>
|
||||
|
||||
addSlotToContainer(new Slot(te, 0, 27, 35) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return te.isItemValidForSlot(0, itemStack);
|
||||
@@ -58,6 +53,11 @@ public class ContainerEnchanter extends ContainerEnderTileEntity<TileEnchanter>
|
||||
|
||||
addSlotToContainer(new Slot(te, 2, 134, 35) {
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int amt) {
|
||||
return te.decrStackSize(2, amt, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
@@ -81,18 +81,19 @@ public class ContainerEnchanter extends ContainerEnderTileEntity<TileEnchanter>
|
||||
|| enchData.enchantmentLevel >= curStack.stackSize) {
|
||||
te.setInventorySlotContents(1, (ItemStack) null);
|
||||
} else {
|
||||
|
||||
curStack = curStack.copy();
|
||||
curStack.stackSize -= recipe.getItemsPerLevel() * enchData.enchantmentLevel;
|
||||
if (curStack.stackSize > 0) {
|
||||
te.setInventorySlotContents(1, curStack);
|
||||
} else {
|
||||
if (curStack.stackSize <= 0) {
|
||||
te.setInventorySlotContents(1, null);
|
||||
}
|
||||
te.markDirty();
|
||||
}
|
||||
|
||||
te.setInventorySlotContents(0, (ItemStack) null);
|
||||
curStack = te.getStackInSlot(0);
|
||||
if (curStack == null || curStack.stackSize <= 1) te.setInventorySlotContents(0, null);
|
||||
else {
|
||||
curStack.stackSize -= 1;
|
||||
te.setInventorySlotContents(0, curStack);
|
||||
}
|
||||
if (!te.getWorldObj().isRemote) {
|
||||
te.getWorldObj().playAuxSFX(1021, te.xCoord, te.yCoord, te.zCoord, 0);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package crazypants.enderio.machine.enchanter;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasAutomagy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.enchantment.EnchantmentData;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -9,13 +13,20 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.geometry.CubeIterator;
|
||||
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.obelisk.xp.TileExperienceObelisk;
|
||||
import crazypants.enderio.xp.ExperienceContainer;
|
||||
import crazypants.enderio.xp.XpUtil;
|
||||
import tuhljin.automagy.tiles.TileEntityJarXP;
|
||||
|
||||
public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
private final ItemStack[] inv = new ItemStack[3];
|
||||
private byte[] stacksizes = new byte[2];
|
||||
|
||||
private short facing = (short) ForgeDirection.NORTH.ordinal();
|
||||
|
||||
@@ -27,6 +38,19 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
return facing;
|
||||
}
|
||||
|
||||
// The *ACTUAL* updateEntity and canUpdate are final in TileEntityEnder. Great.
|
||||
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
if (!shouldUpdate_()) return;
|
||||
if (inv[0].stackSize != stacksizes[0] || inv[1].stackSize != stacksizes[1]) updateOut();
|
||||
}
|
||||
|
||||
// @Override
|
||||
public boolean shouldUpdate_() {
|
||||
return inv[0] != null && inv[1] != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeCustomNBT(NBTTagCompound root) {
|
||||
NBTTagList itemList = new NBTTagList();
|
||||
@@ -39,6 +63,7 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
}
|
||||
}
|
||||
root.setTag("Items", itemList);
|
||||
root.setByteArray("SizeCache", stacksizes);
|
||||
root.setShort("facing", facing);
|
||||
}
|
||||
|
||||
@@ -54,6 +79,8 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
}
|
||||
}
|
||||
}
|
||||
stacksizes = root.getByteArray("SizeCache");
|
||||
if (stacksizes == null || stacksizes.length < 2) stacksizes = new byte[2];
|
||||
facing = root.getShort("facing");
|
||||
}
|
||||
|
||||
@@ -77,6 +104,10 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
return decrStackSize(slot, amount, true);
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize(int slot, int amount, boolean auto) {
|
||||
if (amount <= 0 || slot < 0 || slot >= inv.length || inv[slot] == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -84,8 +115,10 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
if (fromStack == null) {
|
||||
return null;
|
||||
}
|
||||
if (slot == 2 && auto && checkAndDrainXP(Math.min(amount, fromStack.stackSize))) return null;
|
||||
if (fromStack.stackSize <= amount) {
|
||||
inv[slot] = null;
|
||||
updateOut();
|
||||
return fromStack;
|
||||
}
|
||||
ItemStack result = new ItemStack(fromStack.getItem(), amount, fromStack.getItemDamage());
|
||||
@@ -93,9 +126,95 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
result.stackTagCompound = (NBTTagCompound) fromStack.stackTagCompound.copy();
|
||||
}
|
||||
fromStack.stackSize -= amount;
|
||||
updateOut();
|
||||
return result;
|
||||
}
|
||||
|
||||
// part of the next method
|
||||
public boolean absorbXP(int amt) {
|
||||
if (inv[2] == null || amt <= 0 || inv[2].stackSize < amt) return true;
|
||||
int LV = getCurrentEnchantmentCost();
|
||||
if (LV == 0) return false;
|
||||
int xpCost = XpUtil.getExperienceForLevel(LV * amt);
|
||||
int xp;
|
||||
absorb: {
|
||||
ArrayList<ExperienceContainer> obelisksToEmpty = new ArrayList<>();
|
||||
if (true) {
|
||||
CubeIterator iter = new CubeIterator(8);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
if (worldObj.getTileEntity(
|
||||
iter.n + xCoord,
|
||||
iter.l + yCoord,
|
||||
iter.m + zCoord) instanceof TileExperienceObelisk obelisk) {
|
||||
ExperienceContainer cont = obelisk.getContainer();
|
||||
xp = cont.getExperienceTotal();
|
||||
if (xp >= xpCost) {
|
||||
if (!worldObj.isRemote) {
|
||||
obelisksToEmpty.forEach(o -> o.drain(null, Integer.MAX_VALUE, true));
|
||||
cont.drain(null, Integer.MAX_VALUE, true);
|
||||
cont.addExperience(Math.max(0, xp - xpCost));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
xpCost -= xp;
|
||||
obelisksToEmpty.add(cont);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasAutomagy) {
|
||||
ArrayList<TileEntityJarXP> jarsToEmpty = new ArrayList<>();
|
||||
CubeIterator iter = new CubeIterator(8);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
if (worldObj.getTileEntity(
|
||||
iter.n + xCoord,
|
||||
iter.l + yCoord,
|
||||
iter.m + zCoord) instanceof TileEntityJarXP jar) {
|
||||
xp = jar.getXP();
|
||||
if (xp >= xpCost) {
|
||||
if (!worldObj.isRemote) {
|
||||
obelisksToEmpty.forEach(o -> o.drain(null, Integer.MAX_VALUE, true));
|
||||
jarsToEmpty.forEach(j -> j.setXP(0));
|
||||
jar.setXP(xp - xpCost);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
xpCost -= xp;
|
||||
jarsToEmpty.add(jar);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// checks AND drains XP; returns true if xp is NOT sufficient
|
||||
// also removes the items from the other two slots when automation does the recipe
|
||||
public boolean checkAndDrainXP(int amt) {
|
||||
if (absorbXP(amt)) return true;
|
||||
EnchantmentData enchData = getCurrentEnchantmentData();
|
||||
EnchanterRecipe recipe = getCurrentEnchantmentRecipe();
|
||||
ItemStack curStack = inv[1];
|
||||
if (recipe == null || enchData == null || curStack == null || enchData.enchantmentLevel >= curStack.stackSize) {
|
||||
inv[1] = null;
|
||||
} else {
|
||||
curStack = curStack.copy();
|
||||
curStack.stackSize -= recipe.getItemsPerLevel() * enchData.enchantmentLevel;
|
||||
inv[1] = curStack.stackSize > 0 ? curStack : null;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
curStack = inv[0];
|
||||
if (curStack == null || curStack.stackSize <= 1) inv[0] = null;
|
||||
else inv[0].stackSize -= 1;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
worldObj.playSoundEffect(xCoord + 0.5d, yCoord + 0.5d, zCoord + 0.5d, "random.anvil_land", 0.2f, 1.0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
@@ -111,6 +230,20 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
if (contents != null && contents.stackSize > getInventoryStackLimit()) {
|
||||
contents.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
updateOut();
|
||||
}
|
||||
|
||||
public void updateOut() {
|
||||
ItemStack output = null;
|
||||
EnchantmentData enchantment = getCurrentEnchantmentData();
|
||||
if (enchantment != null) {
|
||||
output = new ItemStack(Items.enchanted_book);
|
||||
Items.enchanted_book.addEnchantment(output, enchantment);
|
||||
}
|
||||
setOutput(output);
|
||||
|
||||
if (inv[0] != null) stacksizes[0] = (byte) inv[0].stackSize;
|
||||
if (inv[1] != null) stacksizes[1] = (byte) inv[1].stackSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -226,7 +359,7 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
return getEnchantmentCost(getCurrentEnchantmentRecipe());
|
||||
}
|
||||
|
||||
private int getEnchantmentCost(EnchanterRecipe currentEnchantment) {
|
||||
public int getEnchantmentCost(EnchanterRecipe currentEnchantment) {
|
||||
ItemStack item = inv[1];
|
||||
if (item == null) {
|
||||
return 0;
|
||||
@@ -256,17 +389,17 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return new int[0];
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? new int[] { 2 } : new int[] { 0, 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class GuiAttractor extends GuiPoweredMachineBase<TileAttractor> {
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
getGuiLeft() + sx / 2 + 9,
|
||||
getGuiLeft() + sx / 2 - 25,
|
||||
getGuiTop() + 68,
|
||||
ColorUtil.getRGB(Color.white));
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GuiAversionObelisk extends GuiPoweredMachineBase<TileAversionObelis
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
getGuiLeft() + sx / 2 + 9,
|
||||
getGuiLeft() + sx / 2 - 25,
|
||||
getGuiTop() + 68,
|
||||
ColorUtil.getRGB(Color.white));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class GuiInhibitorObelisk extends GuiPoweredMachineBase<TileInhibitorObel
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
|
||||
getGuiLeft() + sx / 2 + 9,
|
||||
getGuiLeft() + sx / 2 - 25,
|
||||
getGuiTop() + 68,
|
||||
ColorUtil.getRGB(Color.white));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.machine.vacuum;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,7 +15,6 @@ import com.enderio.core.client.gui.button.MultiIconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.ColorUtil;
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -27,6 +25,7 @@ import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
|
||||
@@ -215,7 +214,11 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
|
||||
IconEIO.map.render(EnderWidget.BUTTON_DOWN, sx + RANGE_LEFT, sy + RANGE_TOP, RANGE_WIDTH, 16, 0, true);
|
||||
String str = Integer.toString((int) te.getRange().x);
|
||||
int sw = fr.getStringWidth(str);
|
||||
fr.drawString(str, sx + RANGE_LEFT + RANGE_WIDTH - sw - 5, sy + RANGE_TOP + 5, ColorUtil.getRGB(Color.black));
|
||||
fr.drawString(
|
||||
str,
|
||||
sx + RANGE_LEFT + RANGE_WIDTH - sw - 5,
|
||||
sy + RANGE_TOP + 5,
|
||||
ColorUtils.suctionString.getColor());
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -114,7 +115,7 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
drawProgressBar(99, 31, 166, 0, 22, 13, 48, 3);
|
||||
AlloySmelterRecipe recipe = (AlloySmelterRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 52, 0x808080, false);
|
||||
GuiDraw.drawString(energyString, 100, 52, ColorUtils.neiEnergyString.getColor(), false);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import crazypants.enderio.machine.enchanter.EnchanterRecipeManager;
|
||||
import crazypants.enderio.machine.enchanter.GuiEnchanter;
|
||||
import crazypants.enderio.machine.enchanter.TileEnchanter;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -113,7 +114,7 @@ public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
public void drawExtras(int recipeIndex) {
|
||||
EnchanterRecipeNEI recipe = (EnchanterRecipeNEI) arecipes.get(recipeIndex);
|
||||
|
||||
GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, 0x808080, false);
|
||||
GuiDraw.drawStringC(recipe.getEnchantName(), 83, 10, ColorUtils.neiEnchantString.getColor(), false);
|
||||
|
||||
int level = 1;
|
||||
List<PositionedStack> ingredients = recipe.getIngredients();
|
||||
|
||||
@@ -25,6 +25,7 @@ import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -123,7 +124,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
MillRecipe recipe = (MillRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 96, 33, 0x808080, false);
|
||||
GuiDraw.drawString(energyString, 96, 33, ColorUtils.neiEnergyString.getColor(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@ import crazypants.enderio.machine.slicensplice.ContainerSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.GuiSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -109,7 +110,7 @@ public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
SliceAndSpliceRecipe recipe = (SliceAndSpliceRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 57, 0x808080, false);
|
||||
GuiDraw.drawString(energyString, 100, 57, ColorUtils.neiEnergyString.getColor(), false);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
import crazypants.enderio.machine.soul.ISoulBinderRecipe;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -132,7 +133,7 @@ public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
SoulBinderRecipeNEI recipe = (SoulBinderRecipeNEI) arecipes.get(recipeIndex);
|
||||
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawStringC(energyString, 83, 45, 0x808080, false);
|
||||
GuiDraw.drawStringC(energyString, 83, 45, ColorUtils.neiEnergyString.getColor(), false);
|
||||
|
||||
int cost = recipe.getExperience();
|
||||
if (cost > 0) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.vat.GuiVat;
|
||||
import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.ColorUtils;
|
||||
|
||||
public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -183,7 +184,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
String energyString = PowerDisplayUtil.formatPower(rec.energy) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawStringC(energyString, 86, 54, 0x808080, false);
|
||||
GuiDraw.drawStringC(energyString, 86, 54, ColorUtils.neiEnergyString.getColor(), false);
|
||||
|
||||
Fluid outputFluid = rec.result.getFluid();
|
||||
List<PositionedStack> stacks = rec.getIngredients();
|
||||
@@ -191,7 +192,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
float mult = VatRecipeManager.getInstance()
|
||||
.getMultiplierForInput(rec.inFluid.getFluid(), ps.item, outputFluid);
|
||||
String str = "x" + mult;
|
||||
GuiDraw.drawStringC(str, ps.relx + 8, ps.rely + 19, 0x808080, false);
|
||||
GuiDraw.drawStringC(str, ps.relx + 8, ps.rely + 19, ColorUtils.neiMultiplierString.getColor(), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package crazypants.util;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.color.ColorResource;
|
||||
|
||||
public class ColorUtils {
|
||||
|
||||
private static final ColorResource.Factory color = new ColorResource.Factory("enderio");
|
||||
|
||||
public static final ColorResource
|
||||
// spotless:off
|
||||
priorityString = color.rgb("priorityString", "0x000000"),
|
||||
suctionString = color.rgb("suctionString", "0x000000"),
|
||||
neiMultiplierString = color.rgb("neiMultiplierString", "0x808080"),
|
||||
neiEnchantString = color.rgb("neiEnchantString", "0x808080"),
|
||||
neiEnergyString = color.rgb("neiEnergyString", "0x808080");
|
||||
// spotless:on
|
||||
}
|
||||
@@ -523,6 +523,9 @@ tile.blockEnchanter.name=Enchanter
|
||||
tile.blockEnchanter.tooltip.detailed.line1=Uses XP to combine items
|
||||
tile.blockEnchanter.tooltip.detailed.line2=and a book and quill to
|
||||
tile.blockEnchanter.tooltip.detailed.line3=created enchanted books
|
||||
tile.blockEnchanter.tooltip.detailed.line4=Outputs a comparator signal
|
||||
tile.blockEnchanter.tooltip.detailed.line5=based on the second slot's
|
||||
tile.blockEnchanter.tooltip.detailed.line6=count, and works with hoppers
|
||||
|
||||
tile.blockCombustionGenerator.name=Combustion Generator
|
||||
tile.blockCombustionGenerator.tooltip.detailed.line1=Burns liquid fuel to generate power
|
||||
|
||||
Reference in new issue
Block a user