Bit more stuff working before boarding the plane :)
This commit is contained in:
parent
c66dc875b4
commit
2ff0e1c74d
|
@ -214,6 +214,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
{
|
||||
// Set adjusted rotation
|
||||
int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z), 3);
|
||||
((TileEntityEE) world.getTileEntity(x, y, z)).setOrientation(world.getBlockMetadata(x, y, z));
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).setRotation(chalkSettings.getRotation(), facing);
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).setAlchemyArray(alchemyArray, chalkSettings.getSize());
|
||||
|
@ -227,7 +228,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && !entityPlayer.isSneaking())
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && !entityPlayer.isSneaking())
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockActivated(world, x, y, z, entityPlayer, sideHit, hitX, hitY, hitZ);
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityPlayer)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockClicked(world, x, y, z, entityPlayer);
|
||||
}
|
||||
|
@ -247,7 +248,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockDestroyedByExplosion(world, x, y, z, explosion);
|
||||
}
|
||||
|
@ -256,7 +257,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int metaData)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockDestroyedByPlayer(world, x, y, z, metaData);
|
||||
}
|
||||
|
@ -265,7 +266,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
}
|
||||
|
@ -274,7 +275,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
|
|||
@Override
|
||||
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onFallenUpon(world, x, y, z, entity, fallDistance);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.pahimar.ee3.tileentity.TileEntityEE;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -15,6 +16,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
@ -102,17 +104,93 @@ public class BlockDummyArray extends BlockEE implements ITileEntityProvider
|
|||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onBlockActivated(world, x, y, z, entityPlayer, sideHit, hitX, hitY, hitZ);
|
||||
tileEntityAlchemyArray.onBlockActivated(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, entityPlayer, sideHit, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityPlayer)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onBlockClicked(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, entityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onBlockDestroyedByExplosion(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, explosion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int metaData)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onBlockDestroyedByPlayer(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, metaData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onEntityCollidedWithBlock(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance)
|
||||
{
|
||||
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
|
||||
{
|
||||
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) world.getTileEntity(x, y, z);
|
||||
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
|
||||
|
||||
if (tileEntityAlchemyArray != null)
|
||||
{
|
||||
tileEntityAlchemyArray.onFallenUpon(world, x, y, z, tileEntityDummyArray.xCoord, tileEntityDummyArray.yCoord, tileEntityDummyArray.xCoord, entity, fallDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
package com.pahimar.ee3.client.handler;
|
||||
|
||||
import com.pahimar.ee3.EquivalentExchange3;
|
||||
import com.pahimar.ee3.api.AlchemyArray;
|
||||
import com.pahimar.ee3.array.AlchemyArrayRegistry;
|
||||
import com.pahimar.ee3.client.util.RenderUtils;
|
||||
import com.pahimar.ee3.item.*;
|
||||
import com.pahimar.ee3.reference.ToolMode;
|
||||
import com.pahimar.ee3.settings.ChalkSettings;
|
||||
import com.pahimar.ee3.tileentity.TileEntityAlchemyArray;
|
||||
import com.pahimar.ee3.tileentity.TileEntityDummyArray;
|
||||
import com.pahimar.ee3.tileentity.TileEntityEE;
|
||||
import com.pahimar.ee3.util.IModalTool;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
@ -11,8 +19,10 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
@ -49,7 +59,7 @@ public class DrawBlockHighlightEventHandler
|
|||
}
|
||||
else if (event.currentItem.getItem() instanceof ItemChalk)
|
||||
{
|
||||
// TODO Draw Overlay
|
||||
drawAlchemyArrayOverlay(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,6 +191,153 @@ public class DrawBlockHighlightEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
private void drawAlchemyArrayOverlay(DrawBlockHighlightEvent event)
|
||||
{
|
||||
ChalkSettings chalkSettings = EquivalentExchange3.proxy.getClientProxy().chalkSettings;
|
||||
AlchemyArray alchemyArray = AlchemyArrayRegistry.getInstance().getAlchemyArray(chalkSettings.getIndex());
|
||||
ResourceLocation texture = alchemyArray.getTexture();
|
||||
int rotation = chalkSettings.getRotation();
|
||||
|
||||
double x = event.target.blockX + 0.5F;
|
||||
double y = event.target.blockY + 0.5F;
|
||||
double z = event.target.blockZ + 0.5F;
|
||||
double iPX = event.player.prevPosX + (event.player.posX - event.player.prevPosX) * event.partialTicks;
|
||||
double iPY = event.player.prevPosY + (event.player.posY - event.player.prevPosY) * event.partialTicks;
|
||||
double iPZ = event.player.prevPosZ + (event.player.posZ - event.player.prevPosZ) * event.partialTicks;
|
||||
|
||||
float xScale, yScale, zScale;
|
||||
float xShift, yShift, zShift;
|
||||
float xRotate, yRotate, zRotate;
|
||||
int zCorrection = 1;
|
||||
int rotationAngle = 0;
|
||||
int playerFacing = MathHelper.floor_double(event.player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
int facingCorrectionAngle = 0;
|
||||
|
||||
xScale = yScale = zScale = 1;
|
||||
xShift = yShift = zShift = 0;
|
||||
xRotate = yRotate = zRotate = 0;
|
||||
|
||||
int chargeLevel = ((chalkSettings.getSize() - 1) * 2) + 1;
|
||||
|
||||
ForgeDirection sideHit = ForgeDirection.getOrientation(event.target.sideHit);
|
||||
TileEntity tileEntity = event.player.worldObj.getTileEntity(event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||
boolean shouldRender = true;
|
||||
|
||||
if (tileEntity instanceof TileEntityEE)
|
||||
{
|
||||
if (((TileEntityEE) tileEntity).getOrientation() != sideHit)
|
||||
{
|
||||
shouldRender = false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (sideHit)
|
||||
{
|
||||
case UP:
|
||||
{
|
||||
xScale = zScale = chargeLevel;
|
||||
yShift = 0.001f;
|
||||
xRotate = -1;
|
||||
rotationAngle = (-90 * (rotation + 2)) % 360;
|
||||
facingCorrectionAngle = (-90 * (playerFacing + 2)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
y -= 1;
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TileEntityDummyArray)
|
||||
{
|
||||
x = ((TileEntityDummyArray) tileEntity).getTrueXCoord() + 0.5f;
|
||||
y = ((TileEntityDummyArray) tileEntity).getTrueYCoord() + 0.5f - 1;
|
||||
z = ((TileEntityDummyArray) tileEntity).getTrueXCoord() + 0.5f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DOWN:
|
||||
{
|
||||
xScale = zScale = chargeLevel;
|
||||
yShift = -0.001f;
|
||||
xRotate = 1;
|
||||
rotationAngle = (-90 * (rotation + 2)) % 360;
|
||||
facingCorrectionAngle = (-90 * (playerFacing + 2)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
y += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NORTH:
|
||||
{
|
||||
xScale = yScale = chargeLevel;
|
||||
zCorrection = -1;
|
||||
zShift = -0.001f;
|
||||
zRotate = 1;
|
||||
rotationAngle = (-90 * (rotation + 1)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
z += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SOUTH:
|
||||
{
|
||||
xScale = yScale = chargeLevel;
|
||||
zShift = 0.001f;
|
||||
zRotate = -1;
|
||||
rotationAngle = (-90 * (rotation + 1)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
z -= 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
{
|
||||
yScale = zScale = chargeLevel;
|
||||
xShift = 0.001f;
|
||||
yRotate = 1;
|
||||
rotationAngle = (-90 * (rotation + 2)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
x -= 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST:
|
||||
{
|
||||
yScale = zScale = chargeLevel;
|
||||
xShift = -0.001f;
|
||||
yRotate = -1;
|
||||
rotationAngle = (-90 * (rotation + 2)) % 360;
|
||||
if (tileEntity instanceof TileEntityAlchemyArray)
|
||||
{
|
||||
x += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldRender)
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-iPX + x + xShift, -iPY + y + yShift, -iPZ + z + zShift);
|
||||
GL11.glScalef(1F * xScale, 1F * yScale, 1F * zScale);
|
||||
GL11.glRotatef(rotationAngle, sideHit.offsetX, sideHit.offsetY, sideHit.offsetZ);
|
||||
GL11.glRotatef(facingCorrectionAngle, sideHit.offsetX, sideHit.offsetY, sideHit.offsetZ);
|
||||
GL11.glRotatef(90, xRotate, yRotate, zRotate);
|
||||
GL11.glTranslated(0, 0, 0.5f * zCorrection);
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
RenderUtils.renderPulsingQuad(texture, 1f);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawSelectionBox(RenderGlobal context, EntityPlayer entityPlayer, MovingObjectPosition rayTrace, int i, float partialTicks)
|
||||
{
|
||||
if (i == 0 && rayTrace.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
|
|
|
@ -23,6 +23,8 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
{
|
||||
super();
|
||||
this.setUnlocalizedName(Names.Items.CHALK);
|
||||
this.setMaxDamage(50);
|
||||
this.canRepair = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +80,12 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
chalkSettings.readFromNBT(playerCustomData);
|
||||
int coordOffset = chalkSettings.getSize() - 1;
|
||||
ForgeDirection orientation = ForgeDirection.getOrientation(side);
|
||||
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side); // TODO Not hardcoded to basic alchemy array
|
||||
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side);
|
||||
|
||||
if (itemStack.getMaxDamage() - itemStack.getItemDamage() < (2 * coordOffset) + 1)
|
||||
{
|
||||
canPlaceAlchemyArray = false;
|
||||
}
|
||||
|
||||
if (canPlaceAlchemyArray)
|
||||
{
|
||||
|
@ -138,9 +145,9 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
chalkSettings.readFromNBT(playerCustomData);
|
||||
int coordOffset = chalkSettings.getSize() - 1;
|
||||
ForgeDirection orientation = ForgeDirection.getOrientation(side);
|
||||
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side); // TODO Not hardcoded to basic alchemy array
|
||||
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side);
|
||||
|
||||
placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.alchemyArray, side); // TODO Not hardcoded to basic alchemy array
|
||||
placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.alchemyArray, side);
|
||||
|
||||
if (canPlaceAlchemyArray)
|
||||
{
|
||||
|
@ -214,6 +221,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
|
|||
|
||||
if (world.getBlock(x, y, z) == block)
|
||||
{
|
||||
itemStack.damageItem(1, entityPlayer);
|
||||
block.onBlockPlacedBy(world, x, y, z, entityPlayer, itemStack);
|
||||
block.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
|
@ -17,7 +18,7 @@ import net.minecraft.world.Explosion;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityAlchemyArray extends TileEntityEE
|
||||
public class TileEntityAlchemyArray extends TileEntityEE implements IInventory
|
||||
{
|
||||
private AlchemyArray alchemyArray;
|
||||
private ForgeDirection rotation;
|
||||
|
@ -245,10 +246,7 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onBlockActivated(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onArrayActivated(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer, sideHit, hitX, hitY, hitZ);
|
||||
}
|
||||
alchemyArray.onArrayActivated(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer, sideHit, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityPlayer)
|
||||
|
@ -258,10 +256,7 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onBlockClicked(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onArrayClicked(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer);
|
||||
}
|
||||
alchemyArray.onArrayClicked(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer);
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
|
||||
|
@ -271,10 +266,7 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onBlockDestroyedByExplosion(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Explosion explosion)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onArrayDestroyedByExplosion(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, explosion);
|
||||
}
|
||||
alchemyArray.onArrayDestroyedByExplosion(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, explosion);
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int metaData)
|
||||
|
@ -284,10 +276,7 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onBlockDestroyedByPlayer(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, int metaData)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onArrayDestroyedByPlayer(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, metaData);
|
||||
}
|
||||
alchemyArray.onArrayDestroyedByPlayer(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, metaData);
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
|
@ -297,10 +286,7 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onEntityCollidedWithBlock(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onEntityCollidedWithArray(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity);
|
||||
}
|
||||
alchemyArray.onEntityCollidedWithArray(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity);
|
||||
}
|
||||
|
||||
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance)
|
||||
|
@ -310,21 +296,14 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
public void onFallenUpon(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity, float fallDistance)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onArrayFallenUpon(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity, fallDistance);
|
||||
}
|
||||
alchemyArray.onArrayFallenUpon(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity, fallDistance);
|
||||
}
|
||||
|
||||
public void onUpdate(World world, int x, int y, int z)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
alchemyArray.onUpdate(world, x, y, z);
|
||||
}
|
||||
alchemyArray.onUpdate(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
|
@ -427,4 +406,130 @@ public class TileEntityAlchemyArray extends TileEntityEE
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).getSizeInventory();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slotIndex)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).getStackInSlot(slotIndex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slotIndex, int decrementAmount)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).decrStackSize(slotIndex, decrementAmount);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slotIndex)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).getStackInSlotOnClosing(slotIndex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slotIndex, ItemStack itemStack)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
((IInventory) alchemyArray).setInventorySlotContents(slotIndex, itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).getInventoryName();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).hasCustomInventoryName();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).getInventoryStackLimit();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
((IInventory) alchemyArray).openInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
((IInventory) alchemyArray).closeInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack)
|
||||
{
|
||||
if (alchemyArray instanceof IInventory)
|
||||
{
|
||||
return ((IInventory) alchemyArray).isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ item.ee3:alchemicalDust.minium.name=Minium Dust
|
|||
item.ee3:alchemicalFuel.alchemicalCoal.name=Alchemical Coal
|
||||
item.ee3:alchemicalFuel.mobiusFuel.name=Mobius Fuel
|
||||
item.ee3:alchemicalFuel.aeternalisFuel.name=Aeternalis Fuel
|
||||
item.ee3:chalk.name=Chalk [WIP]
|
||||
item.ee3:chalk.name=Chalk
|
||||
item.ee3:diviningRod.name=Divining Rod [WIP]
|
||||
item.ee3:shardMinium.name=Shard of Minium
|
||||
item.ee3:stoneInert.name=Inert Stone
|
||||
|
@ -90,6 +90,7 @@ tile.ee3:dummyArray.name=Alchemy Array
|
|||
|
||||
# Alchemy Arrays
|
||||
arrays.ee3:basicAlchemyArray=Basic Alchemy Array [WIP]
|
||||
arrays.ee3:transmutationAlchemyArray=Transmutation Alchemy Array [WIP]
|
||||
|
||||
# GUIs
|
||||
container.ee3:alchemicalBag=Alchemical Bag
|
||||
|
@ -102,7 +103,7 @@ container.ee3:augmentationTable=Augmentation Table [WIP]
|
|||
container.ee3:alchemicalTome=Tome of Alchemical Knowledge
|
||||
container.ee3:alchemicalTome.noTransmutationsKnown=You don't know how to transmute anything yet!
|
||||
container.ee3:alchemicalTome.howToLearnTransmutations=Use a Research Station to teach yourself how to transmute items
|
||||
container.ee3:transmutationSquare=Transmutation Square [WIP]
|
||||
container.ee3:transmutationAlchemyArray=Transmutation Square [WIP]
|
||||
|
||||
# NEI
|
||||
gui.nei.ee3:calcination=Calcination
|
||||
|
|
Loading…
Reference in a new issue