Fixes for latest forge and more rendering.
This commit is contained in:
parent
82b99fed34
commit
b0784c44d2
16 changed files with 168 additions and 120 deletions
|
@ -103,7 +103,8 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
}
|
||||
|
||||
for (IMultiblockPart part : casing.connectedParts) {
|
||||
// heat += BlockMachineCasing.getHeatFromMeta(part.getWorld().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z));
|
||||
BlockMachineCasing casing1 = (BlockMachineCasing) worldObj.getBlockState(part.getPos()).getBlock();
|
||||
heat += casing1.getHeatFromState(part.getWorld().getBlockState(part.getWorldLocation().toBlockPos()));
|
||||
//TODO meta fix
|
||||
}
|
||||
|
||||
|
|
|
@ -86,8 +86,8 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui
|
|||
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
||||
if (tileEntity instanceof TileMachineCasing) {
|
||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
|
||||
int heat;
|
||||
heat = BlockMachineCasing.getHeatFromMeta(tileEntity.getBlockMetadata());
|
||||
BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
||||
int heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) {
|
||||
|
|
|
@ -74,7 +74,8 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
if (tileEntity instanceof TileMachineCasing) {
|
||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
|
||||
int heat;
|
||||
heat = BlockMachineCasing.getHeatFromMeta(tileEntity.getBlockMetadata());
|
||||
BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
||||
heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) {
|
||||
|
|
|
@ -60,7 +60,8 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
if (tileEntity instanceof TileMachineCasing) {
|
||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
|
||||
int heat;
|
||||
heat = BlockMachineCasing.getHeatFromMeta(tileEntity.getBlockMetadata());
|
||||
BlockMachineCasing blockMachineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
||||
heat = blockMachineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
if (worldObj.getBlockState(location.getBlockPos()).getBlock().getUnlocalizedName().equals("tile.lava")) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.tiles;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
@ -53,17 +54,19 @@ public class TilePlayerDectector extends TilePowerAcceptor {
|
|||
while (tIterator.hasNext()) {
|
||||
EntityPlayer player = (EntityPlayer) tIterator.next();
|
||||
if (player.getDistanceSq((double) super.getPos().getX() + 0.5D, (double) super.getPos().getY() + 0.5D, (double) super.getPos().getZ() + 0.5D) <= 256.0D) {
|
||||
// if(worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == 0){//ALL
|
||||
// redstone = true;
|
||||
// } else if (blockMetadata == 1){//Others
|
||||
// if(!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())){
|
||||
// redstone = true;
|
||||
// }
|
||||
// } else {//You
|
||||
// if(!owenerUdid.isEmpty() &&owenerUdid.equals(player.getUniqueID().toString())){
|
||||
// redstone = true;
|
||||
// }
|
||||
// }//TODO meta fix
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) worldObj.getBlockState(pos).getBlock();
|
||||
int meta = blockMachineBase.getMetaFromState(worldObj.getBlockState(pos));
|
||||
if(meta == 0){//ALL
|
||||
redstone = true;
|
||||
} else if (meta == 1){//Others
|
||||
if(!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())){
|
||||
redstone = true;
|
||||
}
|
||||
} else {//You
|
||||
if(!owenerUdid.isEmpty() &&owenerUdid.equals(player.getUniqueID().toString())){
|
||||
redstone = true;
|
||||
}
|
||||
}
|
||||
redstone = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -10,6 +11,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.IChatComponent;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
@ -222,9 +224,11 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
if (worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k)).getBlock() != ModBlocks.MachineCasing) {
|
||||
return false;
|
||||
}
|
||||
// if (worldObj.getBlockMetadata(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k) != (((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1)) {
|
||||
// return false;
|
||||
// }//TODO meta fix
|
||||
IBlockState blockState = worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k));
|
||||
BlockMachineCasing blockMachineCasing = (BlockMachineCasing) blockState.getBlock();
|
||||
if (blockMachineCasing.getMetaFromState(blockState) != (((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1)) {
|
||||
return false;
|
||||
}
|
||||
} else if (!worldObj.isAirBlock(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k))) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import reborncore.common.misc.Functions;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
@ -45,19 +46,17 @@ public class TileIDSU extends TilePowerAcceptor {
|
|||
}
|
||||
|
||||
|
||||
//TODO meta fix
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
//return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) != Functions.getIntDirFromDirection(direction);
|
||||
return true;
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
//return worldObj.getBlockMetadata(getPos().getX(), getPos().getY(), getPos().getZ()) == Functions.getIntDirFromDirection(direction);
|
||||
return true;
|
||||
return getFacingEnum() == direction;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getMaxOutput() {
|
||||
return output;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue