mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 13:10:13 +00:00
Merge branch '1.7' of https://github.com/CrazyPants/EnderIO into 1.7
This commit is contained in:
commit
9f5af202bd
10 files changed
+38
-26
No files matched your search
@@ -43,11 +43,13 @@ public class PacketCurrentTask extends MessageTileEntity<AbstractPoweredTaskEnti
|
||||
@Override
|
||||
public IMessage onMessage(PacketCurrentTask message, MessageContext ctx) {
|
||||
AbstractPoweredTaskEntity tile = message.getTileEntity(EnderIO.proxy.getClientWorld());
|
||||
if(tile != null && message.nbtRoot.hasKey("currentTask")) {
|
||||
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("currentTask");
|
||||
tile.currentTask = PoweredTask.readFromNBT(message.nbtRoot.getCompoundTag("currentTask"));
|
||||
} else {
|
||||
tile.currentTask = null;
|
||||
if (tile != null) {
|
||||
if(message.nbtRoot.hasKey("currentTask")) {
|
||||
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("currentTask");
|
||||
tile.currentTask = PoweredTask.readFromNBT(message.nbtRoot.getCompoundTag("currentTask"));
|
||||
} else {
|
||||
tile.currentTask = null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class CrusherRecipeManager {
|
||||
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSagMill.unlocalisedName, new CrusherMachineRecipe());
|
||||
}
|
||||
|
||||
public void addCustumRecipes(String xmlDef) {
|
||||
public void addCustomRecipes(String xmlDef) {
|
||||
RecipeConfig config;
|
||||
try {
|
||||
config = RecipeConfigParser.parse(xmlDef, null);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class NetherWartFarmer extends SeedFarmer {
|
||||
@Override
|
||||
public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
|
||||
|
||||
if(!farm.isAir(bc)) {
|
||||
if(!farm.isOpen(bc)) {
|
||||
return false;
|
||||
}
|
||||
World worldObj = farm.getWorldObj();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class SeedFarmer implements IFarmerJoe {
|
||||
|
||||
@Override
|
||||
public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
|
||||
if(!farm.isAir(bc)) {
|
||||
if(!farm.isOpen(bc)) {
|
||||
return false;
|
||||
}
|
||||
if(requiresFarmland()) {
|
||||
|
||||
@@ -178,8 +178,9 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
|
||||
return worldObj.getBlockMetadata(bc.x, bc.y, bc.z);
|
||||
}
|
||||
|
||||
public boolean isAir(BlockCoord bc) {
|
||||
return worldObj.isAirBlock(bc.x, bc.y, bc.z);
|
||||
public boolean isOpen(BlockCoord bc) {
|
||||
Block block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
return block.isAir(worldObj, bc.x, bc.y, bc.z) || block.isReplaceable(worldObj, bc.x, bc.y, bc.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,11 +230,11 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
|
||||
}
|
||||
|
||||
|
||||
if(isAir(bc)) {
|
||||
if(isOpen(bc)) {
|
||||
FarmersComune.instance.prepareBlock(this, bc, block, meta);
|
||||
block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
}
|
||||
if(!isAir(bc) && hasPower()) {
|
||||
if(!isOpen(bc) && hasPower()) {
|
||||
IHarvestResult harvest = FarmersComune.instance.harvestBlock(this, bc, block, meta);
|
||||
if(harvest != null) {
|
||||
if(harvest.getDrops() != null) {
|
||||
|
||||
@@ -45,11 +45,13 @@ public class PacketZombieTank extends MessageTileEntity<TileZombieGenerator> imp
|
||||
public IMessage onMessage(PacketZombieTank message, MessageContext ctx) {
|
||||
EntityPlayer player = EnderIO.proxy.getClientPlayer();
|
||||
TileZombieGenerator tile = message.getTileEntity(player.worldObj);
|
||||
if(tile != null && message.nbtRoot.hasKey("tank")) {
|
||||
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("tank");
|
||||
tile.fuelTank.readFromNBT(tankRoot);
|
||||
} else {
|
||||
tile.fuelTank.setFluid(null);
|
||||
if (tile != null) {
|
||||
if(message.nbtRoot.hasKey("tank")) {
|
||||
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("tank");
|
||||
tile.fuelTank.readFromNBT(tankRoot);
|
||||
} else {
|
||||
tile.fuelTank.setFluid(null);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketChannelList message, MessageContext ctx) {
|
||||
if(isPrivate) {
|
||||
if(message.isPrivate) {
|
||||
ClientChannelRegister.instance.setPrivateChannels(message.channels);
|
||||
} else {
|
||||
ClientChannelRegister.instance.setPublicChannels(message.channels);
|
||||
|
||||
@@ -89,20 +89,20 @@ public class PacketClientState implements IMessage, IMessageHandler<PacketClient
|
||||
@Override
|
||||
public IMessage onMessage(PacketClientState message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(x, y, z);
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if(te instanceof TileHyperCube) {
|
||||
TileHyperCube hc = (TileHyperCube) te;
|
||||
|
||||
SubChannel[] vals = SubChannel.values();
|
||||
for (int i = 0; i < vals.length; i++) {
|
||||
SubChannel sc = vals[i];
|
||||
IoMode mode = modes.get(i);
|
||||
IoMode mode = message.modes.get(i);
|
||||
hc.setModeForChannel(sc, mode);
|
||||
}
|
||||
|
||||
hc.setChannel(selectedChannel);
|
||||
hc.setChannel(message.selectedChannel);
|
||||
|
||||
player.worldObj.markBlockForUpdate(x, y, z);
|
||||
player.worldObj.markBlockForUpdate(message.x, message.y, message.z);
|
||||
}
|
||||
return null;
|
||||
|
||||
|
||||
@@ -306,9 +306,6 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler {
|
||||
return false; //can't empty the entire thing
|
||||
}
|
||||
fill(ForgeDirection.UP, fluid, true);
|
||||
if(emptyItem == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
fillFrom = fillFrom.copy();
|
||||
fillFrom.stackSize--;
|
||||
@@ -318,6 +315,10 @@ public class TileTank extends AbstractMachineEntity implements IFluidHandler {
|
||||
setInventorySlotContents(0, fillFrom);
|
||||
}
|
||||
|
||||
if(emptyItem == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(inventory[2] == null) {
|
||||
setInventorySlotContents(2, emptyItem);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.util;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -50,7 +51,12 @@ public class FluidUtil {
|
||||
if(stack.getItem().hasContainerItem(stack)) {
|
||||
return stack.getItem().getContainerItem(stack);
|
||||
}
|
||||
return null;
|
||||
else if (stack.getItem() instanceof ItemPotion && stack.stackTagCompound == null) {
|
||||
return new ItemStack(Items.glass_bottle);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user