Compare commits

...
6 Commits
19 changed files with 138 additions and 71 deletions

No files matched your search

+15 -14
View File
@@ -2,25 +2,26 @@
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.5.14:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.26:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.102-GTNH:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.14:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.60:dev')
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.91-GTNH:dev")
api("com.github.GTNewHorizons:TinkersConstruct:1.14.93-GTNH:dev")
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.10:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-981-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.52.600:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.74-1.7.10:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.26:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.25-GTNH:api') {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.44-GTNH:api') {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,7 +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:2.1.36:api') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.161: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')
}
@@ -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,6 +214,7 @@ 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");
@@ -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);
@@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -425,7 +427,7 @@ public class NetworkedInventory {
return inv;
}
public ISidedInventory getInventoryRecheck() {
public @Nullable ISidedInventory getInventoryRecheck() {
if (isInvalid()) {
updateInventory();
}
@@ -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()) {
@@ -16,50 +16,53 @@ class NormalInventory extends AbstractInventory {
@Override
int scanInventory(InventoryDatabaseServer db) {
ISidedInventory inv = ni.getInventoryRecheck();
int side = ni.getInventorySide();
int[] slotIndices = inv.getAccessibleSlotsFromSide(side);
if (slotIndices == null || slotIndices.length == 0) {
setEmpty(db);
return 0;
}
int count = slotIndices.length;
if (count != slotKeys.length) {
reset(db, count);
}
for (int slot = 0; slot < count; slot++) {
int invSlot = slotIndices[slot];
ItemStack stack = inv.getStackInSlot(invSlot);
if (stack != null && !inv.canExtractItem(invSlot, stack, side)) {
stack = null;
if (inv != null) {
int side = ni.getInventorySide();
int[] slotIndices = inv.getAccessibleSlotsFromSide(side);
if (slotIndices != null && slotIndices.length > 0) {
int count = slotIndices.length;
if (count != slotKeys.length) {
reset(db, count);
}
for (int slot = 0; slot < count; slot++) {
int invSlot = slotIndices[slot];
ItemStack stack = inv.getStackInSlot(invSlot);
if (stack != null && !inv.canExtractItem(invSlot, stack, side)) {
stack = null;
}
updateSlot(db, slot, stack);
}
return count;
}
updateSlot(db, slot, stack);
}
return count;
setEmpty(db);
return 0;
}
@Override
public int extractItem(InventoryDatabaseServer db, ItemEntry entry, int slot, int count) {
ISidedInventory inv = ni.getInventoryRecheck();
int side = ni.getInventorySide();
int[] slotIndices = inv.getAccessibleSlotsFromSide(side);
if (slotIndices == null || slot >= slotIndices.length) {
return 0;
if (inv != null) {
int side = ni.getInventorySide();
int[] slotIndices = inv.getAccessibleSlotsFromSide(side);
if (slotIndices != null && slot < slotIndices.length) {
int invSlot = slotIndices[slot];
ItemStack stack = inv.getStackInSlot(invSlot);
if (stack != null && inv.canExtractItem(invSlot, stack, side)
&& db.lookupItem(stack, entry, false) == entry) {
int remaining = stack.stackSize;
if (count > remaining) {
count = remaining;
}
ni.itemExtracted(invSlot, count);
remaining -= count;
updateCount(db, slot, entry, remaining);
return count;
}
}
}
int invSlot = slotIndices[slot];
ItemStack stack = inv.getStackInSlot(invSlot);
if (stack == null || !inv.canExtractItem(invSlot, stack, side)) {
return 0;
}
if (db.lookupItem(stack, entry, false) != entry) {
return 0;
}
int remaining = stack.stackSize;
if (count > remaining) {
count = remaining;
}
ni.itemExtracted(invSlot, count);
remaining -= count;
updateCount(db, slot, entry, remaining);
return count;
return 0;
}
}
@@ -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
}