Loads more work. 275 errors.
This commit is contained in:
parent
6f69c6d7b4
commit
d1c193d0dd
82 changed files with 406 additions and 415 deletions
|
@ -97,7 +97,7 @@ public class Coord4D
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return world.getBlock(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
|
|
@ -480,10 +480,9 @@ public class ClientProxy extends CommonProxy
|
|||
{
|
||||
super.loadUtilities();
|
||||
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
TickRegistry.registerTickHandler(new RenderTickHandler(), Side.CLIENT);
|
||||
|
||||
NetworkRegistry..registerConnectionHandler(new ClientConnectionHandler());
|
||||
NetworkRegistry.registerConnectionHandler(new ClientConnectionHandler());
|
||||
|
||||
KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler());
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ public class ClientTickHandler
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickStart()
|
||||
{
|
||||
if(!preloadedSounds && mc.sndManager.sndSystem != null && MekanismClient.enableSounds)
|
||||
|
|
|
@ -52,7 +52,7 @@ public abstract class MekKeyHandler
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick (ClientTickEvent event)
|
||||
public void onTick(ClientTickEvent event)
|
||||
{
|
||||
if (event.side == Side.CLIENT)
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ public abstract class MekKeyHandler
|
|||
|
||||
}
|
||||
|
||||
public void keyTick (Type type, boolean tickEnd)
|
||||
public void keyTick(Type type, boolean tickEnd)
|
||||
{
|
||||
for (int i = 0; i < keyBindings.length; i++)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GuiEnergyCube extends GuiMekanism
|
|||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 43, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 43, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, ySize - 96 + 2, 0x404040);
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
|
|
@ -161,17 +161,17 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
|
||||
if(filter instanceof TItemStackFilter)
|
||||
{
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
playClickSound();
|
||||
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i));
|
||||
}
|
||||
else if(filter instanceof TOreDictFilter)
|
||||
{
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
playClickSound();
|
||||
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i));
|
||||
}
|
||||
else if(filter instanceof TMaterialFilter)
|
||||
{
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
playClickSound();
|
||||
Mekanism.packetPipeline.sendToServer(new PacketLogisticalSorterGui(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i));
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
data.add(1);
|
||||
|
||||
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
playClickSound();
|
||||
}
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 26 && yAxis >= 84 && yAxis <= 98)
|
||||
|
@ -193,7 +193,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
data.add(2);
|
||||
|
||||
Mekanism.packetPipeline.sendToServer(new PacketTileEntity(Coord4D.get(tileEntity), data));
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
playClickSound();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 43, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 43, 6, 0x404040);
|
||||
|
||||
fontRendererObj.drawString(MekanismUtils.localize("gui.filters") + ":", 11, 19, 0x00CD00);
|
||||
fontRendererObj.drawString("IS: " + getItemStackFilters().size(), 11, 28, 0x00CD00);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class GuiMetallurgicInfuser extends GuiMekanism
|
|||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
|
||||
if(xAxis >= 7 && xAxis <= 11 && yAxis >= 17 && yAxis <= 69)
|
||||
|
|
|
@ -69,7 +69,7 @@ public class GuiPRC extends GuiMekanism
|
|||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 81, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 81, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
|
|
@ -14,9 +14,11 @@ import net.minecraft.inventory.Container;
|
|||
import net.minecraft.inventory.ContainerRepair;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.client.C17PacketCustomPayload;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -262,7 +264,7 @@ public class GuiRobitRepair extends GuiMekanism implements ICrafting
|
|||
if(itemstack != null)
|
||||
{
|
||||
repairContainer.updateItemName(itemNameField.getText());
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new Packet250CustomPayload("MC|ItemName", itemNameField.getText().getBytes()));
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", itemNameField.getText().getBytes(Charsets.UTF_8)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class GuiTeleporter extends GuiMekanism
|
|||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.status, 66, 19, 0x00CD00);
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import mekanism.common.transporter.TransporterStack;
|
|||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
|
@ -30,8 +29,8 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
|||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
@ -45,7 +44,6 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import codechicken.lib.colour.Colour;
|
||||
import codechicken.lib.colour.ColourRGBA;
|
||||
import codechicken.lib.lighting.LazyLightMatrix;
|
||||
import codechicken.lib.lighting.LightMatrix;
|
||||
import codechicken.lib.lighting.LightModel;
|
||||
import codechicken.lib.lighting.LightModel.Light;
|
||||
|
@ -53,10 +51,8 @@ import codechicken.lib.render.CCModel;
|
|||
import codechicken.lib.render.CCRenderState;
|
||||
import codechicken.lib.render.CCRenderState.IVertexOperation;
|
||||
import codechicken.lib.render.ColourMultiplier;
|
||||
import codechicken.lib.render.uv.IVertexModifier;
|
||||
import codechicken.lib.render.uv.UVTransformation;
|
||||
import codechicken.lib.render.TextureUtils;
|
||||
import codechicken.lib.render.TextureUtils.IIconRegister;
|
||||
import codechicken.lib.render.TextureUtils.IIconSelfRegister;
|
||||
import codechicken.lib.render.uv.UV;
|
||||
import codechicken.lib.vec.Translation;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
|
@ -64,7 +60,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderPartTransmitter implements IIconRegister
|
||||
public class RenderPartTransmitter implements IIconSelfRegister
|
||||
{
|
||||
public static RenderPartTransmitter INSTANCE;
|
||||
|
||||
|
@ -246,7 +242,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
|
||||
GL11.glPushMatrix();
|
||||
CCRenderState.reset();
|
||||
CCRenderState.useNormals(true);
|
||||
CCRenderState.useNormals = true;
|
||||
CCRenderState.useModelColours(true);
|
||||
CCRenderState.startDrawing(7);
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
@ -354,7 +350,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
|
||||
toReturn.setSideRender(side, false);
|
||||
|
@ -477,7 +473,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
|
||||
GL11.glPushMatrix();
|
||||
CCRenderState.reset();
|
||||
CCRenderState.useNormals(true);
|
||||
CCRenderState.useNormals = true;
|
||||
CCRenderState.useModelColours(true);
|
||||
CCRenderState.startDrawing(7);
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
@ -531,7 +527,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
|
||||
IIcon renderIcon = out ? type.getSideIcon() : type.getCenterIcon();
|
||||
|
||||
renderPart(renderIcon, getItemModel(side, type), 0,0,0, null, null);
|
||||
renderPart(renderIcon, getItemModel(side, type), 0, 0, 0, null, null);
|
||||
}
|
||||
|
||||
public void renderEnergySide(ForgeDirection side, PartUniversalCable cable)
|
||||
|
@ -625,10 +621,10 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
icon = Items.gunpowder.getIcon(new ItemStack(Items.gunpowder), 0);
|
||||
break;
|
||||
case 1:
|
||||
icon = Blocks.torchRedstoneActive.getIcon(0, 0);
|
||||
icon = Blocks.redstone_torch.getIcon(0, 0);
|
||||
break;
|
||||
case 2:
|
||||
icon = Blocks.torchRedstoneIdle.getIcon(0, 0);
|
||||
icon = Blocks.redstone_torch.getIcon(0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -742,7 +738,7 @@ public class RenderPartTransmitter implements IIconRegister
|
|||
|
||||
if(olm != null)
|
||||
{
|
||||
lightMatrix = olm.lightMatrix();
|
||||
lightMatrix = olm;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,140 +37,134 @@ public class RenderTickHandler
|
|||
public Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(RenderTickEvent event)
|
||||
public void tickEnd(RenderTickEvent event)
|
||||
{
|
||||
if(event.phase == Phase.END)
|
||||
{
|
||||
tickEnd(event.renderTickTime);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(float partialTick)
|
||||
{
|
||||
if(mc.thePlayer != null && mc.theWorld != null)
|
||||
{
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
|
||||
MovingObjectPosition pos = player.rayTrace(40.0D, 1.0F);
|
||||
|
||||
if(pos != null)
|
||||
if(mc.thePlayer != null && mc.theWorld != null)
|
||||
{
|
||||
int x = MathHelper.floor_double(pos.blockX);
|
||||
int y = MathHelper.floor_double(pos.blockY);
|
||||
int z = MathHelper.floor_double(pos.blockZ);
|
||||
|
||||
Coord4D obj = new Coord4D(x, y, z, world.provider.dimensionId);
|
||||
|
||||
if(Mekanism.debug && mc.currentScreen == null && !mc.gameSettings.showDebugInfo)
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
|
||||
FontRenderer font = mc.fontRenderer;
|
||||
|
||||
MovingObjectPosition pos = player.rayTrace(40.0D, 1.0F);
|
||||
|
||||
if(pos != null)
|
||||
{
|
||||
String tileDisplay = "";
|
||||
|
||||
if(obj.getTileEntity(world) != null)
|
||||
int x = MathHelper.floor_double(pos.blockX);
|
||||
int y = MathHelper.floor_double(pos.blockY);
|
||||
int z = MathHelper.floor_double(pos.blockZ);
|
||||
|
||||
Coord4D obj = new Coord4D(x, y, z, world.provider.dimensionId);
|
||||
|
||||
if(Mekanism.debug && mc.currentScreen == null && !mc.gameSettings.showDebugInfo)
|
||||
{
|
||||
if(obj.getTileEntity(world).getClass() != null)
|
||||
String tileDisplay = "";
|
||||
|
||||
if(obj.getTileEntity(world) != null)
|
||||
{
|
||||
tileDisplay = obj.getTileEntity(world).getClass().getSimpleName();
|
||||
if(obj.getTileEntity(world).getClass() != null)
|
||||
{
|
||||
tileDisplay = obj.getTileEntity(world).getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
|
||||
font.drawStringWithShadow("Block: " + obj.getBlock(world).getUnlocalizedName(), 1, 1, 0x404040);
|
||||
font.drawStringWithShadow("Metadata: " + obj.getMetadata(world), 1, 10, 0x404040);
|
||||
font.drawStringWithShadow("Location: " + MekanismUtils.getCoordDisplay(obj), 1, 19, 0x404040);
|
||||
font.drawStringWithShadow("TileEntity: " + tileDisplay, 1, 28, 0x404040);
|
||||
font.drawStringWithShadow("Side: " + pos.sideHit, 1, 37, 0x404040);
|
||||
}
|
||||
|
||||
font.drawStringWithShadow("Block: " + obj.getBlock(world).getUnlocalizedName(), 1, 1, 0x404040);
|
||||
font.drawStringWithShadow("Metadata: " + obj.getMetadata(world), 1, 10, 0x404040);
|
||||
font.drawStringWithShadow("Location: " + MekanismUtils.getCoordDisplay(obj), 1, 19, 0x404040);
|
||||
font.drawStringWithShadow("TileEntity: " + tileDisplay, 1, 28, 0x404040);
|
||||
font.drawStringWithShadow("Side: " + pos.sideHit, 1, 37, 0x404040);
|
||||
}
|
||||
}
|
||||
|
||||
if(player != null && !(mc.currentScreen instanceof GuiChat) && player.getEquipmentInSlot(3) != null)
|
||||
{
|
||||
ItemStack stack = player.getEquipmentInSlot(3);
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
|
||||
int x = scaledresolution.getScaledWidth();
|
||||
int y = scaledresolution.getScaledHeight();
|
||||
|
||||
if(stack.getItem() instanceof ItemJetpack)
|
||||
|
||||
if(player != null && !(mc.currentScreen instanceof GuiChat) && player.getEquipmentInSlot(3) != null)
|
||||
{
|
||||
ItemJetpack jetpack = (ItemJetpack)stack.getItem();
|
||||
|
||||
font.drawStringWithShadow("Mode: " + jetpack.getMode(stack).getName(), 1, y - 20, 0x404040);
|
||||
font.drawStringWithShadow("Hydrogen: " + jetpack.getStored(stack), 1, y - 11, 0x404040);
|
||||
ItemStack stack = player.getEquipmentInSlot(3);
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
|
||||
|
||||
int x = scaledresolution.getScaledWidth();
|
||||
int y = scaledresolution.getScaledHeight();
|
||||
|
||||
if(stack.getItem() instanceof ItemJetpack)
|
||||
{
|
||||
ItemJetpack jetpack = (ItemJetpack)stack.getItem();
|
||||
|
||||
font.drawStringWithShadow("Mode: " + jetpack.getMode(stack).getName(), 1, y - 20, 0x404040);
|
||||
font.drawStringWithShadow("Hydrogen: " + jetpack.getStored(stack), 1, y - 11, 0x404040);
|
||||
}
|
||||
else if(stack.getItem() instanceof ItemScubaTank)
|
||||
{
|
||||
ItemScubaTank scubaTank = (ItemScubaTank)stack.getItem();
|
||||
String state = (scubaTank.getFlowing(stack) ? EnumColor.DARK_GREEN + "On" : EnumColor.DARK_RED + "Off");
|
||||
|
||||
font.drawStringWithShadow("Mode: " + state, 1, y - 20, 0x404040);
|
||||
font.drawStringWithShadow("Oxygen: " + scubaTank.getStored(stack), 1, y - 11, 0x404040);
|
||||
}
|
||||
}
|
||||
else if(stack.getItem() instanceof ItemScubaTank)
|
||||
|
||||
Set<String> copy = (Set)((HashSet)Mekanism.jetpackOn).clone();
|
||||
|
||||
for(String s : copy)
|
||||
{
|
||||
ItemScubaTank scubaTank = (ItemScubaTank)stack.getItem();
|
||||
String state = (scubaTank.getFlowing(stack) ? EnumColor.DARK_GREEN + "On" : EnumColor.DARK_RED + "Off");
|
||||
|
||||
font.drawStringWithShadow("Mode: " + state, 1, y - 20, 0x404040);
|
||||
font.drawStringWithShadow("Oxygen: " + scubaTank.getStored(stack), 1, y - 11, 0x404040);
|
||||
EntityPlayer p = mc.theWorld.getPlayerEntityByName(s);
|
||||
|
||||
if(p == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Pos3D playerPos = new Pos3D(p);
|
||||
|
||||
if(p != mc.thePlayer)
|
||||
{
|
||||
playerPos.translate(0, 1.7, 0);
|
||||
}
|
||||
|
||||
float random = (rand.nextFloat()-0.5F)*0.1F;
|
||||
|
||||
Pos3D vLeft = new Pos3D();
|
||||
vLeft.xPos -= 0.43;
|
||||
vLeft.yPos -= 0.55;
|
||||
vLeft.zPos -= 0.54;
|
||||
vLeft.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vRight = new Pos3D();
|
||||
vRight.xPos += 0.43;
|
||||
vRight.yPos -= 0.55;
|
||||
vRight.zPos -= 0.54;
|
||||
vRight.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vCenter = new Pos3D();
|
||||
vCenter.xPos = (rand.nextFloat()-0.5F)*0.4F;
|
||||
vCenter.yPos -= 0.86;
|
||||
vCenter.zPos -= 0.30;
|
||||
vCenter.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D rLeft = vLeft.clone().scale(random);
|
||||
Pos3D rRight = vRight.clone().scale(random);
|
||||
|
||||
Pos3D mLeft = vLeft.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
Pos3D mRight = vRight.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
Pos3D mCenter = vCenter.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
|
||||
mLeft.translate(rLeft);
|
||||
mRight.translate(rRight);
|
||||
|
||||
Pos3D v = playerPos.clone().translate(vLeft);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
|
||||
v = playerPos.clone().translate(vRight);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
|
||||
v = playerPos.clone().translate(vCenter);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> copy = (Set)((HashSet)Mekanism.jetpackOn).clone();
|
||||
|
||||
for(String s : copy)
|
||||
{
|
||||
EntityPlayer p = mc.theWorld.getPlayerEntityByName(s);
|
||||
|
||||
if(p == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Pos3D playerPos = new Pos3D(p);
|
||||
|
||||
if(p != mc.thePlayer)
|
||||
{
|
||||
playerPos.translate(0, 1.7, 0);
|
||||
}
|
||||
|
||||
float random = (rand.nextFloat()-0.5F)*0.1F;
|
||||
|
||||
Pos3D vLeft = new Pos3D();
|
||||
vLeft.xPos -= 0.43;
|
||||
vLeft.yPos -= 0.55;
|
||||
vLeft.zPos -= 0.54;
|
||||
vLeft.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vRight = new Pos3D();
|
||||
vRight.xPos += 0.43;
|
||||
vRight.yPos -= 0.55;
|
||||
vRight.zPos -= 0.54;
|
||||
vRight.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D vCenter = new Pos3D();
|
||||
vCenter.xPos = (rand.nextFloat()-0.5F)*0.4F;
|
||||
vCenter.yPos -= 0.86;
|
||||
vCenter.zPos -= 0.30;
|
||||
vCenter.rotateYaw(p.renderYawOffset);
|
||||
|
||||
Pos3D rLeft = vLeft.clone().scale(random);
|
||||
Pos3D rRight = vRight.clone().scale(random);
|
||||
|
||||
Pos3D mLeft = vLeft.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
Pos3D mRight = vRight.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
Pos3D mCenter = vCenter.clone().scale(0.2).translate(new Pos3D(p.motionX, p.motionY, p.motionZ));
|
||||
|
||||
mLeft.translate(rLeft);
|
||||
mRight.translate(rRight);
|
||||
|
||||
Pos3D v = playerPos.clone().translate(vLeft);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mLeft.xPos, mLeft.yPos, mLeft.zPos);
|
||||
|
||||
v = playerPos.clone().translate(vRight);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mRight.xPos, mRight.yPos, mRight.zPos);
|
||||
|
||||
v = playerPos.clone().translate(vCenter);
|
||||
spawnAndSetParticle("flame", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
spawnAndSetParticle("smoke", world, v.xPos, v.yPos, v.zPos, mCenter.xPos, mCenter.yPos, mCenter.zPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
|||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -80,7 +81,7 @@ public class ItemRenderingHandler implements IItemRenderer
|
|||
public ModelAtomicDisassembler atomicDisassembler = new ModelAtomicDisassembler();
|
||||
|
||||
private final RenderBalloon balloonRenderer = new RenderBalloon();
|
||||
private final RenderBin binRenderer = (RenderBin)TileEntityRenderer.instance.specialRendererMap.get(TileEntityBin.class);
|
||||
private final RenderBin binRenderer = (RenderBin)TileEntityRendererDispatcher.instance.mapSpecialRenderers.get(TileEntityBin.class);
|
||||
private final RenderItem renderItem = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class);
|
||||
|
||||
@Override
|
||||
|
|
|
@ -48,7 +48,7 @@ public class RenderBin extends TileEntitySpecialRenderer
|
|||
|
||||
Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.getOrientation(tileEntity.facing));
|
||||
|
||||
if(tileEntity.getWorldObj().isBlockSolidOnSide(obj.xCoord, obj.yCoord, obj.zCoord, ForgeDirection.getOrientation(tileEntity.facing).getOpposite()))
|
||||
if(tileEntity.getWorldObj().getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isSideSolid(tileEntity.getWorldObj(), obj.xCoord, obj.yCoord, obj.zCoord, ForgeDirection.getOrientation(tileEntity.facing).getOpposite()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class RenderBin extends TileEntitySpecialRenderer
|
|||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(getFontRenderer(), renderEngine, itemStack, 0, 0);
|
||||
renderItem.renderItemAndEffectIntoGUI(func_147498_b()/*getFontRenderer()*/, renderEngine, itemStack, 0, 0);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
@ -104,7 +104,7 @@ public class RenderBin extends TileEntitySpecialRenderer
|
|||
|
||||
private void doLight(World world, Coord4D obj)
|
||||
{
|
||||
if(world.isBlockOpaqueCube(obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
if(world.getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isOpaqueCube())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ public class RenderBin extends TileEntitySpecialRenderer
|
|||
GL11.glTranslatef(displayWidth / 2, 1F, displayHeight / 2);
|
||||
GL11.glRotatef(-90, 1, 0, 0);
|
||||
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
FontRenderer fontRenderer = func_147498_b();//getFontRenderer();
|
||||
|
||||
int requiredWidth = Math.max(fontRenderer.getStringWidth(text), 1);
|
||||
int lineHeight = fontRenderer.FONT_HEIGHT + 2;
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.client.model.ModelChemicalInfuser;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
|
@ -12,8 +11,8 @@ import mekanism.client.render.MekanismRenderer.Model3D;
|
|||
import mekanism.common.tile.TileEntityChemicalInfuser;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
@ -128,7 +127,7 @@ public class RenderChemicalInfuser extends TileEntitySpecialRenderer
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(gas.getIcon());
|
||||
|
||||
DisplayInteger display = DisplayInteger.createAndStart();
|
||||
|
|
|
@ -11,8 +11,8 @@ import mekanism.client.render.MekanismRenderer.Model3D;
|
|||
import mekanism.common.tile.TileEntityChemicalOxidizer;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class RenderChemicalOxidizer extends TileEntitySpecialRenderer
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(gas.getIcon());
|
||||
|
||||
DisplayInteger display = DisplayInteger.createAndStart();
|
||||
|
|
|
@ -11,6 +11,7 @@ import mekanism.common.IInvConfiguration;
|
|||
import mekanism.common.item.ItemConfigurator;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -36,7 +37,7 @@ public class RenderConfigurableMachine extends TileEntitySpecialRenderer
|
|||
|
||||
public RenderConfigurableMachine()
|
||||
{
|
||||
tileEntityRenderer = TileEntityRenderer.instance;
|
||||
field_147501_a = TileEntityRendererDispatcher.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,13 +7,12 @@ import mekanism.api.Coord4D;
|
|||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
import mekanism.common.tank.SynchronizedTankData.ValveData;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
import mekanism.common.tile.TileEntityDynamicTank;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -117,7 +116,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
|
||||
final int stages = getStages(data.height);
|
||||
|
@ -168,7 +167,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getFlowingIcon());
|
||||
|
||||
DisplayInteger display = DisplayInteger.createAndStart();
|
||||
|
@ -279,17 +278,17 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer
|
|||
|
||||
private double getX(int x)
|
||||
{
|
||||
return x - TileEntityRenderer.staticPlayerX;
|
||||
return x - TileEntityRendererDispatcher.staticPlayerX;
|
||||
}
|
||||
|
||||
private double getY(int y)
|
||||
{
|
||||
return y - TileEntityRenderer.staticPlayerY;
|
||||
return y - TileEntityRendererDispatcher.staticPlayerY;
|
||||
}
|
||||
|
||||
private double getZ(int z)
|
||||
{
|
||||
return z - TileEntityRenderer.staticPlayerZ;
|
||||
return z - TileEntityRendererDispatcher.staticPlayerZ;
|
||||
}
|
||||
|
||||
public static class RenderData
|
||||
|
|
|
@ -9,12 +9,10 @@ import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
|||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
import mekanism.common.tile.TileEntitySalinationController;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
|
@ -90,7 +88,7 @@ public class RenderSalinationController extends TileEntitySpecialRenderer
|
|||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.waterStill;
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
|
||||
final int stages = getStages(data.height);
|
||||
|
@ -172,17 +170,17 @@ public class RenderSalinationController extends TileEntitySpecialRenderer
|
|||
|
||||
private double getX(int x)
|
||||
{
|
||||
return x - TileEntityRenderer.staticPlayerX;
|
||||
return x - TileEntityRendererDispatcher.staticPlayerX;
|
||||
}
|
||||
|
||||
private double getY(int y)
|
||||
{
|
||||
return y - TileEntityRenderer.staticPlayerY;
|
||||
return y - TileEntityRendererDispatcher.staticPlayerY;
|
||||
}
|
||||
|
||||
private double getZ(int z)
|
||||
{
|
||||
return z - TileEntityRenderer.staticPlayerZ;
|
||||
return z - TileEntityRendererDispatcher.staticPlayerZ;
|
||||
}
|
||||
|
||||
public static class SalinationRenderData
|
||||
|
|
|
@ -2,17 +2,16 @@ package mekanism.client.render.tileentity;
|
|||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
@ -42,7 +41,7 @@ public class RenderTeleporter extends TileEntitySpecialRenderer
|
|||
Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.WEST);
|
||||
int type = 0;
|
||||
|
||||
if(obj.getBlockId(tileEntity.getWorldObj()) == Mekanism.basicBlockID && obj.getMetadata(tileEntity.getWorldObj()) == 7)
|
||||
if(obj.getBlock(tileEntity.getWorldObj()) == Mekanism.BasicBlock && obj.getMetadata(tileEntity.getWorldObj()) == 7)
|
||||
{
|
||||
type = 1;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.io.FileWriter;
|
|||
import java.io.IOException;
|
||||
|
||||
import mekanism.api.MekanismAPI;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public final class BoxBlacklistParser
|
||||
{
|
||||
|
@ -70,7 +71,7 @@ public final class BoxBlacklistParser
|
|||
System.err.println("[Mekanism] BoxBlacklist.txt: Couldn't parse blacklist data on line " + line);
|
||||
}
|
||||
|
||||
MekanismAPI.addBoxBlacklist(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
|
||||
MekanismAPI.addBoxBlacklist(Block.getBlockFromName(split[0]), Integer.parseInt(split[1]));
|
||||
entries++;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mekanism.common;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CreativeTabMekanism extends CreativeTabs
|
||||
|
@ -15,4 +16,10 @@ public class CreativeTabMekanism extends CreativeTabs
|
|||
{
|
||||
return new ItemStack(Mekanism.AtomicCore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
{
|
||||
return Mekanism.AtomicCore;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
|
|||
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StackUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -165,7 +166,7 @@ public interface IFactory
|
|||
{
|
||||
if(cacheTile == null)
|
||||
{
|
||||
MachineType type = MachineType.get(getStack().itemID, getStack().getItemDamage());
|
||||
MachineType type = MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
cacheTile = (TileEntityAdvancedElectricMachine)type.create();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import mekanism.common.multipart.TransmitterType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public final class ItemAttacher
|
||||
|
@ -14,8 +14,8 @@ public final class ItemAttacher
|
|||
static
|
||||
{
|
||||
attachable.add(new ItemStack(Blocks.lever));
|
||||
attachable.add(new ItemStack(Blocks.torchRedstoneIdle));
|
||||
attachable.add(new ItemStack(Blocks.torchWood));
|
||||
attachable.add(new ItemStack(Blocks.redstone_torch));
|
||||
attachable.add(new ItemStack(Blocks.torch));
|
||||
|
||||
for(TransmitterType type : TransmitterType.values())
|
||||
{
|
||||
|
|
|
@ -13,5 +13,5 @@ public final class ObfuscatedNames
|
|||
public static String[] GuiScreen_fontRenderer = new String[] {"fontRenderer", "field_73886_k", "o"};
|
||||
public static String[] GuiContainer_guiLeft = new String[] {"guiLeft", "field_74198_m"};
|
||||
public static String[] GuiContainer_guiTop = new String[] {"guiTop", "field_74197_n"};
|
||||
public static String[] NetHandlerPlayServerd_floatingTickCount = new String[] {"floatingTickCount", "field_147365_f"};
|
||||
public static String[] NetHandlerPlayServer_floatingTickCount = new String[] {"floatingTickCount", "field_147365_f"};
|
||||
}
|
|
@ -39,7 +39,7 @@ public class RobitAIFollow extends EntityAIBase
|
|||
public RobitAIFollow(EntityRobit entityRobit, float speed, float min, float max)
|
||||
{
|
||||
theRobit = entityRobit;
|
||||
theWorld = entityRobit.getWorldObj();
|
||||
theWorld = entityRobit.worldObj;
|
||||
moveSpeed = speed;
|
||||
thePathfinder = entityRobit.getNavigator();
|
||||
minDist = min;
|
||||
|
@ -56,7 +56,7 @@ public class RobitAIFollow extends EntityAIBase
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if(theRobit.getWorldObj().provider.dimensionId != player.worldObj.provider.dimensionId)
|
||||
else if(theRobit.worldObj.provider.dimensionId != player.worldObj.provider.dimensionId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class RobitAIFollow extends EntityAIBase
|
|||
@Override
|
||||
public boolean continueExecuting()
|
||||
{
|
||||
return !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(theOwner) > (maxDist * maxDist) && theRobit.getFollowing() && theRobit.getEnergy() > 0 && theOwner.getWorldObj().provider.dimensionId == theRobit.getWorldObj().provider.dimensionId;
|
||||
return !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(theOwner) > (maxDist * maxDist) && theRobit.getFollowing() && theRobit.getEnergy() > 0 && theOwner.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -126,7 +126,7 @@ public class RobitAIFollow extends EntityAIBase
|
|||
{
|
||||
for(int i1 = 0; i1 <= 4; ++i1)
|
||||
{
|
||||
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.doesBlockHaveSolidTopSurface(x + l, z - 1, y + i1) && !theWorld.isBlockNormalCube(x + l, z, y + i1) && !theWorld.isBlockNormalCube(x + l, z + 1, y + i1))
|
||||
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.doesBlockHaveSolidTopSurface(theWorld, x + l, z - 1, y + i1) && !theWorld.getBlock(x + l, z, y + i1).isNormalCube() && !theWorld.getBlock(x + l, z + 1, y + i1).isNormalCube())
|
||||
{
|
||||
theRobit.setLocationAndAngles((x + l) + 0.5F, z, (y + i1) + 0.5F, theRobit.rotationYaw, theRobit.rotationPitch);
|
||||
thePathfinder.clearPathEntity();
|
||||
|
|
|
@ -40,7 +40,7 @@ public class RobitAIPickup extends EntityAIBase
|
|||
public RobitAIPickup(EntityRobit entityRobit, float speed)
|
||||
{
|
||||
theRobit = entityRobit;
|
||||
theWorld = entityRobit.getWorldObj();
|
||||
theWorld = entityRobit.worldObj;
|
||||
moveSpeed = speed;
|
||||
thePathfinder = entityRobit.getNavigator();
|
||||
setMutexBits(3);
|
||||
|
@ -58,10 +58,10 @@ public class RobitAIPickup extends EntityAIBase
|
|||
return true;
|
||||
}
|
||||
|
||||
List items = theRobit.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(theRobit.posX-10, theRobit.posY-10, theRobit.posZ-10, theRobit.posX+10, theRobit.posY+10, theRobit.posZ+10));
|
||||
List items = theRobit.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(theRobit.posX-10, theRobit.posY-10, theRobit.posZ-10, theRobit.posX+10, theRobit.posY+10, theRobit.posZ+10));
|
||||
Iterator iter = items.iterator();
|
||||
//Cached for slight performance
|
||||
double closestDistance=-1;
|
||||
double closestDistance = -1;
|
||||
|
||||
while(iter.hasNext())
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ public class RobitAIPickup extends EntityAIBase
|
|||
@Override
|
||||
public boolean continueExecuting()
|
||||
{
|
||||
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.getWorldObj().provider.dimensionId == theRobit.getWorldObj().provider.dimensionId;
|
||||
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -139,7 +139,7 @@ public class RobitAIPickup extends EntityAIBase
|
|||
{
|
||||
for(int i1 = 0; i1 <= 4; ++i1)
|
||||
{
|
||||
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.doesBlockHaveSolidTopSurface(x + l, z - 1, y + i1) && !theWorld.isBlockNormalCube(x + l, z, y + i1) && !theWorld.isBlockNormalCube(x + l, z + 1, y + i1))
|
||||
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.doesBlockHaveSolidTopSurface(theWorld, x + l, z - 1, y + i1) && !theWorld.getBlock(x + l, z, y + i1).isNormalCube() && !theWorld.getBlock(x + l, z + 1, y + i1).isNormalCube())
|
||||
{
|
||||
theRobit.setLocationAndAngles((x + l) + 0.5F, z, (y + i1) + 0.5F, theRobit.rotationYaw, theRobit.rotationPitch);
|
||||
thePathfinder.clearPathEntity();
|
||||
|
|
|
@ -12,9 +12,9 @@ import java.util.Map;
|
|||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -92,7 +92,7 @@ public final class MekanismHooks
|
|||
try {
|
||||
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotOsmium"), null, new ItemStack(Mekanism.Dust, 1, 2));
|
||||
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedObsidian"), null, new ItemStack(Mekanism.Dust, 1, 3));
|
||||
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedGlowstone"), null, new ItemStack(Items.glowstone));
|
||||
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedGlowstone"), null, new ItemStack(Items.glowstone_dust));
|
||||
Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotSteel"), null, new ItemStack(Mekanism.Dust, 1, 5));
|
||||
} catch(Exception e) {}
|
||||
|
||||
|
|
|
@ -17,13 +17,11 @@ import mekanism.common.recipe.RecipeHandler;
|
|||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StackUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
@ -39,7 +37,7 @@ public final class OreDictManager
|
|||
{
|
||||
if(ore.getHasSubtypes())
|
||||
{
|
||||
ItemStack wildStack = new ItemStack(ore.itemID, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack wildStack = new ItemStack(ore.getItem(), 1, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
if(!Recipe.PRECISION_SAWMILL.containsRecipe(wildStack))
|
||||
{
|
||||
|
@ -344,7 +342,7 @@ public final class OreDictManager
|
|||
|
||||
for(ItemStack ore : OreDictionary.getOres("ingotRefinedGlowstone"))
|
||||
{
|
||||
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.glowstone));
|
||||
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.glowstone_dust));
|
||||
}
|
||||
|
||||
for(ItemStack ore : OreDictionary.getOres("ingotNickel"))
|
||||
|
@ -364,11 +362,11 @@ public final class OreDictManager
|
|||
} catch(Exception e) {}
|
||||
|
||||
try {
|
||||
FurnaceRecipes.smelting().addSmelting(Mekanism.Dust.itemID, 8, MekanismUtils.size(OreDictionary.getOres("ingotSilver").get(0), 1), 0.0F);
|
||||
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Mekanism.Dust, 8), MekanismUtils.size(OreDictionary.getOres("ingotSilver").get(0), 1), 0.0F);
|
||||
} catch(Exception e) {}
|
||||
|
||||
try {
|
||||
FurnaceRecipes.smelting().addSmelting(Mekanism.Dust.itemID, 9, MekanismUtils.size(OreDictionary.getOres("ingotLead").get(0), 1), 0.0F);
|
||||
FurnaceRecipes.smelting().func_151394_a(new ItemStack(Mekanism.Dust, 9), MekanismUtils.size(OreDictionary.getOres("ingotLead").get(0), 1), 0.0F);
|
||||
} catch(Exception e) {}
|
||||
|
||||
try {
|
||||
|
@ -388,7 +386,7 @@ public final class OreDictManager
|
|||
|
||||
for(ItemStack ore : OreDictionary.getOres("dustIron"))
|
||||
{
|
||||
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.oreIron));
|
||||
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.iron_ore));
|
||||
}
|
||||
|
||||
for(ItemStack ore : OreDictionary.getOres("ingotSteel"))
|
||||
|
@ -398,7 +396,7 @@ public final class OreDictManager
|
|||
|
||||
for(ItemStack ore : OreDictionary.getOres("dustGold"))
|
||||
{
|
||||
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.oreGold));
|
||||
RecipeHandler.addCombinerRecipe(MekanismUtils.size(ore, 8), new ItemStack(Blocks.gold_ore));
|
||||
}
|
||||
|
||||
for(ItemStack ore : OreDictionary.getOres("dustLapisLazuli"))
|
||||
|
@ -495,7 +493,7 @@ public final class OreDictManager
|
|||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
ItemStack log = new ItemStack(logEntry.itemID, 1, j);
|
||||
ItemStack log = new ItemStack(logEntry.getItem(), 1, j);
|
||||
tempCrafting.setInventorySlotContents(0, log);
|
||||
ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ import mekanism.common.tile.TileEntityEnergyCube;
|
|||
import mekanism.common.util.ChargeUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerEnergyCube extends Container
|
||||
|
@ -69,7 +69,7 @@ public class ContainerEnergyCube extends Container
|
|||
|
||||
if(ChargeUtils.canBeCharged(slotStack) || ChargeUtils.canBeDischarged(slotStack))
|
||||
{
|
||||
if(slotStack.itemID == Items.redstone.itemID)
|
||||
if(slotStack.getItem() == Items.redstone)
|
||||
{
|
||||
if(slotID != 1)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ItemBlockBasic extends ItemBlock
|
|||
@Override
|
||||
public int getItemStackLimit(ItemStack stack)
|
||||
{
|
||||
if(itemID == Mekanism.basicBlockID)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
|
||||
{
|
||||
if(stack.getItemDamage() == 6)
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ public class ItemBlockBasic extends ItemBlock
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
if(itemID == Mekanism.basicBlockID && itemstack.getItemDamage() == 6)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock && itemstack.getItemDamage() == 6)
|
||||
{
|
||||
InventoryBin inv = new InventoryBin(itemstack);
|
||||
|
||||
|
@ -94,15 +94,15 @@ public class ItemBlockBasic extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem()
|
||||
public boolean hasContainerItem(ItemStack stack)
|
||||
{
|
||||
return true; //TODO forge PR
|
||||
return stack.getItemDamage() == 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack)
|
||||
{
|
||||
if(itemID == Mekanism.basicBlockID)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
|
||||
{
|
||||
if(stack.getItemDamage() != 6)
|
||||
{
|
||||
|
@ -119,9 +119,9 @@ public class ItemBlockBasic extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItemStack(ItemStack stack)
|
||||
public ItemStack getContainerItem(ItemStack stack)
|
||||
{
|
||||
if(itemID == Mekanism.basicBlockID)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
|
||||
{
|
||||
if(stack.getItemDamage() != 6 || stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount"))
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ public class ItemBlockBasic extends ItemBlock
|
|||
|
||||
if(place)
|
||||
{
|
||||
if(itemID == Mekanism.basicBlockID)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
|
||||
{
|
||||
if(stack.getItemDamage() == 6 && stack.stackTagCompound != null)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ public class ItemBlockBasic extends ItemBlock
|
|||
{
|
||||
String name = "";
|
||||
|
||||
if(itemID == Mekanism.basicBlockID)
|
||||
if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
|
||||
{
|
||||
switch(itemstack.getItemDamage())
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ public class ItemBlockBasic extends ItemBlock
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if(itemID == Mekanism.basicBlock2ID)
|
||||
else if(Block.getBlockFromItem(this) == Mekanism.BasicBlock2)
|
||||
{
|
||||
switch(itemstack.getItemDamage())
|
||||
{
|
||||
|
|
|
@ -129,18 +129,6 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChargedItemId(ItemStack itemStack)
|
||||
{
|
||||
return itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEmptyItemId(ItemStack itemStack)
|
||||
{
|
||||
return itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
|
|
|
@ -344,18 +344,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChargedItemId(ItemStack itemStack)
|
||||
{
|
||||
return itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEmptyItemId(ItemStack itemStack)
|
||||
{
|
||||
return itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack)
|
||||
{
|
||||
|
@ -803,7 +791,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack)
|
||||
{
|
||||
return MekanismUtils.getMaxEnergy(getEnergyMultiplier(itemStack), MachineType.get(itemStack.itemID, itemStack.getItemDamage()).baseEnergy);
|
||||
return MekanismUtils.getMaxEnergy(getEnergyMultiplier(itemStack), MachineType.get(Block.getBlockFromItem(itemStack.getItem()), itemStack.getItemDamage()).baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ItemBlockPlastic extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemDisplayName(ItemStack stack)
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
EnumColor colour = EnumColor.DYES[stack.getItemDamage()&15];
|
||||
String colourName;
|
||||
|
@ -45,7 +45,7 @@ public class ItemBlockPlastic extends ItemBlock
|
|||
colourName = colour.getDyedName();
|
||||
}
|
||||
|
||||
return colourName + " " + super.getItemDisplayName(stack);
|
||||
return colourName + " " + super.getItemStackDisplayName(stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
|
|||
|
||||
if(!player.isSneaking())
|
||||
{
|
||||
player.sendChatToPlayer(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
|
||||
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + config.getSideData().get(config.getConfiguration()[MekanismUtils.getBaseOrientation(side, config.getOrientation())]).color.getName()));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
@ -139,7 +139,7 @@ public class ItemConfigurator extends ItemEnergized implements IToolWrench
|
|||
}
|
||||
|
||||
slotStack.stackSize -= j;
|
||||
EntityItem item = new EntityItem(world, x + xRandom, y + yRandom, z + zRandom, new ItemStack(slotStack.itemID, j, slotStack.getItemDamage()));
|
||||
EntityItem item = new EntityItem(world, x + xRandom, y + yRandom, z + zRandom, new ItemStack(slotStack.getItem(), j, slotStack.getItemDamage()));
|
||||
|
||||
if(slotStack.hasTagCompound())
|
||||
{
|
||||
|
|
|
@ -4,8 +4,10 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import mekanism.api.ListUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
@ -34,7 +36,7 @@ public class MItemStackFilter extends MinerFilter
|
|||
return false;
|
||||
}
|
||||
|
||||
if(itemStack.itemID == itemType.itemID && metaIgnoreArray.contains(itemType.itemID))
|
||||
if(itemStack.getItem() == itemType.getItem() && metaIgnoreArray.contains(Block.getBlockFromItem(itemType.getItem())))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -62,7 +64,7 @@ public class MItemStackFilter extends MinerFilter
|
|||
{
|
||||
data.add(0);
|
||||
|
||||
data.add(itemType.itemID);
|
||||
data.add(MekanismUtils.getID(itemType));
|
||||
data.add(itemType.stackSize);
|
||||
data.add(itemType.getItemDamage());
|
||||
}
|
||||
|
@ -70,14 +72,14 @@ public class MItemStackFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(ByteArrayDataInput dataStream)
|
||||
{
|
||||
itemType = new ItemStack(dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
|
||||
itemType = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int code = 1;
|
||||
code = 31 * code + itemType.itemID;
|
||||
code = 31 * code + MekanismUtils.getID(itemType);
|
||||
code = 31 * code + itemType.stackSize;
|
||||
code = 31 * code + itemType.getItemDamage();
|
||||
return code;
|
||||
|
|
|
@ -3,8 +3,10 @@ package mekanism.common.miner;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.common.transporter.Finder.MaterialFinder;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -17,7 +19,7 @@ public class MMaterialFilter extends MinerFilter
|
|||
|
||||
public Material getMaterial()
|
||||
{
|
||||
return Blocks.blocksList[materialItem.itemID].getMaterial();
|
||||
return Block.getBlockFromItem(materialItem.getItem()).getMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,7 +53,7 @@ public class MMaterialFilter extends MinerFilter
|
|||
{
|
||||
data.add(2);
|
||||
|
||||
data.add(materialItem.itemID);
|
||||
data.add(MekanismUtils.getID(materialItem));
|
||||
data.add(materialItem.stackSize);
|
||||
data.add(materialItem.getItemDamage());
|
||||
}
|
||||
|
@ -59,14 +61,14 @@ public class MMaterialFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(ByteArrayDataInput dataStream)
|
||||
{
|
||||
materialItem = new ItemStack(dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
|
||||
materialItem = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int code = 1;
|
||||
code = 31 * code + materialItem.itemID;
|
||||
code = 31 * code + MekanismUtils.getID(materialItem);
|
||||
code = 31 * code + materialItem.stackSize;
|
||||
code = 31 * code + materialItem.getItemDamage();
|
||||
return code;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class ThreadMinerSearch extends Thread
|
|||
Coord4D coord = tileEntity.getStartingCoord();
|
||||
int diameter = tileEntity.getDiameter();
|
||||
int size = tileEntity.getTotalSize();
|
||||
ItemInfo info = new ItemInfo(0, 0);
|
||||
ItemInfo info = new ItemInfo(null, 0);
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
|
@ -68,8 +68,9 @@ public class ThreadMinerSearch extends Thread
|
|||
}
|
||||
|
||||
TileEntity bte;
|
||||
if ((bte = tileEntity.getWorldObj().getTileEntity(x, y, z)) != null && bte instanceof IBoundingBlock)
|
||||
{
|
||||
|
||||
if((bte = tileEntity.getWorldObj().getTileEntity(x, y, z)) != null && bte instanceof IBoundingBlock)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
package mekanism.common.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
import mekanism.api.ItemInfo;
|
||||
import mekanism.api.MekanismAPI;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
public class PacketBoxBlacklist extends MekanismPacket
|
||||
{
|
||||
|
@ -21,7 +23,7 @@ public class PacketBoxBlacklist extends MekanismPacket
|
|||
|
||||
for(int i = 0; i < amount; i++)
|
||||
{
|
||||
MekanismAPI.addBoxBlacklist(dataStream.readInt(), dataStream.readInt());
|
||||
MekanismAPI.addBoxBlacklist(Block.getBlockById(dataStream.readInt()), dataStream.readInt());
|
||||
}
|
||||
|
||||
System.out.println("[Mekanism] Received Cardboard Box blacklist entries from server (" + amount + " total)");
|
||||
|
@ -33,7 +35,7 @@ public class PacketBoxBlacklist extends MekanismPacket
|
|||
|
||||
for(ItemInfo info : MekanismAPI.getBoxIgnore())
|
||||
{
|
||||
dataStream.writeInt(info.id);
|
||||
dataStream.writeInt(Block.getIdFromBlock(info.block));
|
||||
dataStream.writeInt(info.meta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ public class PacketDigitalMinerGui extends MekanismPacket
|
|||
container = new ContainerFilter(playerMP.inventory, (TileEntityContainerBlock)obj.getTileEntity(world));
|
||||
}
|
||||
|
||||
playerMP.incrementWindowID();
|
||||
playerMP.getNextWindowId();
|
||||
int window = playerMP.currentWindowId;
|
||||
|
||||
if(t == MinerGuiPacket.SERVER)
|
||||
|
|
|
@ -128,7 +128,7 @@ public class PacketLogisticalSorterGui extends MekanismPacket
|
|||
container = new ContainerFilter(playerMP.inventory, (TileEntityContainerBlock)obj.getTileEntity(world));
|
||||
}
|
||||
|
||||
playerMP.incrementWindowID();
|
||||
playerMP.getNextWindowId();
|
||||
int window = playerMP.currentWindowId;
|
||||
|
||||
if(t == SorterGuiPacket.SERVER)
|
||||
|
|
|
@ -50,42 +50,43 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* packets have been registered or if the registry already contains
|
||||
* this packet
|
||||
*/
|
||||
public boolean registerPacket (Class<? extends MekanismPacket> clazz)
|
||||
public boolean registerPacket(Class<? extends MekanismPacket> clazz)
|
||||
{
|
||||
if (this.packets.size() > 256)
|
||||
if(packets.size() > 256)
|
||||
{
|
||||
// You should log here!!
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.packets.contains(clazz))
|
||||
if(packets.contains(clazz))
|
||||
{
|
||||
// You should log here!!
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isPostInitialised)
|
||||
if(isPostInitialised)
|
||||
{
|
||||
// You should log here!!
|
||||
return false;
|
||||
}
|
||||
|
||||
this.packets.add(clazz);
|
||||
packets.add(clazz);
|
||||
return true;
|
||||
}
|
||||
|
||||
// In line encoding of the packet, including discriminator setting
|
||||
@Override
|
||||
protected void encode (ChannelHandlerContext ctx, MekanismPacket msg, List<Object> out) throws Exception
|
||||
protected void encode(ChannelHandlerContext ctx, MekanismPacket msg, List<Object> out) throws Exception
|
||||
{
|
||||
ByteBuf buffer = Unpooled.buffer();
|
||||
Class<? extends MekanismPacket> clazz = msg.getClass();
|
||||
if (!this.packets.contains(msg.getClass()))
|
||||
|
||||
if(!packets.contains(msg.getClass()))
|
||||
{
|
||||
throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName());
|
||||
}
|
||||
|
||||
byte discriminator = (byte) this.packets.indexOf(clazz);
|
||||
byte discriminator =(byte) packets.indexOf(clazz);
|
||||
buffer.writeByte(discriminator);
|
||||
msg.encodeInto(ctx, buffer);
|
||||
FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
|
||||
|
@ -94,12 +95,12 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
|
||||
// In line decoding and handling of the packet
|
||||
@Override
|
||||
protected void decode (ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception
|
||||
protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception
|
||||
{
|
||||
ByteBuf payload = msg.payload();
|
||||
byte discriminator = payload.readByte();
|
||||
Class<? extends MekanismPacket> clazz = this.packets.get(discriminator);
|
||||
if (clazz == null)
|
||||
Class<? extends MekanismPacket> clazz = packets.get(discriminator);
|
||||
if(clazz == null)
|
||||
{
|
||||
throw new NullPointerException("No packet registered for discriminator: " + discriminator);
|
||||
}
|
||||
|
@ -108,33 +109,32 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
pkt.decodeInto(ctx, payload.slice());
|
||||
|
||||
EntityPlayer player;
|
||||
switch (FMLCommonHandler.instance().getEffectiveSide())
|
||||
|
||||
switch(FMLCommonHandler.instance().getEffectiveSide())
|
||||
{
|
||||
case CLIENT:
|
||||
player = this.getClientPlayer();
|
||||
player = getClientPlayer();
|
||||
pkt.handleClientSide(player);
|
||||
break;
|
||||
|
||||
case SERVER:
|
||||
INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
|
||||
player = ((NetHandlerPlayServer) netHandler).playerEntity;
|
||||
player =((NetHandlerPlayServer) netHandler).playerEntity;
|
||||
pkt.handleServerSide(player);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
out.add(pkt);
|
||||
}
|
||||
|
||||
// Method to call from FMLInitializationEvent
|
||||
public void initalise ()
|
||||
public void initalise()
|
||||
{
|
||||
this.channels = NetworkRegistry.INSTANCE.newChannel("Mekanism", this);
|
||||
channels = NetworkRegistry.INSTANCE.newChannel("Mekanism", this);
|
||||
registerPackets();
|
||||
}
|
||||
|
||||
public void registerPackets ()
|
||||
public void registerPackets()
|
||||
{
|
||||
//Packet registrations
|
||||
registerPacket(PacketRobit.class);
|
||||
|
@ -168,22 +168,21 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
// Method to call from FMLPostInitializationEvent
|
||||
// Ensures that packet discriminators are common between server and client
|
||||
// by using logical sorting
|
||||
public void postInitialise ()
|
||||
public void postInitialise()
|
||||
{
|
||||
if (this.isPostInitialised)
|
||||
if(isPostInitialised)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.isPostInitialised = true;
|
||||
Collections.sort(this.packets, new Comparator<Class<? extends MekanismPacket>>()
|
||||
{
|
||||
|
||||
isPostInitialised = true;
|
||||
Collections.sort(packets, new Comparator<Class<? extends MekanismPacket>>() {
|
||||
@Override
|
||||
public int compare (Class<? extends MekanismPacket> clazz1, Class<? extends MekanismPacket> clazz2)
|
||||
public int compare(Class<? extends MekanismPacket> clazz1, Class<? extends MekanismPacket> clazz2)
|
||||
{
|
||||
int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
|
||||
if (com == 0)
|
||||
|
||||
if(com == 0)
|
||||
{
|
||||
com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
|
||||
}
|
||||
|
@ -194,7 +193,7 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private EntityPlayer getClientPlayer ()
|
||||
private EntityPlayer getClientPlayer()
|
||||
{
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
@ -208,10 +207,10 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* @param message
|
||||
* The message to send
|
||||
*/
|
||||
public void sendToAll (MekanismPacket message)
|
||||
public void sendToAll(MekanismPacket message)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
|
||||
channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,11 +224,11 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* @param player
|
||||
* The player to send it to
|
||||
*/
|
||||
public void sendTo (MekanismPacket message, EntityPlayerMP player)
|
||||
public void sendTo(MekanismPacket message, EntityPlayerMP player)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
|
||||
channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -245,11 +244,11 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint}
|
||||
* around which to send
|
||||
*/
|
||||
public void sendToAllAround (MekanismPacket message, NetworkRegistry.TargetPoint point)
|
||||
public void sendToAllAround(MekanismPacket message, NetworkRegistry.TargetPoint point)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
|
||||
channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -263,11 +262,11 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* @param dimensionId
|
||||
* The dimension id to target
|
||||
*/
|
||||
public void sendToDimension (MekanismPacket message, int dimensionId)
|
||||
public void sendToDimension(MekanismPacket message, int dimensionId)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId);
|
||||
this.channels.get(Side.SERVER).writeAndFlush(message);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId);
|
||||
channels.get(Side.SERVER).writeAndFlush(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,9 +278,9 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Mekani
|
|||
* @param message
|
||||
* The message to send
|
||||
*/
|
||||
public void sendToServer (MekanismPacket message)
|
||||
public void sendToServer(MekanismPacket message)
|
||||
{
|
||||
this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
|
||||
this.channels.get(Side.CLIENT).writeAndFlush(message);
|
||||
channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
|
||||
channels.get(Side.CLIENT).writeAndFlush(message);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package mekanism.common.network;
|
|||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.ObfuscatedNames;
|
||||
import mekanism.common.Teleporter;
|
||||
import mekanism.common.item.ItemPortableTeleporter;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
|
@ -9,12 +10,13 @@ import mekanism.common.util.MekanismUtils;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class PacketPortableTeleport extends MekanismPacket
|
||||
|
@ -45,7 +47,7 @@ public class PacketPortableTeleport extends MekanismPacket
|
|||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
((EntityPlayerMP)player).playerNetServerHandler.ticksForFloatKick = 0;
|
||||
MekanismUtils.setPrivateValue(((EntityPlayerMP)player).playerNetServerHandler, 0, NetHandlerPlayServer.class, ObfuscatedNames.NetHandlerPlayServer_floatingTickCount);
|
||||
}
|
||||
|
||||
if(world.provider.dimensionId != coords.dimensionId)
|
||||
|
|
|
@ -58,7 +58,7 @@ public class PacketSimpleGui extends MekanismPacket
|
|||
public static void openServerGui(int id, EntityPlayerMP playerMP, World world, Coord4D obj)
|
||||
{
|
||||
playerMP.closeContainer();
|
||||
playerMP.incrementWindowID();
|
||||
playerMP.getNextWindowId();
|
||||
|
||||
int window = playerMP.currentWindowId;
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ public class MekanismRecipe implements IRecipe
|
|||
return true;
|
||||
}
|
||||
|
||||
if(target.itemID != input.itemID)
|
||||
if(target.getItem() != input.getItem())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -353,7 +353,7 @@ public class TankUpdateProtocol
|
|||
*/
|
||||
private boolean isValidFrame(int x, int y, int z)
|
||||
{
|
||||
return pointer.getWorldObj().getBlockId(x, y, z) == Mekanism.basicBlockID && pointer.getWorldObj().getBlockMetadata(x, y, z) == 9;
|
||||
return pointer.getWorldObj().getBlock(x, y, z) == Mekanism.BasicBlock && pointer.getWorldObj().getBlockMetadata(x, y, z) == 9;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,25 +81,25 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
public String getInventoryName()
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return getInv().getInvName();
|
||||
return getInv().getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized()
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInv().isInvNameLocalized();
|
||||
return getInv().hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -184,7 +184,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
}
|
||||
else if(slotID == 4)
|
||||
{
|
||||
return itemstack.itemID == Mekanism.SpeedUpgrade.itemID || itemstack.itemID == Mekanism.EnergyUpgrade.itemID;
|
||||
return itemstack.getItem() == Mekanism.SpeedUpgrade || itemstack.getItem() == Mekanism.EnergyUpgrade;
|
||||
}
|
||||
else if(slotID == 0)
|
||||
{
|
||||
|
|
|
@ -90,7 +90,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
|||
if(clientFacing != facing)
|
||||
{
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
clientFacing = facing;
|
||||
}
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,7 @@ import mekanism.api.Coord4D;
|
|||
import mekanism.common.IActiveState;
|
||||
import mekanism.common.IConfigurable;
|
||||
import mekanism.common.ILogisticalTransporter;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
import mekanism.common.network.PacketTileEntity;
|
||||
import mekanism.common.transporter.TransporterManager;
|
||||
|
@ -17,6 +17,7 @@ import mekanism.common.util.TransporterUtils;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -269,7 +270,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
|||
|
||||
if(getItemCount() > 0)
|
||||
{
|
||||
data.add(itemType.itemID);
|
||||
data.add(MekanismUtils.getID(itemType));
|
||||
data.add(itemType.getItemDamage());
|
||||
}
|
||||
|
||||
|
@ -286,7 +287,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
|||
|
||||
if(clientAmount > 0)
|
||||
{
|
||||
itemType = new ItemStack(dataStream.readInt(), 1, dataStream.readInt());
|
||||
itemType = new ItemStack(Item.getItemById(dataStream.readInt()), 1, dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
itemType = null;
|
||||
|
@ -416,13 +417,13 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
public String getInventoryName()
|
||||
{
|
||||
return MekanismUtils.localize("tile.BasicBlock.Bin.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized()
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public abstract class TileEntityChanceMachine extends TileEntityBasicMachine
|
|||
{
|
||||
if(slotID == 3)
|
||||
{
|
||||
return itemstack.itemID == Mekanism.SpeedUpgrade.itemID || itemstack.itemID == Mekanism.EnergyUpgrade.itemID;
|
||||
return itemstack.getItem() == Mekanism.SpeedUpgrade || itemstack.getItem() == Mekanism.EnergyUpgrade;
|
||||
}
|
||||
else if(slotID == 0)
|
||||
{
|
||||
|
|
|
@ -14,8 +14,8 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectricMachine implements IGasHandler, ITubeConnection
|
||||
|
@ -35,7 +35,7 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr
|
|||
public GasStack getItemGas(ItemStack itemstack)
|
||||
{
|
||||
if(MekanismUtils.getOreDictName(itemstack).contains("dustSulfur")) return new GasStack(GasRegistry.getGas("sulfuricAcid"), 2);
|
||||
if(itemstack.itemID == Mekanism.GasTank.blockID && ((IGasItem)itemstack.getItem()).getGas(itemstack) != null &&
|
||||
if(Block.getBlockFromItem(itemstack.getItem()) == Mekanism.GasTank && ((IGasItem)itemstack.getItem()).getGas(itemstack) != null &&
|
||||
isValidGas(((IGasItem)itemstack.getItem()).getGas(itemstack).getGas())) return new GasStack(GasRegistry.getGas("sulfuricAcid"), 1);
|
||||
|
||||
return null;
|
||||
|
|
|
@ -181,7 +181,7 @@ public class TileEntityChemicalWasher extends TileEntityElectricBlock implements
|
|||
return;
|
||||
}
|
||||
|
||||
ItemStack containerItem = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
ItemStack containerItem = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
|
||||
boolean filled = false;
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
|
|||
@Override
|
||||
public GasStack getItemGas(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.getItem() instanceof ItemBlock && itemstack.itemID == Blocks.cobblestone.blockID)
|
||||
if(itemstack.getItem() instanceof ItemBlock && Block.getBlockFromItem(itemstack.getItem()) == Blocks.cobblestone)
|
||||
{
|
||||
return new GasStack(GasRegistry.getGas("liquidStone"), 200);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
@ -296,11 +297,11 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
|
||||
if(stack != null)
|
||||
{
|
||||
worldObj.setBlock(obj.xCoord, obj.yCoord, obj.zCoord, replaceStack.itemID, replaceStack.getItemDamage(), 3);
|
||||
worldObj.setBlock(obj.xCoord, obj.yCoord, obj.zCoord, Block.getBlockFromItem(replaceStack.getItem()), replaceStack.getItemDamage(), 3);
|
||||
|
||||
if(Blocks.blocksList[obj.getBlockId(worldObj)] != null && !Blocks.blocksList[obj.getBlockId(worldObj)].canBlockStay(worldObj, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
if(obj.getBlock(worldObj) != null && !obj.getBlock(worldObj).canBlockStay(worldObj, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
{
|
||||
Blocks.blocksList[obj.getBlockId(worldObj)].dropBlockAsItem(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, obj.getMetadata(worldObj), 1);
|
||||
obj.getBlock(worldObj).dropBlockAsItem(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, obj.getMetadata(worldObj), 1);
|
||||
worldObj.setBlockToAir(obj.xCoord, obj.yCoord, obj.zCoord);
|
||||
}
|
||||
}
|
||||
|
@ -763,7 +764,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
if(replaceStack != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(replaceStack.itemID);
|
||||
data.add(MekanismUtils.getID(replaceStack));
|
||||
data.add(replaceStack.getItemDamage());
|
||||
}
|
||||
else {
|
||||
|
@ -831,7 +832,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
if(replaceStack != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(replaceStack.itemID);
|
||||
data.add(MekanismUtils.getID(replaceStack));
|
||||
data.add(replaceStack.getItemDamage());
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -97,7 +97,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
else if(slotID == 3)
|
||||
{
|
||||
return itemstack.itemID == Mekanism.SpeedUpgrade.itemID || itemstack.itemID == Mekanism.EnergyUpgrade.itemID;
|
||||
return itemstack.getItem() == Mekanism.SpeedUpgrade || itemstack.getItem() == Mekanism.EnergyUpgrade;
|
||||
}
|
||||
else if(slotID == 0)
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
|
||||
if(inventory[0].getItem().hasContainerItem())
|
||||
{
|
||||
inventory[0] = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
inventory[0] = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
}
|
||||
else {
|
||||
inventory[0].stackSize--;
|
||||
|
@ -503,7 +503,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
public String getInventoryName()
|
||||
{
|
||||
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + "." + tier.name + ".name");
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -677,7 +677,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -220,7 +220,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
}
|
||||
else if(slotID == 0)
|
||||
{
|
||||
return itemstack.itemID == Mekanism.SpeedUpgrade.itemID || itemstack.itemID == Mekanism.EnergyUpgrade.itemID;
|
||||
return itemstack.getItem() == Mekanism.SpeedUpgrade || itemstack.getItem() == Mekanism.EnergyUpgrade;
|
||||
}
|
||||
else if(slotID == 2)
|
||||
{
|
||||
|
@ -437,7 +437,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -324,7 +324,7 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getInvName()
|
||||
public String getInventoryName()
|
||||
{
|
||||
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + "." + fullName + ".short.name");
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ import mekanism.client.gui.GuiProgress.ProgressBar;
|
|||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine implements IGasHandler, ITubeConnection
|
||||
|
@ -35,7 +35,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
|
|||
public GasStack getItemGas(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.isItemEqual(new ItemStack(Items.flint))) return new GasStack(GasRegistry.getGas("oxygen"), 10);
|
||||
if(itemstack.itemID == Mekanism.GasTank.blockID && ((IGasItem)itemstack.getItem()).getGas(itemstack) != null &&
|
||||
if(Block.getBlockFromItem(itemstack.getItem()) == Mekanism.GasTank && ((IGasItem)itemstack.getItem()).getGas(itemstack) != null &&
|
||||
((IGasItem)itemstack.getItem()).getGas(itemstack).getGas() == GasRegistry.getGas("oxygen")) return new GasStack(GasRegistry.getGas("oxygen"), 1);
|
||||
|
||||
return null;
|
||||
|
|
|
@ -187,7 +187,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
return;
|
||||
}
|
||||
|
||||
ItemStack containerItem = inventory[2].getItem().getContainerItemStack(inventory[2]);
|
||||
ItemStack containerItem = inventory[2].getItem().getContainerItem(inventory[2]);
|
||||
|
||||
boolean filled = false;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.network.PacketTileEntity;
|
||||
import mekanism.common.tank.TankUpdateProtocol;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -130,9 +131,9 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(int id)
|
||||
public void onNeighborChange(Block block)
|
||||
{
|
||||
super.onNeighborChange(id);
|
||||
super.onNeighborChange(block);
|
||||
|
||||
refresh(false);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mekanism.common.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntitySalinationTank extends TileEntityContainerBlock
|
||||
{
|
||||
|
@ -46,9 +46,9 @@ public class TileEntitySalinationTank extends TileEntityContainerBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(int id)
|
||||
public void onNeighborChange(Block block)
|
||||
{
|
||||
super.onNeighborChange(id);
|
||||
super.onNeighborChange(block);
|
||||
|
||||
if(master != null)
|
||||
{
|
||||
|
|
|
@ -334,9 +334,9 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
|||
{
|
||||
WorldServer world = server.worldServerForDimension(coord.dimensionId);
|
||||
|
||||
if(entity.getWorldObj().provider.dimensionId != coord.dimensionId)
|
||||
if(entity.worldObj.provider.dimensionId != coord.dimensionId)
|
||||
{
|
||||
entity.getWorldObj().removeEntity(entity);
|
||||
entity.worldObj.removeEntity(entity);
|
||||
entity.isDead = false;
|
||||
|
||||
world.spawnEntityInWorld(entity);
|
||||
|
@ -400,7 +400,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
|||
{
|
||||
int energyCost = 1000;
|
||||
|
||||
if(entity.getWorldObj().provider.dimensionId != coords.dimensionId)
|
||||
if(entity.worldObj.provider.dimensionId != coords.dimensionId)
|
||||
{
|
||||
energyCost+=10000;
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
|||
|
||||
public boolean isFrame(int x, int y, int z)
|
||||
{
|
||||
return worldObj.getBlockId(x, y, z) == Mekanism.basicBlockID && worldObj.getBlockMetadata(x, y, z) == 7;
|
||||
return worldObj.getBlock(x, y, z) == Mekanism.BasicBlock && worldObj.getBlockMetadata(x, y, z) == 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -523,7 +523,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -107,7 +107,7 @@ public abstract class Finder
|
|||
return false;
|
||||
}
|
||||
|
||||
return Blocks.blocksList[stack.itemID].getMaterial() == materialType;
|
||||
return Block.getBlockFromItem(stack.getItem()).getMaterial() == materialType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,9 @@ import java.util.ArrayList;
|
|||
|
||||
import mekanism.common.transporter.Finder.ItemStackFinder;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -33,7 +35,7 @@ public class TItemStackFilter extends TransporterFilter
|
|||
return false;
|
||||
}
|
||||
|
||||
return (itemType.getHasSubtypes() ? itemType.isItemEqual(itemStack) : itemType.itemID == itemStack.itemID) && (!sizeMode || itemStack.stackSize >= min);
|
||||
return (itemType.getHasSubtypes() ? itemType.isItemEqual(itemStack) : itemType.getItem() == itemStack.getItem()) && (!sizeMode || itemStack.stackSize >= min);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,7 +85,7 @@ public class TItemStackFilter extends TransporterFilter
|
|||
data.add(min);
|
||||
data.add(max);
|
||||
|
||||
data.add(itemType.itemID);
|
||||
data.add(MekanismUtils.getID(itemType));
|
||||
data.add(itemType.stackSize);
|
||||
data.add(itemType.getItemDamage());
|
||||
}
|
||||
|
@ -97,7 +99,7 @@ public class TItemStackFilter extends TransporterFilter
|
|||
min = dataStream.readInt();
|
||||
max = dataStream.readInt();
|
||||
|
||||
itemType = new ItemStack(dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
|
||||
itemType = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,7 +107,7 @@ public class TItemStackFilter extends TransporterFilter
|
|||
{
|
||||
int code = 1;
|
||||
code = 31 * code + super.hashCode();
|
||||
code = 31 * code + itemType.itemID;
|
||||
code = 31 * code + MekanismUtils.getID(itemType);
|
||||
code = 31 * code + itemType.stackSize;
|
||||
code = 31 * code + itemType.getItemDamage();
|
||||
code = 31 * code + (sizeMode ? 1 : 0);
|
||||
|
|
|
@ -3,12 +3,12 @@ package mekanism.common.transporter;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.common.transporter.Finder.MaterialFinder;
|
||||
import mekanism.common.transporter.Finder.OreDictFinder;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -22,7 +22,7 @@ public class TMaterialFilter extends TransporterFilter
|
|||
|
||||
public Material getMaterial()
|
||||
{
|
||||
return Blocks.blocksList[materialItem.itemID].getMaterial();
|
||||
return Block.getBlockFromItem(materialItem.getItem()).getMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class TMaterialFilter extends TransporterFilter
|
|||
|
||||
super.write(data);
|
||||
|
||||
data.add(materialItem.itemID);
|
||||
data.add(MekanismUtils.getID(materialItem));
|
||||
data.add(materialItem.stackSize);
|
||||
data.add(materialItem.getItemDamage());
|
||||
}
|
||||
|
@ -76,14 +76,14 @@ public class TMaterialFilter extends TransporterFilter
|
|||
{
|
||||
super.read(dataStream);
|
||||
|
||||
materialItem = new ItemStack(dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
|
||||
materialItem = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int code = 1;
|
||||
code = 31 * code + materialItem.itemID;
|
||||
code = 31 * code + MekanismUtils.getID(materialItem);
|
||||
code = 31 * code + materialItem.stackSize;
|
||||
code = 31 * code + materialItem.getItemDamage();
|
||||
return code;
|
||||
|
|
|
@ -8,7 +8,9 @@ import mekanism.api.EnumColor;
|
|||
import mekanism.common.ILogisticalTransporter;
|
||||
import mekanism.common.tile.TileEntityLogisticalSorter;
|
||||
import mekanism.common.transporter.TransporterPathfinder.Destination;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -60,7 +62,7 @@ public class TransporterStack
|
|||
|
||||
getPrev(tileEntity).write(data);
|
||||
|
||||
data.add(itemStack.itemID);
|
||||
data.add(MekanismUtils.getID(itemStack));
|
||||
data.add(itemStack.stackSize);
|
||||
data.add(itemStack.getItemDamage());
|
||||
}
|
||||
|
@ -87,7 +89,7 @@ public class TransporterStack
|
|||
|
||||
clientPrev = Coord4D.read(dataStream);
|
||||
|
||||
itemStack = new ItemStack(dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
|
||||
itemStack = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
public void write(NBTTagCompound nbtTags)
|
||||
|
|
|
@ -591,7 +591,7 @@ public final class MekanismUtils
|
|||
TileEntity tile = (TileEntity)config;
|
||||
Coord4D coord = Coord4D.get(tile).getFromSide(ForgeDirection.getOrientation(MekanismUtils.getBaseOrientation(side, config.getOrientation())));
|
||||
|
||||
tile.getWorldObj().notifyBlockOfNeighborChange(coord.xCoord, coord.yCoord, coord.zCoord, tile.getBlockType().blockID);
|
||||
tile.getWorldObj().notifyBlockOfNeighborChange(coord.xCoord, coord.yCoord, coord.zCoord, tile.getBlockType());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1245,19 +1245,19 @@ public final class MekanismUtils
|
|||
}
|
||||
}
|
||||
|
||||
if((dmgItems[0] == null) || (Items.itemsList[dmgItems[0].itemID] == null))
|
||||
if((dmgItems[0] == null) || (dmgItems[0].getItem() == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if((dmgItems[1] != null) && (dmgItems[0].itemID == dmgItems[1].itemID) && (dmgItems[0].stackSize == 1) && (dmgItems[1].stackSize == 1) && (Items.itemsList[dmgItems[0].itemID].isRepairable()))
|
||||
if((dmgItems[1] != null) && (dmgItems[0].getItem() == dmgItems[1].getItem()) && (dmgItems[0].stackSize == 1) && (dmgItems[1].stackSize == 1) && dmgItems[0].getItem().isRepairable())
|
||||
{
|
||||
Item theItem = Items.itemsList[dmgItems[0].itemID];
|
||||
Item theItem = dmgItems[0].getItem();
|
||||
int dmgDiff0 = theItem.getMaxDamage() - dmgItems[0].getItemDamageForDisplay();
|
||||
int dmgDiff1 = theItem.getMaxDamage() - dmgItems[1].getItemDamageForDisplay();
|
||||
int value = dmgDiff0 + dmgDiff1 + theItem.getMaxDamage() * 5 / 100;
|
||||
int solve = Math.max(0, theItem.getMaxDamage() - value);
|
||||
return new ItemStack(dmgItems[0].itemID, 1, solve);
|
||||
return new ItemStack(dmgItems[0].getItem(), 1, solve);
|
||||
}
|
||||
|
||||
for(IRecipe recipe : (List<IRecipe>)CraftingManager.getInstance().getRecipeList())
|
||||
|
@ -1289,14 +1289,14 @@ public final class MekanismUtils
|
|||
return false;
|
||||
}
|
||||
|
||||
public static Block getBlock(ItemStack itemStack)
|
||||
public static int getID(ItemStack itemStack)
|
||||
{
|
||||
if(itemStack == null)
|
||||
{
|
||||
return null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return Block.getBlockFromItem(itemStack.getItem());
|
||||
return Item.getIdFromItem(itemStack.getItem());
|
||||
}
|
||||
|
||||
public static enum ResourceType
|
||||
|
|
|
@ -12,18 +12,18 @@ import net.minecraft.world.World;
|
|||
|
||||
public final class MinerUtils
|
||||
{
|
||||
public static List<Integer> specialSilkIDs = ListUtils.asList(Blocks.ice.blockID);
|
||||
public static List<Block> specialSilkIDs = ListUtils.asList(Blocks.ice);
|
||||
|
||||
public static List<ItemStack> getDrops(World world, Coord4D obj, boolean silk)
|
||||
{
|
||||
Block block = Blocks.blocksList[obj.getBlockId(world)];
|
||||
Block block = obj.getBlock(world);
|
||||
|
||||
if(block == null)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
if(block.isAirBlock(world, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
if(block.isAir(world, obj.xCoord, obj.yCoord, obj.zCoord))
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ public final class MinerUtils
|
|||
}
|
||||
else {
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(new ItemStack(block.blockID, 1, meta));
|
||||
ret.add(new ItemStack(block, 1, meta));
|
||||
|
||||
if(specialSilkIDs.contains(block.blockID) || (block.getBlockDropped(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0) != null && block.getBlockDropped(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0).size() > 0))
|
||||
if(specialSilkIDs.contains(block) || (block.getBlockDropped(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0) != null && block.getBlockDropped(world, obj.xCoord, obj.yCoord, obj.zCoord, meta, 0).size() > 0))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ public final class StackUtils
|
|||
return false;
|
||||
}
|
||||
|
||||
return stack1.itemID != stack2.itemID || stack1.getItemDamage() != stack2.getItemDamage();
|
||||
return stack1.getItem() != stack2.getItem() || stack1.getItemDamage() != stack2.getItemDamage();
|
||||
}
|
||||
|
||||
public static boolean equalsWildcard(ItemStack wild, ItemStack check)
|
||||
{
|
||||
return wild.itemID == check.itemID && (wild.getItemDamage() == OreDictionary.WILDCARD_VALUE || wild.getItemDamage() == check.getItemDamage());
|
||||
return wild.getItem() == check.getItem() && (wild.getItemDamage() == OreDictionary.WILDCARD_VALUE || wild.getItemDamage() == check.getItemDamage());
|
||||
}
|
||||
|
||||
public static List<ItemStack> even(ItemStack stack1, ItemStack stack2)
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GuiBioGenerator extends GuiMekanism
|
|||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("gui.bioGenerator.bioFuel") + ": " + tileEntity.bioFuelSlot.fluidStored, 51, 35, 0x00CD00);
|
||||
|
|
|
@ -68,7 +68,7 @@ public class GuiHeatGenerator extends GuiMekanism
|
|||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public class GuiHydrogenGenerator extends GuiMekanism
|
|||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public class GuiSolarGenerator extends GuiMekanism
|
|||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), !tileEntity.fullName.contains("Advanced") ? 45 : 30, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), !tileEntity.fullName.contains("Advanced") ? 45 : 30, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("gui.solarGenerator.sun") + ": " + tileEntity.seesSun, 51, 35, 0x00CD00);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class GuiWindTurbine extends GuiMekanism
|
|||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("gui.power") + ": " + MekanismGenerators.windGeneration*tileEntity.getMultiplier(), 51, 35, 0x00CD00);
|
||||
|
|
|
@ -62,9 +62,9 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
|
|||
{
|
||||
bioFuelSlot.setFluid(bioFuelSlot.fluidStored+fluidToAdd);
|
||||
|
||||
if(inventory[0].getItem().getContainerItemStack(inventory[0]) != null)
|
||||
if(inventory[0].getItem().getContainerItem(inventory[0]) != null)
|
||||
{
|
||||
inventory[0] = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
inventory[0] = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
}
|
||||
else {
|
||||
inventory[0].stackSize--;
|
||||
|
@ -89,9 +89,9 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
|
|||
{
|
||||
bioFuelSlot.fluidStored += fuel;
|
||||
|
||||
if(inventory[0].getItem().getContainerItemStack(inventory[0]) != null)
|
||||
if(inventory[0].getItem().getContainerItem(inventory[0]) != null)
|
||||
{
|
||||
inventory[0] = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
inventory[0] = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
}
|
||||
else {
|
||||
inventory[0].stackSize--;
|
||||
|
@ -180,7 +180,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
|
|||
|
||||
public int getFuel(ItemStack itemstack)
|
||||
{
|
||||
return itemstack.itemID == Mekanism.BioFuel.itemID ? 200 : 0;
|
||||
return itemstack.getItem() == Mekanism.BioFuel ? 200 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -158,7 +158,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return getInvName();
|
||||
return getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,8 @@ import java.util.ArrayList;
|
|||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.generators.common.MekanismGenerators;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
@ -20,8 +21,8 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
import dan200.computercraft.api.lua.ILuaContext;
|
||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
|
||||
public class TileEntityHeatGenerator extends TileEntityGenerator implements IFluidHandler
|
||||
{
|
||||
|
@ -53,9 +54,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
|||
{
|
||||
lavaTank.fill(fluid, true);
|
||||
|
||||
if(inventory[0].getItem().getContainerItemStack(inventory[0]) != null)
|
||||
if(inventory[0].getItem().getContainerItem(inventory[0]) != null)
|
||||
{
|
||||
inventory[0] = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
inventory[0] = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
}
|
||||
else {
|
||||
inventory[0].stackSize--;
|
||||
|
@ -78,9 +79,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
|||
{
|
||||
lavaTank.fill(new FluidStack(FluidRegistry.LAVA, fuel), true);
|
||||
|
||||
if(inventory[0].getItem().getContainerItemStack(inventory[0]) != null)
|
||||
if(inventory[0].getItem().getContainerItem(inventory[0]) != null)
|
||||
{
|
||||
inventory[0] = inventory[0].getItem().getContainerItemStack(inventory[0]);
|
||||
inventory[0] = inventory[0].getItem().getContainerItem(inventory[0]);
|
||||
}
|
||||
else {
|
||||
inventory[0].stackSize--;
|
||||
|
@ -172,27 +173,32 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
|||
{
|
||||
int boost = 0;
|
||||
|
||||
if(worldObj.getBlockId(xCoord+1, yCoord, zCoord) == 10 || worldObj.getBlockId(xCoord+1, yCoord, zCoord) == 11)
|
||||
if(isLava(xCoord+1, yCoord, zCoord))
|
||||
boost+=5;
|
||||
if(worldObj.getBlockId(xCoord-1, yCoord, zCoord) == 10 || worldObj.getBlockId(xCoord-1, yCoord, zCoord) == 11)
|
||||
if(isLava(xCoord-1, yCoord, zCoord))
|
||||
boost+=5;
|
||||
if(worldObj.getBlockId(xCoord, yCoord+1, zCoord) == 10 || worldObj.getBlockId(xCoord, yCoord+1, zCoord) == 11)
|
||||
if(isLava(xCoord, yCoord+1, zCoord))
|
||||
boost+=5;
|
||||
if(worldObj.getBlockId(xCoord, yCoord-1, zCoord) == 10 || worldObj.getBlockId(xCoord, yCoord-1, zCoord) == 11)
|
||||
if(isLava(xCoord, yCoord-1, zCoord))
|
||||
boost+=5;
|
||||
if(worldObj.getBlockId(xCoord, yCoord, zCoord+1) == 10 || worldObj.getBlockId(xCoord, yCoord, zCoord+1) == 11)
|
||||
if(isLava(xCoord, yCoord, zCoord+1))
|
||||
boost+=5;
|
||||
if(worldObj.getBlockId(xCoord, yCoord, zCoord-1) == 10 || worldObj.getBlockId(xCoord, yCoord, zCoord-1) == 11)
|
||||
if(isLava(xCoord, yCoord, zCoord-1))
|
||||
boost+=5;
|
||||
if(worldObj.provider.dimensionId == -1)
|
||||
boost+=100;
|
||||
|
||||
return boost;
|
||||
}
|
||||
|
||||
private boolean isLava(int x, int y, int z)
|
||||
{
|
||||
return worldObj.getBlock(x, y, z) == Blocks.lava;
|
||||
}
|
||||
|
||||
public int getFuel(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.itemID == Items.bucketLava.itemID)
|
||||
if(itemstack.getItem() == Items.lava_bucket)
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue