mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
Merge branch 'master' of https://github.com/SleepyTrousers/EnderIO.git
This commit is contained in:
commit
210fb1ebf2
26 files changed
+217
-63
No files matched your search
@@ -229,14 +229,14 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
gui.getContainer().setInventorySlotsVisible(true);
|
||||
gui.getContainer().setInoutSlotsVisible(true, false);
|
||||
if(activeFilter != null) {
|
||||
filterGui = getFilterGui(activeFilter, true);
|
||||
filterGui = activeFilter.getGui(gui,itemConduit,true);
|
||||
}
|
||||
} else if(showOutput) {
|
||||
activeFilter = itemConduit.getOutputFilter(gui.getDir());
|
||||
gui.getContainer().setInoutSlotsVisible(false, true);
|
||||
gui.getContainer().setInventorySlotsVisible(true);
|
||||
if(activeFilter != null) {
|
||||
filterGui = getFilterGui(activeFilter, false);
|
||||
filterGui = activeFilter.getGui(gui,itemConduit,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,23 +250,6 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
}
|
||||
}
|
||||
|
||||
private IItemFilterGui getFilterGui(IItemFilter filter, boolean isInput) {
|
||||
//TODO: move to a factory
|
||||
if(filter instanceof ItemFilter) {
|
||||
ItemConduitFilterContainer cont = new ItemConduitFilterContainer(itemConduit, gui.getDir(), isInput);
|
||||
BasicItemFilterGui basicItemFilterGui = new BasicItemFilterGui(gui, cont, !isInput);
|
||||
basicItemFilterGui.createFilterSlots();
|
||||
return basicItemFilterGui;
|
||||
} else if(filter instanceof ExistingItemFilter) {
|
||||
return new ExistingItemFilterGui(gui, itemConduit, isInput);
|
||||
} else if(filter instanceof ModItemFilter) {
|
||||
return new ModItemFilterGui(gui, itemConduit, isInput);
|
||||
} else if(filter instanceof PowerItemFilter) {
|
||||
return new PowerItemFilterGui(gui, itemConduit, isInput);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void updateButtons() {
|
||||
|
||||
ConnectionMode mode = con.getConnectionMode(gui.getDir());
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.ExistingItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -15,6 +19,8 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
public class ExistingItemFilter implements IItemFilter {
|
||||
@@ -171,7 +177,13 @@ public class ExistingItemFilter implements IItemFilter {
|
||||
public void setSticky(boolean sticky) {
|
||||
this.sticky = sticky;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
return new ExistingItemFilterGui(gui, itemConduit, isInput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot) {
|
||||
readSettingsFromNBT(nbtRoot);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.List;
|
||||
@@ -9,10 +12,15 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
public interface IItemFilter {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput);
|
||||
|
||||
void readFromNBT(NBTTagCompound nbtRoot);
|
||||
|
||||
void writeToNBT(NBTTagCompound nbtRoot);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.BasicItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.ItemConduitFilterContainer;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -17,6 +22,8 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
public class ItemFilter implements IInventory, IItemFilter {
|
||||
@@ -241,6 +248,15 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
ItemConduitFilterContainer cont = new ItemConduitFilterContainer(itemConduit, gui.getDir(), isInput);
|
||||
BasicItemFilterGui basicItemFilterGui = new BasicItemFilterGui(gui, cont, !isInput);
|
||||
basicItemFilterGui.createFilterSlots();
|
||||
return basicItemFilterGui;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot) {
|
||||
isBlacklist = nbtRoot.getBoolean("isBlacklist");
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.ModItemFilterGui;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.List;
|
||||
@@ -12,6 +16,8 @@ import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
public class ModItemFilter implements IItemFilter {
|
||||
@@ -100,6 +106,12 @@ public class ModItemFilter implements IItemFilter {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
return new ModItemFilterGui(gui, itemConduit, isInput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot) {
|
||||
for (int i = 0; i < mods.length; i++) {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.PowerItemFilterGui;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.List;
|
||||
@@ -11,6 +15,8 @@ import cofh.api.energy.IEnergyContainerItem;
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
import com.enderio.core.common.network.NetworkUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory;
|
||||
|
||||
/**
|
||||
@@ -104,6 +110,12 @@ public class PowerItemFilter implements IItemFilter {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
return new PowerItemFilterGui(gui, itemConduit, isInput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot) {
|
||||
readSettingsFromNBT(nbtRoot);
|
||||
|
||||
@@ -78,11 +78,11 @@ public class ConduitTank implements IFluidTank {
|
||||
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill) {
|
||||
if(resource == null || resource.fluidID <= 0) {
|
||||
if (resource == null || resource.getFluidID() <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(fluid == null || fluid.fluidID <= 0) {
|
||||
if (fluid == null || fluid.getFluidID() <= 0) {
|
||||
if(resource.amount <= capacity) {
|
||||
if(doFill) {
|
||||
setLiquid(resource.copy());
|
||||
@@ -118,7 +118,7 @@ public class ConduitTank implements IFluidTank {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(int maxDrain, boolean doDrain) {
|
||||
if(fluid == null || fluid.fluidID <= 0) {
|
||||
if (fluid == null || fluid.getFluidID() <= 0) {
|
||||
return null;
|
||||
}
|
||||
if(fluid.amount <= 0) {
|
||||
@@ -134,7 +134,7 @@ public class ConduitTank implements IFluidTank {
|
||||
addAmount(-used);
|
||||
}
|
||||
|
||||
FluidStack drained = new FluidStack(fluid.fluidID, used);
|
||||
FluidStack drained = new FluidStack(fluid.getFluidID(), used);
|
||||
|
||||
if(fluid.amount < 0) {
|
||||
fluid.amount = 0;
|
||||
|
||||
@@ -77,9 +77,6 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
|
||||
// -----------------------------
|
||||
|
||||
private long lastEmptyTick = 0;
|
||||
private int numEmptyEvents = 0;
|
||||
|
||||
public static final int MAX_EXTRACT_PER_TICK = Config.fluidConduitExtractRate;
|
||||
|
||||
public static final int MAX_IO_PER_TICK = Config.fluidConduitMaxIoRate;
|
||||
@@ -127,8 +124,6 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
return;
|
||||
}
|
||||
|
||||
Fluid f = tank.getFluid() == null ? null : tank.getFluid().getFluid();
|
||||
int token = network == null ? -1 : network.getNextPushToken();
|
||||
for (ForgeDirection dir : externalConnections) {
|
||||
if(autoExtractForDir(dir)) {
|
||||
|
||||
@@ -304,7 +299,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
if(resource != null && !resource.isFluidEqual(tank.getFluid())) {
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||
return null;
|
||||
}
|
||||
return drain(from, resource.amount, doDrain);
|
||||
@@ -318,7 +313,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
if(tank.getFluid() == null) {
|
||||
return true;
|
||||
}
|
||||
if(fluid != null && fluid.getID() == tank.getFluid().fluidID) {
|
||||
if (fluid != null && fluid.getID() == tank.getFluid().getFluidID()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -21,8 +21,8 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketMagnetState.SlotType;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.BaublesUtil;
|
||||
|
||||
import static crazypants.enderio.item.darksteel.DarkSteelItems.itemMagnet;
|
||||
import static crazypants.util.BotaniaUtil.hasSolegnoliaAround;
|
||||
|
||||
public class MagnetController implements IEntitySelector {
|
||||
|
||||
@@ -112,13 +112,19 @@ public class MagnetController implements IEntitySelector {
|
||||
|
||||
@Override
|
||||
public boolean isEntityApplicable(Entity var1) {
|
||||
if (!blacklist.isEmpty() && var1 instanceof EntityItem) {
|
||||
Item item = ((EntityItem) var1).getEntityItem().getItem();
|
||||
for (Item blacklisted : blacklist) {
|
||||
if (blacklisted == item) {
|
||||
return false;
|
||||
if (var1.isDead) {
|
||||
return false;
|
||||
}
|
||||
if (var1 instanceof EntityItem) {
|
||||
if (!blacklist.isEmpty()) {
|
||||
Item item = ((EntityItem) var1).getEntityItem().getItem();
|
||||
for (Item blacklisted : blacklist) {
|
||||
if (blacklisted == item) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !hasSolegnoliaAround(var1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.enderio.core.common.util.Util;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
@@ -90,8 +91,9 @@ public class DarkSteelController {
|
||||
|
||||
private EnumSet<Type> getActiveSet(EntityPlayer player) {
|
||||
EnumSet<Type> active;
|
||||
UUID id = player.getGameProfile().getId();
|
||||
active = allActive.get(id);
|
||||
GameProfile gameProfile = player.getGameProfile();
|
||||
UUID id = gameProfile == null ? null : gameProfile.getId();
|
||||
active = id == null ? null : allActive.get(id);
|
||||
if(active == null) {
|
||||
active = DEFAULT_ACTIVE.clone();
|
||||
if(id != null) {
|
||||
|
||||
@@ -51,10 +51,12 @@ public class PacketUpgradeState implements IMessage, IMessageHandler<PacketUpgra
|
||||
@Override
|
||||
public IMessage onMessage(PacketUpgradeState message, MessageContext ctx) {
|
||||
EntityPlayer player = (EntityPlayer) (ctx.side.isClient() ? EnderIO.proxy.getClientWorld().getEntityByID(message.entityID) : ctx.getServerHandler().playerEntity);
|
||||
DarkSteelController.instance.setActive(player, message.type, message.isActive);
|
||||
if (ctx.side.isServer()) {
|
||||
message.entityID = player.getEntityId();
|
||||
PacketHandler.INSTANCE.sendToDimension(message, player.worldObj.provider.dimensionId);
|
||||
if (player != null) {
|
||||
DarkSteelController.instance.setActive(player, message.type, message.isActive);
|
||||
if (ctx.side.isServer()) {
|
||||
message.entityID = player.getEntityId();
|
||||
PacketHandler.INSTANCE.sendToDimension(message, player.worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
this(mo, teClass, new Material(MapColor.ironColor));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, modObject.unlocalisedName);
|
||||
GameRegistry.registerTileEntity(teClass, modObject.unlocalisedName + "TileEntity");
|
||||
@@ -81,6 +82,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, getGuiId(), world, x, y, z);
|
||||
@@ -100,7 +102,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
iconBuffer = new IIcon[2][12];
|
||||
String side = getSideIconKey(false);
|
||||
// first the 6 sides in OFF state
|
||||
iconBuffer[0][0] = iIconRegister.registerIcon(side);
|
||||
iconBuffer[0][0] = iIconRegister.registerIcon(getBottomIconKey(false));
|
||||
iconBuffer[0][1] = iIconRegister.registerIcon(getTopIconKey(false));
|
||||
iconBuffer[0][2] = iIconRegister.registerIcon(getBackIconKey(false));
|
||||
iconBuffer[0][3] = iIconRegister.registerIcon(getMachineFrontIconKey(false));
|
||||
@@ -108,7 +110,7 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
iconBuffer[0][5] = iIconRegister.registerIcon(side);
|
||||
|
||||
side = getSideIconKey(true);
|
||||
iconBuffer[0][6] = iIconRegister.registerIcon(side);
|
||||
iconBuffer[0][6] = iIconRegister.registerIcon(getBottomIconKey(true));
|
||||
iconBuffer[0][7] = iIconRegister.registerIcon(getTopIconKey(true));
|
||||
iconBuffer[0][8] = iIconRegister.registerIcon(getBackIconKey(true));
|
||||
iconBuffer[0][9] = iIconRegister.registerIcon(getMachineFrontIconKey(true));
|
||||
@@ -275,6 +277,10 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
return "enderio:machineTop";
|
||||
}
|
||||
|
||||
protected String getBottomIconKey(boolean active) {
|
||||
return "enderio:machineTemplate";
|
||||
}
|
||||
|
||||
protected String getModelIconKey(boolean active) {
|
||||
return getSideIconKey(active);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound nbtRoot) {
|
||||
super.readCustomNBT(nbtRoot);
|
||||
currentTask = createTask(nbtRoot.getCompoundTag("currentTask"));
|
||||
currentTask = nbtRoot.hasKey("currentTask") ? createTask(nbtRoot.getCompoundTag("currentTask")) : null;
|
||||
String uid = nbtRoot.getString("lastCompletedRecipe");
|
||||
lastCompletedRecipe = MachineRecipeRegistry.instance.getRecipeForUid(uid);
|
||||
}
|
||||
|
||||
@@ -147,10 +147,6 @@ public class PoweredTask implements IPoweredTask {
|
||||
}
|
||||
|
||||
public static IPoweredTask readFromNBT(NBTTagCompound nbtRoot) {
|
||||
if(nbtRoot == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IMachineRecipe recipe;
|
||||
|
||||
float usedEnergy = nbtRoot.getFloat(KEY_USED_ENERGY);
|
||||
|
||||
@@ -43,6 +43,11 @@ public abstract class BlockObeliskAbstract<T extends AbstractMachineEntity> exte
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBottomIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineBlank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
if(resource != null && !resource.isFluidEqual(tank.getFluid())) {
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||
return null;
|
||||
}
|
||||
return drain(from, resource.amount, doDrain);
|
||||
@@ -155,7 +155,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
|
||||
if(tank.getFluid() == null) {
|
||||
return true;
|
||||
}
|
||||
if(fluid != null && fluid.getID() == tank.getFluid().fluidID) {
|
||||
if (fluid != null && fluid.getID() == tank.getFluid().getFluidID()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -68,6 +68,11 @@ public class BlockSliceAndSplice extends AbstractMachineBlock<TileSliceAndSplice
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBottomIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineBlank";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineBack";
|
||||
|
||||
@@ -98,10 +98,16 @@ public class BlockSoulBinder extends AbstractMachineBlock<TileSoulBinder> {
|
||||
return "enderio:blockSoulMachineBlank";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTopIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBottomIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineBlank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
|
||||
@@ -181,7 +181,8 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler, IT
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
return canFill(from) && fluid != null && (tank.getFluidAmount() > 0 && tank.getFluid().fluidID == fluid.getID() || tank.getFluidAmount() == 0);
|
||||
return canFill(from) && fluid != null
|
||||
&& (tank.getFluidAmount() > 0 && tank.getFluid().getFluidID() == fluid.getID() || tank.getFluidAmount() == 0);
|
||||
}
|
||||
|
||||
private boolean canFill(ForgeDirection from) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Random;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -59,9 +60,11 @@ public class TelePadSpecialRenderer extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
private void render(GroupObject model, TileEntity te, Tessellator tes) {
|
||||
tes.startDrawingQuads();
|
||||
TechneUtil.renderWithIcon(model, te.getBlockType().getIcon(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, 0), null,
|
||||
Tessellator.instance, te.getWorldObj(), 0, 0, 0, null, false);
|
||||
tes.draw();
|
||||
final IIcon icon = te.getBlockType().getIcon(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, 0);
|
||||
if (icon != null && model != null) {
|
||||
tes.startDrawingQuads();
|
||||
TechneUtil.renderWithIcon(model, icon, null, Tessellator.instance, te.getWorldObj(), 0, 0, 0, null, false);
|
||||
tes.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ public class EnderIOCrashCallable implements ICrashCallable {
|
||||
private static String hasUnknownAE2 = null;
|
||||
private static String hasOldAE2 = null;
|
||||
private static String hasOldRF = null;
|
||||
private static String hasBadBrand = null;
|
||||
|
||||
public static void create() {
|
||||
|
||||
@@ -43,6 +44,17 @@ public class EnderIOCrashCallable implements ICrashCallable {
|
||||
}
|
||||
}
|
||||
|
||||
for (String brand : FMLCommonHandler.instance().getModName().split(",")) {
|
||||
if (brand != null && !brand.equals("fml") && !brand.equals("forge")) {
|
||||
if (hasBadBrand == null) {
|
||||
hasBadBrand = brand;
|
||||
} else {
|
||||
hasBadBrand += ", " + brand;
|
||||
}
|
||||
register = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (register) {
|
||||
FMLCommonHandler.instance().registerCrashCallable(new EnderIOCrashCallable());
|
||||
}
|
||||
@@ -51,6 +63,9 @@ public class EnderIOCrashCallable implements ICrashCallable {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
String msg = "Found the following problem(s) with your installation: ";
|
||||
if (hasBadBrand != null) {
|
||||
msg += "\"An unsupported base software is installed: '" + hasBadBrand + "'. This is NOT supported.\" ";
|
||||
}
|
||||
if (hasOptifine) {
|
||||
msg += "\"Optifine is installed. This is NOT supported.\" ";
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SmartTank extends FluidTank {
|
||||
if(fl == null || fluid == null) {
|
||||
return false;
|
||||
}
|
||||
return fl.getID() == fluid.fluidID;
|
||||
return fl.getID() == fluid.getFluidID();
|
||||
}
|
||||
|
||||
public FluidStack drain(FluidStack resource, boolean doDrain) {
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package crazypants.util;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import crazypants.enderio.Log;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class BotaniaUtil {
|
||||
|
||||
private static final String SOLEGNOLIA = "vazkii.botania.common.block.subtile.functional.SubTileSolegnolia";
|
||||
private static final String HAS_SOLEGNOLIA_AROUND = "hasSolegnoliaAround";
|
||||
private static Method hasSolegnoliaAround = null;
|
||||
private static int errorCount = -1;
|
||||
|
||||
public static boolean hasSolegnoliaAround(Entity entity) {
|
||||
if (errorCount < 0) {
|
||||
errorCount = 0;
|
||||
try {
|
||||
Class<?> solegnolia = Class.forName(SOLEGNOLIA);
|
||||
hasSolegnoliaAround = solegnolia.getMethod(HAS_SOLEGNOLIA_AROUND, Entity.class);
|
||||
} catch (Throwable t) {
|
||||
Log.debug("Didn't find Botania's Solegnolia class. Magnet will be greedy.");
|
||||
}
|
||||
}
|
||||
if (hasSolegnoliaAround != null) {
|
||||
try {
|
||||
Boolean result = (Boolean) hasSolegnoliaAround.invoke(null, entity);
|
||||
if (errorCount > 0) {
|
||||
errorCount--;
|
||||
}
|
||||
return result;
|
||||
} catch (Throwable t) {
|
||||
if (errorCount++ > 10) {
|
||||
Log.warn("Failed to interact with Botania too often. Magnet will ignore Solegnolias from now on. Last error was: " + t);
|
||||
hasSolegnoliaAround = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user