mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
673f832c2d | ||
|
|
ce11a2dcf2 | ||
|
|
68e209203c | ||
|
|
0715f8b536 | ||
|
|
d356dddedb | ||
|
|
604b47a394 | ||
|
|
42dc1f43aa | ||
|
|
cbeec42e47 | ||
|
|
046ad7441d | ||
|
|
8750005be5 | ||
|
|
b46cfbb351 | ||
|
|
070ef99694 | ||
|
|
fec675ef48 | ||
|
|
503b90a5d0 | ||
|
|
84052a1c42 | ||
|
|
554a08a515 | ||
|
|
55928c5234 | ||
|
|
65c5d3aec5 | ||
|
|
7737598e4f |
No files matched your search
+18
-17
@@ -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.37:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.129-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.44:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63: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.106-GTNH:dev")
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.30:dev') {transitive = false}
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.34: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: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:Chisel:2.17.26-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.44-GTNH:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.14:dev") { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-999-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.122:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.88-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.31:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.29-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.32-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.59-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.2.8:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.194: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/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
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.26'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
|
||||
}
|
||||
|
||||
|
||||
@@ -238,6 +238,8 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockPainter), machRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockCrafter), machRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockBuffer), machRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockPoweredSpawner), machRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockSliceAndSplice), machRen);
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemBrokenSpawner, new BrokenSpawnerRenderer());
|
||||
|
||||
@@ -256,7 +258,9 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileFarmStation.class, new FarmingStationSpecialRenderer());
|
||||
|
||||
BlockSoulBinder.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new SoulBinderRenderer());
|
||||
SoulBinderRenderer soulBinderRenderer = new SoulBinderRenderer();
|
||||
RenderingRegistry.registerBlockHandler(soulBinderRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockSoulFuser), soulBinderRenderer);
|
||||
|
||||
ObeliskRenderer defaultObeliskRenderer = new ObeliskRenderer();
|
||||
BlockObeliskAbstract.defaultObeliskRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
@@ -360,6 +364,7 @@ public class ClientProxy extends CommonProxy {
|
||||
TelePadRenderer telePadRenderer = new TelePadRenderer();
|
||||
RenderingRegistry.registerBlockHandler(telePadRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTelePad.class, new TelePadSpecialRenderer(telePadRenderer));
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockTelePad), telePadRenderer);
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemMachinePart, new MachinePartRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemConduitFacade, new FacadeRenderer());
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -771,7 +771,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
bundle.setFacadeId(facadeID);
|
||||
bundle.setFacadeMetadata(facadeMeta);
|
||||
bundle.setFacadeType(FacadeType.values()[facadeType]);
|
||||
bundle.setFacadeType(FacadeType.VALUES[facadeType]);
|
||||
if (!world.isRemote) {
|
||||
ConduitUtil.playPlaceSound(facadeID.stepSound, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
BASIC,
|
||||
HARDENED;
|
||||
|
||||
public static final FacadeType[] VALUES = values();
|
||||
|
||||
public String getUnlocName(Item me) {
|
||||
return this == BASIC ? me.getUnlocalizedName() : me.getUnlocalizedName() + ".hardened";
|
||||
}
|
||||
@@ -69,14 +71,14 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List<ItemStack> list) {
|
||||
for (FacadeType t : FacadeType.values()) {
|
||||
for (FacadeType t : FacadeType.VALUES) {
|
||||
list.add(new ItemStack(item, 1, t.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return FacadeType.values()[stack.getItemDamage()].getUnlocName(this);
|
||||
return FacadeType.VALUES[stack.getItemDamage()].getUnlocName(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,7 +89,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
icons = new IIcon[FacadeType.values().length];
|
||||
icons = new IIcon[FacadeType.VALUES.length];
|
||||
icons[0] = itemIcon = IIconRegister.registerIcon("enderio:conduitFacade");
|
||||
icons[1] = IIconRegister.registerIcon("enderio:conduitFacadeHardened");
|
||||
overlayIcon = IIconRegister.registerIcon("enderio:conduitFacadeOverlay");
|
||||
@@ -131,7 +133,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider,
|
||||
facadeMeta = PainterUtil.adjustFacadeMetadata(facadeID, facadeMeta, side);
|
||||
bundle.setFacadeId(facadeID);
|
||||
bundle.setFacadeMetadata(facadeMeta);
|
||||
bundle.setFacadeType(FacadeType.values()[itemStack.getItemDamage()]);
|
||||
bundle.setFacadeType(FacadeType.VALUES[itemStack.getItemDamage()]);
|
||||
ConduitUtil.playPlaceSound(facadeID.stepSound, world, x, y, z);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
itemStack.stackSize--;
|
||||
|
||||
@@ -184,8 +184,8 @@ public abstract class AbstractGasConduit extends AbstractConduit implements IGas
|
||||
String key = "extRM." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.VALUES.length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
key = "extSC." + dir.name();
|
||||
|
||||
@@ -284,6 +284,8 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
rsB.onGuiInit();
|
||||
colorB.onGuiInit();
|
||||
|
||||
gui.getContainer().setInventorySlotsVisible(true);
|
||||
|
||||
if (!isEnder) {
|
||||
return;
|
||||
}
|
||||
@@ -295,7 +297,6 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
roundRobinB.onGuiInit();
|
||||
roundRobinB.setSelected(eConduit.isRoundRobin(gui.getDir()));
|
||||
|
||||
gui.getContainer().setInventorySlotsVisible(true);
|
||||
if (isFilterVisible()) {
|
||||
addFilterTooltips();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -152,7 +152,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.VALUES[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
setInputColor(dir, DyeColor.VALUES[dataRoot.getShort("inputColor")]);
|
||||
setOutputColor(dir, DyeColor.VALUES[dataRoot.getShort("outputColor")]);
|
||||
setSelfFeedEnabled(dir, dataRoot.getBoolean("selfFeed"));
|
||||
@@ -837,8 +837,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
key = "extRM." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.VALUES.length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
key = "extSC." + dir.name();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.VALUES[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,8 +239,8 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
String key = "extRM." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.VALUES.length) {
|
||||
extractionModes.put(dir, RedstoneControlMode.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
key = "extSC." + dir.name();
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PacketExtractMode extends AbstractConduitPacket<IExtractor>
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirections.DIRECTIONS[buf.readShort()];
|
||||
mode = RedstoneControlMode.values()[buf.readShort()];
|
||||
mode = RedstoneControlMode.VALUES[buf.readShort()];
|
||||
color = DyeColor.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.VALUES[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.VALUES[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -253,8 +253,8 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
String key = "pRsMode." + dir.name();
|
||||
if (nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
rsModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
if (ord >= 0 && ord < RedstoneControlMode.VALUES.length) {
|
||||
rsModes.put(dir, RedstoneControlMode.VALUES[ord]);
|
||||
}
|
||||
}
|
||||
key = "pRsCol." + dir.name();
|
||||
|
||||
@@ -597,6 +597,11 @@ public final class Config {
|
||||
|
||||
public static float fusedQuartzExplosionResistance = 2000.0f;
|
||||
|
||||
public static boolean enchanterOutputEnableBlockRestriction = false;
|
||||
public static boolean enchanterOutputAllowlistAsDenylist = false;
|
||||
public static String[] enchanterOutputFilterlist = new String[] { "minecraft:hopper",
|
||||
"EnderIO:blockConduitBundle" };
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -2978,6 +2983,22 @@ public final class Config {
|
||||
0.0f,
|
||||
Float.MAX_VALUE,
|
||||
"How blast resistant the three Fused Quartz blocks should be.");
|
||||
|
||||
enchanterOutputEnableBlockRestriction = config.getBoolean(
|
||||
"enchanterOutputEnableBlockRestriction",
|
||||
sectionMisc.name,
|
||||
enchanterOutputEnableBlockRestriction,
|
||||
"Enable restricting the valid blocks that are allowed to pull from the output slot of an Enchanter, to prevent dupes");
|
||||
enchanterOutputAllowlistAsDenylist = config.getBoolean(
|
||||
"enchanterOutputAllowlistAsDenylist",
|
||||
sectionMisc.name,
|
||||
enchanterOutputAllowlistAsDenylist,
|
||||
"Treat the list of blocks allowed to pull from an Enchanter's output slot as a denylist instead (if you know only some specific blocks bypass inventory APIs)");
|
||||
enchanterOutputFilterlist = config.getStringList(
|
||||
"enchanterOutputFilterlist",
|
||||
sectionMisc.name,
|
||||
enchanterOutputFilterlist,
|
||||
"These blocks are allowed/denied from pulling from the output slot of an Enchanter (default is allowlist)");
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -46,7 +46,10 @@ public class EnderIoRenderer extends TileEntitySpecialRenderer implements IItemR
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
|
||||
EntityLivingBase entityPlayer = Minecraft.getMinecraft().thePlayer;
|
||||
Matrix4d lookMat = RenderUtil.createBillboardMatrix(te, entityPlayer);
|
||||
EntityLivingBase viewEntity = Minecraft.getMinecraft().renderViewEntity != null
|
||||
? Minecraft.getMinecraft().renderViewEntity
|
||||
: entityPlayer;
|
||||
Matrix4d lookMat = RenderUtil.createBillboardMatrix(te, viewEntity);
|
||||
|
||||
int brightness = RenderUtil.setTesselatorBrightness(entityPlayer.worldObj, te.xCoord, te.yCoord, te.zCoord);
|
||||
render(x, y, z, lookMat, brightness);
|
||||
|
||||
@@ -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()) {
|
||||
@@ -562,11 +571,13 @@ public class DarkSteelController {
|
||||
private void updateNightvision(EntityPlayer player) {
|
||||
if (isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 210, 0, true));
|
||||
}
|
||||
if (!isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
|
||||
nightVisionActive = false;
|
||||
removeNightvision = true;
|
||||
}
|
||||
} else if (!isNightVisionUpgradeOrEnchEquipped(player)
|
||||
&& player.getActivePotionEffect(Potion.nightVision) != null) {
|
||||
// Remove the effect when upgrade is not equipped (e.g. helmet removed), but do NOT
|
||||
// reset nightVisionActive — during dimension transitions the inventory is temporarily
|
||||
// empty, and resetting the flag would permanently disable night vision after portals.
|
||||
player.removePotionEffect(Potion.nightVision.getId());
|
||||
}
|
||||
if (removeNightvision) {
|
||||
player.removePotionEffect(Potion.nightVision.getId());
|
||||
removeNightvision = false;
|
||||
|
||||
@@ -29,6 +29,7 @@ public class BlockEndermanSkull extends BlockEio implements IInfusionStabiliser
|
||||
TORMENTED("tormented", false),
|
||||
REANIMATED_TORMENTED("reanimatedTormented", true);
|
||||
|
||||
public static final SkullType[] VALUES = values();
|
||||
final String name;
|
||||
final boolean showEyes;
|
||||
|
||||
@@ -74,8 +75,8 @@ public class BlockEndermanSkull extends BlockEio implements IInfusionStabiliser
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
ForgeDirection orint = ForgeDirection.getOrientation(side);
|
||||
if (orint == ForgeDirection.NORTH) {
|
||||
meta = MathHelper.clamp_int(meta, 0, SkullType.values().length - 1);
|
||||
return SkullType.values()[meta].showEyes ? frontIconEyes : frontIcon;
|
||||
meta = MathHelper.clamp_int(meta, 0, SkullType.VALUES.length - 1);
|
||||
return SkullType.VALUES[meta].showEyes ? frontIconEyes : frontIcon;
|
||||
}
|
||||
if (orint == ForgeDirection.UP || orint == ForgeDirection.DOWN || orint == ForgeDirection.SOUTH) {
|
||||
return topIcon;
|
||||
|
||||
@@ -472,10 +472,10 @@ public abstract class AbstractMachineEntity extends TileEntityEio
|
||||
}
|
||||
|
||||
int rsContr = nbtRoot.getInteger("redstoneControlMode");
|
||||
if (rsContr < 0 || rsContr >= RedstoneControlMode.values().length) {
|
||||
if (rsContr < 0 || rsContr >= RedstoneControlMode.VALUES.length) {
|
||||
rsContr = 0;
|
||||
}
|
||||
redstoneControlMode = RedstoneControlMode.values()[rsContr];
|
||||
redstoneControlMode = RedstoneControlMode.VALUES[rsContr];
|
||||
|
||||
if (nbtRoot.hasKey("hasFaces")) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PacketRedstoneMode implements IMessage, IMessageHandler<PacketRedst
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
short ordinal = buf.readShort();
|
||||
mode = RedstoneControlMode.values()[ordinal];
|
||||
mode = RedstoneControlMode.VALUES[ordinal];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,8 @@ public enum RedstoneControlMode implements ICycleEnum {
|
||||
OFF(IconEIO.REDSTONE_MODE_WITHOUT_SIGNAL),
|
||||
NEVER(IconEIO.REDSTONE_MODE_NEVER);
|
||||
|
||||
public static final RedstoneControlMode[] VALUES = values();
|
||||
|
||||
private final IWidgetIcon icon;
|
||||
|
||||
RedstoneControlMode(IWidgetIcon icon) {
|
||||
@@ -63,20 +65,20 @@ public enum RedstoneControlMode implements ICycleEnum {
|
||||
|
||||
public RedstoneControlMode next() {
|
||||
int ord = ordinal();
|
||||
if (ord == values().length - 1) {
|
||||
if (ord == VALUES.length - 1) {
|
||||
ord = 0;
|
||||
} else {
|
||||
ord++;
|
||||
}
|
||||
return values()[ord];
|
||||
return VALUES[ord];
|
||||
}
|
||||
|
||||
public RedstoneControlMode previous() {
|
||||
int ord = ordinal();
|
||||
ord--;
|
||||
if (ord < 0) {
|
||||
ord = values().length - 1;
|
||||
ord = VALUES.length - 1;
|
||||
}
|
||||
return values()[ord];
|
||||
return VALUES[ord];
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ public class BlockItemBuffer extends ItemBlockWithMetadata {
|
||||
OMNI(true, true, false),
|
||||
CREATIVE(true, true, true);
|
||||
|
||||
public static final Type[] VALUES = values();
|
||||
final boolean hasInventory;
|
||||
final boolean hasPower;
|
||||
final boolean isCreative;
|
||||
@@ -60,14 +61,14 @@ public class BlockItemBuffer extends ItemBlockWithMetadata {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (Type type : Type.values()) {
|
||||
for (Type type : Type.VALUES) {
|
||||
list.add(new ItemStack(item, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return Type.values()[stack.getItemDamage()].getUnlocalizedName();
|
||||
return Type.VALUES[stack.getItemDamage()].getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,7 +79,7 @@ public class BlockItemBuffer extends ItemBlockWithMetadata {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileBuffer) {
|
||||
TileBuffer buffer = ((TileBuffer) te);
|
||||
Type t = Type.values()[metadata];
|
||||
Type t = Type.VALUES[metadata];
|
||||
buffer.setHasInventory(t.hasInventory);
|
||||
buffer.setHasPower(t.hasPower);
|
||||
buffer.setCreative(t.isCreative);
|
||||
|
||||
@@ -882,12 +882,12 @@ public class TileCapBank extends TileEntityEio
|
||||
}
|
||||
|
||||
if (nbtRoot.hasKey("inputControlMode")) {
|
||||
inputControlMode = RedstoneControlMode.values()[nbtRoot.getShort("inputControlMode")];
|
||||
inputControlMode = RedstoneControlMode.VALUES[nbtRoot.getShort("inputControlMode")];
|
||||
} else {
|
||||
inputControlMode = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
if (nbtRoot.hasKey("outputControlMode")) {
|
||||
outputControlMode = RedstoneControlMode.values()[nbtRoot.getShort("outputControlMode")];
|
||||
outputControlMode = RedstoneControlMode.VALUES[nbtRoot.getShort("outputControlMode")];
|
||||
} else {
|
||||
outputControlMode = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ public class NetworkState {
|
||||
buf.readInt(),
|
||||
buf.readInt(),
|
||||
buf.readInt(),
|
||||
RedstoneControlMode.values()[buf.readShort()],
|
||||
RedstoneControlMode.values()[buf.readShort()],
|
||||
RedstoneControlMode.VALUES[buf.readShort()],
|
||||
RedstoneControlMode.VALUES[buf.readShort()],
|
||||
buf.readBoolean() ? BlockCoord.readFromBuf(buf) : null,
|
||||
buf.readFloat(),
|
||||
buf.readFloat());
|
||||
|
||||
@@ -39,8 +39,8 @@ public class PacketGuiChange extends PacketCapBank<PacketGuiChange, IMessage> {
|
||||
super.fromBytes(buf);
|
||||
maxSend = buf.readInt();
|
||||
maxRec = buf.readInt();
|
||||
inputMode = RedstoneControlMode.values()[buf.readShort()];
|
||||
outputMode = RedstoneControlMode.values()[buf.readShort()];
|
||||
inputMode = RedstoneControlMode.VALUES[buf.readShort()];
|
||||
outputMode = RedstoneControlMode.VALUES[buf.readShort()];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,6 +68,11 @@ public class ContainerEnchanter extends ContainerEnderTileEntity<TileEnchanter>
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return te.getOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
|
||||
@@ -2,8 +2,6 @@ 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;
|
||||
@@ -11,16 +9,21 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.geometry.CubeIterator;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.Log;
|
||||
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 it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import tuhljin.automagy.tiles.TileEntityJarXP;
|
||||
|
||||
public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
@@ -28,6 +31,8 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
private final ItemStack[] inv = new ItemStack[3];
|
||||
private byte[] stacksizes = new byte[2];
|
||||
|
||||
private IntList cachedXPsources = new IntArrayList();
|
||||
|
||||
private short facing = (short) ForgeDirection.NORTH.ordinal();
|
||||
|
||||
public void setFacing(short s) {
|
||||
@@ -65,6 +70,9 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
root.setTag("Items", itemList);
|
||||
root.setByteArray("SizeCache", stacksizes);
|
||||
root.setShort("facing", facing);
|
||||
root.setIntArray(
|
||||
"XpCache",
|
||||
(cachedXPsources.size() <= 200 ? cachedXPsources : cachedXPsources.subList(0, 200)).toIntArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,6 +90,11 @@ 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");
|
||||
cachedXPsources.clear();
|
||||
int[] xpcache = root.getIntArray("XpCache");
|
||||
if (xpcache != null) {
|
||||
cachedXPsources.addAll(IntList.of(xpcache));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,9 +109,10 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
if (slot < 0 || slot >= inv.length) {
|
||||
if (slot < 0 || slot > inv.length - 1) {
|
||||
return null;
|
||||
}
|
||||
if (slot == 2 && !doesCraftHaveXP()) return null;
|
||||
return inv[slot];
|
||||
}
|
||||
|
||||
@@ -130,69 +144,97 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
return result;
|
||||
}
|
||||
|
||||
// part of the next method
|
||||
public boolean absorbXP(int amt) {
|
||||
if (inv[2] == null || amt <= 0 || inv[2].stackSize < amt) return true;
|
||||
public boolean doesCraftHaveXP() {
|
||||
if (inv[2] == null) return false;
|
||||
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;
|
||||
}
|
||||
if (LV == 0) return true;
|
||||
return checkAndCacheXPSources(XpUtil.getExperienceForLevel(LV));
|
||||
}
|
||||
|
||||
// checks AND drains XP; returns true if xp is NOT sufficient
|
||||
private boolean checkAndCacheXPSources(int xpCost) {
|
||||
if (drainFromCache(xpCost, false)) return true;
|
||||
cachedXPsources.clear();
|
||||
int xp;
|
||||
CubeIterator iter;
|
||||
iter = new CubeIterator(8);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
int x = iter.n + xCoord;
|
||||
int y = iter.l + yCoord;
|
||||
int z = iter.m + zCoord;
|
||||
if (!worldObj.blockExists(x, y, z)) continue;
|
||||
final TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
if (te instanceof TileExperienceObelisk obelisk) {
|
||||
ExperienceContainer cont = obelisk.getContainer();
|
||||
xp = cont.getExperienceTotal();
|
||||
if (xp != 0) cachedXPsources.add(((iter.n & 0xff) << 16) + ((iter.l & 0xff) << 8) + (iter.m & 0xff));
|
||||
if (xp >= xpCost) return true;
|
||||
xpCost -= xp;
|
||||
} else if (hasAutomagy && te instanceof TileEntityJarXP jar) {
|
||||
xp = jar.getXP();
|
||||
if (xp != 0) cachedXPsources.add(((iter.n & 0xff) << 16) + ((iter.l & 0xff) << 8) + (iter.m & 0xff));
|
||||
if (xp >= xpCost) return true;
|
||||
xpCost -= xp;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean drainFromCache(int xpCost, boolean actual) {
|
||||
ExperienceContainer cont;
|
||||
int len = cachedXPsources.size();
|
||||
if (len == 0) return false;
|
||||
for (int ind = 0; ind < len; ind++) {
|
||||
int nlm = cachedXPsources.getInt(ind);
|
||||
int z = (byte) nlm + zCoord;
|
||||
int y = (byte) (nlm >>= 8) + yCoord;
|
||||
int x = (byte) (nlm >>= 8) + xCoord;
|
||||
if (!worldObj.blockExists(x, y, z)) continue;
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
if (te instanceof TileExperienceObelisk obelisk) {
|
||||
cont = obelisk.getContainer();
|
||||
int xp = cont.getExperienceTotal();
|
||||
if (xp == 0) continue;
|
||||
if (actual) cont.drain(null, Integer.MAX_VALUE, true);
|
||||
int ebx = xp - xpCost;
|
||||
if (ebx < 0) {
|
||||
xpCost = -ebx;
|
||||
continue;
|
||||
}
|
||||
if (actual) cont.addExperience(ebx);
|
||||
return true;
|
||||
}
|
||||
if (hasAutomagy && te instanceof TileEntityJarXP jar) {
|
||||
int xp = jar.getXP();
|
||||
if (xp == 0) continue;
|
||||
int ebx = xp - xpCost; // 5head JIT optimization
|
||||
if (ebx < 0) {
|
||||
xpCost = -ebx;
|
||||
if (actual) jar.setXP(0);
|
||||
continue;
|
||||
}
|
||||
if (actual) jar.setXP(ebx);
|
||||
return true;
|
||||
}
|
||||
cachedXPsources.removeInt(ind);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// part of the next method
|
||||
private boolean absorbXP(int amt) {
|
||||
if (inv[2] == null) return false;
|
||||
int LV = getCurrentEnchantmentCost();
|
||||
if (LV == 0) return true;
|
||||
int xpCost = XpUtil.getExperienceForLevel(LV * amt);
|
||||
if (!checkAndCacheXPSources(xpCost)) return false;
|
||||
return drainFromCache(xpCost, !worldObj.isRemote);
|
||||
}
|
||||
|
||||
// checks AND drains XP; returns false 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;
|
||||
private boolean checkAndDrainXP(int amt) {
|
||||
if (!absorbXP(amt)) return false;
|
||||
EnchantmentData enchData = getCurrentEnchantmentData();
|
||||
EnchanterRecipe recipe = getCurrentEnchantmentRecipe();
|
||||
ItemStack curStack = inv[1];
|
||||
@@ -212,7 +254,7 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
if (!worldObj.isRemote) {
|
||||
worldObj.playSoundEffect(xCoord + 0.5d, yCoord + 0.5d, zCoord + 0.5d, "random.anvil_land", 0.2f, 1.0f);
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -222,6 +264,15 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack contents) {
|
||||
if (slot == 2) {
|
||||
if (inv[2] == null || inv[2].stackSize <= 0
|
||||
|| contents != null && contents.stackSize > 0
|
||||
&& contents.getItem() == Items.enchanted_book
|
||||
&& contents.stackSize == inv[2].stackSize)
|
||||
return;
|
||||
if (checkAndDrainXP(1)) Log.warn("Potentially duped books at: " + xCoord + " " + yCoord + " " + zCoord);
|
||||
// return;
|
||||
} ;
|
||||
if (contents == null) {
|
||||
inv[slot] = contents;
|
||||
} else {
|
||||
@@ -240,10 +291,11 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
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;
|
||||
|
||||
setOutput(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -388,18 +440,34 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
|
||||
markDirty();
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
return inv[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
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 true;
|
||||
public boolean canInsertItem(int slot, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return slot == 0 || slot == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return true;
|
||||
public boolean canExtractItem(int slot, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return slot == 2 ? isAllowedBlockBeneath() : true;
|
||||
}
|
||||
|
||||
public boolean isAllowedBlockBeneath() {
|
||||
if (!Config.enchanterOutputEnableBlockRestriction) return true;
|
||||
var blockBeneath = worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
for (String blocknam : Config.enchanterOutputFilterlist) {
|
||||
String[] splitname = blocknam.split(":", 1);
|
||||
if (GameRegistry.findBlock(splitname[0], splitname[1]) != blockBeneath) continue;
|
||||
return !Config.enchanterOutputAllowlistAsDenylist;
|
||||
}
|
||||
return Config.enchanterOutputAllowlistAsDenylist;
|
||||
}
|
||||
|
||||
}
|
||||
+7
-9
@@ -4,7 +4,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -33,7 +32,6 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {
|
||||
|
||||
World world = te.getWorldObj();
|
||||
TileZombieGenerator gen = (TileZombieGenerator) te;
|
||||
|
||||
@@ -104,26 +102,26 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
}
|
||||
|
||||
private void renderModel(GeneratorType gen, int facing) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef(0.5F, 0, 0.5F);
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
GL11.glTranslatef(0.5f, 0, 0.5f);
|
||||
GL11.glRotatef(180f, 1f, 0f, 0f);
|
||||
GL11.glScalef(1.2f, 0.9f, 1.2f);
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(facing);
|
||||
if (dir == ForgeDirection.SOUTH) {
|
||||
facing = 0;
|
||||
|
||||
} else if (dir == ForgeDirection.WEST) {
|
||||
facing = -1;
|
||||
}
|
||||
GL11.glRotatef(facing * -90F, 0F, 1F, 0F);
|
||||
GL11.glRotatef(facing * -90f, 0f, 1f, 0f);
|
||||
|
||||
// Move the model in center of block
|
||||
GL11.glTranslatef(0.0f, 0.0f, -0.0625f);
|
||||
|
||||
RenderUtil.bindTexture(gen.getTexture());
|
||||
model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
model.render(null, 0.0f, 0.0f, -0.1f, 0.0f, 0.0f, 0.0625f);
|
||||
|
||||
GL11.glTranslatef(-0.5F, 0, -0.5F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@@ -826,7 +826,7 @@ public class TileHyperCube extends TileEntityEio
|
||||
recieveBuffer.readFromNBT(nbtRoot);
|
||||
|
||||
if (nbtRoot.hasKey("rsMode")) {
|
||||
redstoneControlMode = RedstoneControlMode.values()[nbtRoot.getShort("rsMode")];
|
||||
redstoneControlMode = RedstoneControlMode.VALUES[nbtRoot.getShort("rsMode")];
|
||||
} else {
|
||||
redstoneControlMode = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ public class BlockItemElectricLight extends ItemBlockWithMetadata implements IRe
|
||||
WIRELESS("item.itemWirelessLight", false, true, true),
|
||||
WIRELESS_INV("item.itemWirelessLightInverted", true, true, true);
|
||||
|
||||
public static final Type[] VALUES = values();
|
||||
final String unlocName;
|
||||
final boolean isInverted;
|
||||
final boolean isPowered;
|
||||
@@ -52,14 +53,14 @@ public class BlockItemElectricLight extends ItemBlockWithMetadata implements IRe
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
meta = MathHelper.clamp_int(meta, 0, Type.values().length - 1);
|
||||
return Type.values()[meta].unlocName;
|
||||
meta = MathHelper.clamp_int(meta, 0, Type.VALUES.length - 1);
|
||||
return Type.VALUES[meta].unlocName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (Type type : Type.values()) {
|
||||
for (Type type : Type.VALUES) {
|
||||
par3List.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
@@ -76,7 +77,7 @@ public class BlockItemElectricLight extends ItemBlockWithMetadata implements IRe
|
||||
if (te instanceof TileElectricLight) {
|
||||
TileElectricLight el = ((TileElectricLight) te);
|
||||
el.setFace(onFace);
|
||||
Type t = Type.values()[metadata];
|
||||
Type t = Type.VALUES[metadata];
|
||||
el.setInverted(t.isInverted);
|
||||
el.setRequiresPower(t.isPowered);
|
||||
el.setWireless(t.isWireless);
|
||||
|
||||
@@ -42,13 +42,21 @@ public class ObeliskRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
tessellator.startDrawingQuads();
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tessellator.draw();
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
// Preserve GL state so this custom item renderer does not leak alpha/blend/color
|
||||
// state into subsequent item renders, such as Backhand offhand items.
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT | GL11.GL_CURRENT_BIT | GL11.GL_LIGHTING_BIT);
|
||||
|
||||
try {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tessellator.draw();
|
||||
} finally {
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ public class PaintedItemRenderer implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
if (data != null && data.length > 0) {
|
||||
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
|
||||
renderEquipped(item, (RenderBlocks) data[0]);
|
||||
@@ -38,9 +37,12 @@ public class PaintedItemRenderer implements IItemRenderer {
|
||||
}
|
||||
|
||||
public void renderEquipped(ItemStack item, RenderBlocks renderBlocks) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
if (item.getItem() != Item.getItemFromBlock(EnderIO.blockTravelPlatform)) {
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
renderToInventory(item, renderBlocks);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -22,7 +24,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.util.ForgeDirections;
|
||||
|
||||
@ThreadSafeISBRH(perThread = true)
|
||||
public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
public class SoulBinderRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
||||
|
||||
private static final float skullScale = 0.5f;
|
||||
private final BoundingBox scaledBB = BoundingBox.UNIT_CUBE.scale(skullScale, skullScale, skullScale);
|
||||
@@ -31,13 +33,23 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT | GL11.GL_CURRENT_BIT | GL11.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tessellator.draw();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
try {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
// Move the inventory render slightly down in the slot.
|
||||
GL11.glTranslatef(0.0f, -0.1f, 0.0f);
|
||||
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tessellator.draw();
|
||||
} finally {
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,6 +109,47 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockSoulBinder.renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT | GL11.GL_CURRENT_BIT | GL11.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
try {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
final RenderBlocks renderer = (RenderBlocks) data[0];
|
||||
final Block block = Block.getBlockFromItem(item.getItem());
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tessellator.draw();
|
||||
} finally {
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private ForgeDirection forFacing(ForgeDirection side, int facing) {
|
||||
return ForgeDirections.DIRECTIONS[ClientProxy.sideAndFacingToSpriteOffset[side.ordinal()][facing]];
|
||||
}
|
||||
@@ -113,14 +166,4 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
icons[dir.ordinal()] = override != null ? override : dir == faceSide ? faceIcon : defaultIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockSoulBinder.renderId;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,10 @@ public class BrokenSpawnerRenderer implements IItemRenderer {
|
||||
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
RenderBlocks rb = (RenderBlocks) data[0];
|
||||
rb.setOverrideBlockTexture(EnderIO.itemBrokenSpawner.getIconFromDamage(0));
|
||||
rb.renderBlockAsItem(Blocks.stone, 0, 1);
|
||||
|
||||
+13
-45
@@ -121,24 +121,20 @@ public class TransceiverRenderer extends TileEntitySpecialRenderer implements II
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
if (adjustForItem) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderItem(0f, 0f, 0f);
|
||||
return;
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderItem(0f, 1f, 1f);
|
||||
return;
|
||||
case INVENTORY:
|
||||
renderItem(0f, 0f, 0f);
|
||||
return;
|
||||
default:
|
||||
renderItem(0f, 0f, 0f);
|
||||
return;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
try {
|
||||
if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
if (adjustForItem) {
|
||||
GL11.glTranslatef(0f, 1f, 1f);
|
||||
} else {
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
renderItem(0, 0, 0);
|
||||
|
||||
model.render();
|
||||
} finally {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,32 +164,4 @@ public class TransceiverRenderer extends TileEntitySpecialRenderer implements II
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
private void renderItem(float x, float y, float z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
model.render();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
// private class OverlayRenderer implements IRenderFace {
|
||||
//
|
||||
// @Override
|
||||
// public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y, double
|
||||
// z, IIcon texture, List<Vertex> refVertices,
|
||||
// boolean translateToXyz) {
|
||||
//
|
||||
// ccr.getCustomRenderBlocks().doDefaultRenderFace(face,par1Block,x,y,z,texture);
|
||||
// if(curEnt != null && par1Block instanceof AbstractMachineBlock) {
|
||||
// IoMode mode = curEnt.getIoMode(face);
|
||||
// IIcon tex = ((AbstractMachineBlock)par1Block).getOverlayIconForMode(mode);
|
||||
// if(tex != null) {
|
||||
// ccr.getCustomRenderBlocks().doDefaultRenderFace(face,par1Block,x,y,z, tex);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -378,10 +378,10 @@ public class TileVacuumChest extends TileEntityEio
|
||||
}
|
||||
|
||||
int rsContr = nbtRoot.getInteger("redstoneControlMode");
|
||||
if (rsContr < 0 || rsContr >= RedstoneControlMode.values().length) {
|
||||
if (rsContr < 0 || rsContr >= RedstoneControlMode.VALUES.length) {
|
||||
rsContr = 0;
|
||||
}
|
||||
redstoneControlMode = RedstoneControlMode.values()[rsContr];
|
||||
redstoneControlMode = RedstoneControlMode.VALUES[rsContr];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,9 +23,17 @@ public class VacuumChestRenderer implements ISimpleBlockRenderingHandler, IItemR
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final CubeRenderer cr = CubeRenderer.get();
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
cr.render(BoundingBox.UNIT_CUBE.scale(0.6, 0.6, 0.6), EnderIO.blockHyperCube.getIcon(0, 0));
|
||||
cr.render(BoundingBox.UNIT_CUBE.scale(0.90, 0.90, 0.90), EnderIO.blockVacuumChest.getIcon(0, 0));
|
||||
|
||||
cr.render(
|
||||
BoundingBox.UNIT_CUBE.scale(0.7f, 0.7f, 0.7f).translate(0f, -0.1f, 0f),
|
||||
EnderIO.blockHyperCube.getIcon(0, 0));
|
||||
|
||||
cr.render(
|
||||
BoundingBox.UNIT_CUBE.scale(1f, 1f, 1f).translate(0f, -0.1f, 0f),
|
||||
EnderIO.blockVacuumChest.getIcon(0, 0));
|
||||
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,10 @@ public class WirelessChargedLocation {
|
||||
* use (unless ~4B changes happen in between). Do this instead directly updating so that WirelessChargedLocation
|
||||
* can be used while the TileEntity is still in construction (or loading).
|
||||
*/
|
||||
this.lastChangeCount = EnderIO.proxy.wirelessChargerController.getChangeCount() - 1;
|
||||
// The controller only exists on the server (created in FMLServerAboutToStartEvent), so it is null on
|
||||
// clients connected to a dedicated server. Chargers are only queried server-side, so stay inert there.
|
||||
WirelessChargerController wcc = EnderIO.proxy.wirelessChargerController;
|
||||
this.lastChangeCount = wcc == null ? 0 : wcc.getChangeCount() - 1;
|
||||
}
|
||||
|
||||
private void updateChargers() {
|
||||
@@ -41,7 +44,8 @@ public class WirelessChargedLocation {
|
||||
}
|
||||
|
||||
private void checkChangeCount() {
|
||||
if (lastChangeCount != EnderIO.proxy.wirelessChargerController.getChangeCount()) {
|
||||
WirelessChargerController wcc = EnderIO.proxy.wirelessChargerController;
|
||||
if (wcc != null && lastChangeCount != wcc.getChangeCount()) {
|
||||
updateChargers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public enum FrankenSkull {
|
||||
SKELETAL_CONTRACTOR("skullSkeletalContractor", "enderio:skullSkeletalContractor", false),
|
||||
GUARDIAN_DIODE("skullGuardianDiode", "enderio:skullGuardianDiode", false);
|
||||
|
||||
public static final FrankenSkull[] VALUES = values();
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
public final boolean isAnimated;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemFrankenSkull extends Item {
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemFrankenSkull.unlocalisedName);
|
||||
icons = new IIcon[FrankenSkull.values().length];
|
||||
icons = new IIcon[FrankenSkull.VALUES.length];
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -48,20 +48,20 @@ public class ItemFrankenSkull extends Item {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = IIconRegister.registerIcon(FrankenSkull.values()[i].iconKey);
|
||||
icons[i] = IIconRegister.registerIcon(FrankenSkull.VALUES[i].iconKey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, FrankenSkull.values().length - 1);
|
||||
return FrankenSkull.values()[i].unlocalisedName;
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, FrankenSkull.VALUES.length - 1);
|
||||
return FrankenSkull.VALUES[i].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < FrankenSkull.values().length; ++j) {
|
||||
for (int j = 0; j < FrankenSkull.VALUES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ItemFrankenSkull extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack par1ItemStack, int pass) {
|
||||
int meta = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, FrankenSkull.values().length - 1);
|
||||
return FrankenSkull.values()[meta].isAnimated;
|
||||
int meta = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, FrankenSkull.VALUES.length - 1);
|
||||
return FrankenSkull.VALUES[meta].isAnimated;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class ItemMachinePart extends Item {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemMachinePart.unlocalisedName);
|
||||
|
||||
icons = new IIcon[MachinePart.values().length];
|
||||
icons = new IIcon[MachinePart.VALUES.length];
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -41,29 +41,29 @@ public class ItemMachinePart extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, MachinePart.values().length - 1);
|
||||
damage = MathHelper.clamp_int(damage, 0, MachinePart.VALUES.length - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numParts = MachinePart.values().length;
|
||||
int numParts = MachinePart.VALUES.length;
|
||||
for (int i = 0; i < numParts; i++) {
|
||||
icons[i] = IIconRegister.registerIcon(MachinePart.values()[i].iconKey);
|
||||
icons[i] = IIconRegister.registerIcon(MachinePart.VALUES[i].iconKey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, MachinePart.values().length - 1);
|
||||
return MachinePart.values()[i].unlocalisedName;
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, MachinePart.VALUES.length - 1);
|
||||
return MachinePart.VALUES[i].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int j = 0; j < MachinePart.values().length; ++j) {
|
||||
for (int j = 0; j < MachinePart.VALUES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public enum MachinePart {
|
||||
SOUL_MACHINE_CHASSIS("soulMachineChassi"),
|
||||
END_STEEL_MACHINE_CHASSIS("endSteelMachineChassi");
|
||||
|
||||
public static final MachinePart[] VALUES = values();
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
public final String oreDict;
|
||||
@@ -24,7 +25,7 @@ public enum MachinePart {
|
||||
}
|
||||
|
||||
public static void registerOres(Item item) {
|
||||
for (MachinePart m : values()) {
|
||||
for (MachinePart m : VALUES) {
|
||||
OreDictionary.registerOre(m.oreDict, new ItemStack(item, 1, m.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,10 +69,18 @@ public class MachinePartRenderer implements IItemRenderer {
|
||||
}
|
||||
|
||||
private void renderToInventory(ItemStack item, RenderBlocks renderBlocks) {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
renderBlocks.setOverrideBlockTexture(EnderIO.itemMachinePart.getIconFromDamage(item.getItemDamage()));
|
||||
renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0F);
|
||||
renderBlocks.clearOverrideBlockTexture();
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
// Preserve GL state so this custom item renderer does not leak alpha/blend/color
|
||||
// state into subsequent item renders, such as Backhand offhand items.
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT | GL11.GL_CURRENT_BIT | GL11.GL_LIGHTING_BIT);
|
||||
|
||||
try {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
renderBlocks.setOverrideBlockTexture(EnderIO.itemMachinePart.getIconFromDamage(item.getItemDamage()));
|
||||
renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0F);
|
||||
} finally {
|
||||
renderBlocks.clearOverrideBlockTexture();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,27 +26,33 @@ public class PacketUtil {
|
||||
if (!(container instanceof IContainerWithTileEntity)) {
|
||||
Log.LOGGER.warn(
|
||||
Log.securityMarker,
|
||||
"Player {} tried to send {} while not opening correct GUI. Target TileEntity at {}, {}, {}",
|
||||
"Player {} tried to send {} while not opening correct GUI. Target TileEntity {} at {}, {}, {} in {}. Current container {}",
|
||||
player.getGameProfile(),
|
||||
messageClass.getSimpleName(),
|
||||
receivedTile,
|
||||
receivedTile.xCoord,
|
||||
receivedTile.yCoord,
|
||||
receivedTile.zCoord);
|
||||
receivedTile.zCoord,
|
||||
receivedTile.getWorldObj().provider.dimensionId,
|
||||
container);
|
||||
return true;
|
||||
}
|
||||
TileEntity expectedTile = ((IContainerWithTileEntity) container).getTileEntity();
|
||||
if (receivedTile != expectedTile) {
|
||||
Log.LOGGER.warn(
|
||||
Log.securityMarker,
|
||||
"Player {} tried to send {} which attempts to modify setting of TileEntity at {}, {}, {}. Expected: {}, {}, {}",
|
||||
"Player {} tried to send {} which attempts to modify setting of TileEntity at {}, {}, {} in {}. Expected: {}, {}, {} in {}. Current container {}",
|
||||
player.getGameProfile(),
|
||||
messageClass.getSimpleName(),
|
||||
receivedTile.xCoord,
|
||||
receivedTile.yCoord,
|
||||
receivedTile.zCoord,
|
||||
receivedTile.getWorldObj().provider.dimensionId,
|
||||
expectedTile.xCoord,
|
||||
expectedTile.yCoord,
|
||||
expectedTile.zCoord);
|
||||
expectedTile.zCoord,
|
||||
expectedTile.getWorldObj().provider.dimensionId,
|
||||
container);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -59,9 +59,19 @@ public class PacketTeleport extends MessageTileEntity<TileTelePad>
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketTeleport message, MessageContext ctx) {
|
||||
World world = ctx.side.isClient() ? EnderIO.proxy.getClientWorld() : message.getWorld(ctx);
|
||||
boolean isClient = ctx.side.isClient();
|
||||
World world = isClient ? EnderIO.proxy.getClientWorld() : message.getWorld(ctx);
|
||||
TileTelePad te = message.getTileEntity(world);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te == null) return null;
|
||||
if (!isClient) {
|
||||
// BEGIN is the only type of PacketTeleport that originates from a TE GUI
|
||||
if (message.type == Type.BEGIN && PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) {
|
||||
return null;
|
||||
}
|
||||
// TELEPORT is never sent to server
|
||||
if (message.type == Type.TELEPORT) return null;
|
||||
// other types are sent in background without a gui, so no checks
|
||||
}
|
||||
Entity e = world.getEntityByID(message.entityId);
|
||||
switch (message.type) {
|
||||
case BEGIN:
|
||||
|
||||
@@ -6,11 +6,15 @@ import java.util.Map;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.TechneModelRenderer;
|
||||
import com.enderio.core.client.render.TechneUtil;
|
||||
@@ -19,7 +23,7 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public class TelePadRenderer extends TechneModelRenderer {
|
||||
public class TelePadRenderer extends TechneModelRenderer implements IItemRenderer {
|
||||
|
||||
private final Collection<GroupObject> strippedModel = Lists.newArrayList();
|
||||
|
||||
@@ -97,4 +101,29 @@ public class TelePadRenderer extends TechneModelRenderer {
|
||||
CubeRenderer.get().render(block, metadata);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
try {
|
||||
renderInventoryBlock(
|
||||
Block.getBlockFromItem(item.getItem()),
|
||||
item.getItemDamage(),
|
||||
0,
|
||||
(RenderBlocks) data[0]);
|
||||
} finally {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user