From 6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 23 Mar 2015 14:51:06 +0000 Subject: Reworked the whole repo. --- .../tileentity/TileEntityBlockShadow.java | 88 ---------------------- 1 file changed, 88 deletions(-) delete mode 100644 java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java (limited to 'java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java') diff --git a/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java deleted file mode 100644 index b16ce31..0000000 --- a/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java +++ /dev/null @@ -1,88 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; - -public class TileEntityBlockShadow extends TileEntity -{ - public int metadata; - - /** - * - */ - public TileEntityBlockShadow() - { - metadata = -1; - } - - /** - * @param nbt - */ - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("metadata", metadata); - } - - /** - * @param nbt - */ - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - metadata = nbt.getInteger("metadata"); - } - - /** - * - */ - @Override - public void updateEntity() - { - super.updateEntity(); - int blockLight, realLight; - int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted; - float sunPosAngle = worldObj.getCelestialAngleRadians(1.0F); - if (sunPosAngle < (float)Math.PI) sunPosAngle += (0.0F - sunPosAngle) * 0.2F; - else sunPosAngle += ((float)Math.PI * 2F - sunPosAngle) * 0.2F; - lightValue = Math.round(lightValue * MathHelper.cos(sunPosAngle)); - if (lightValue < 0) lightValue = 0; - if (lightValue > 15) lightValue = 15; - blockLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getSavedLightValue(EnumSkyBlock.Block, xCoord & 15, yCoord, zCoord & 15); - realLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getBlockLightValue(xCoord & 15, yCoord, zCoord & 15, 0); - if (blockLight == 0 && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) || lightValue >= blockLight) metadata = 15 - lightValue; - else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) metadata = 15 - realLight; - else if (lightValue < blockLight) metadata = 15 - blockLight; - worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, metadata, 2); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); - } - - /** - * @return - */ - @Override - public Packet getDescriptionPacket() - { - NBTTagCompound nbttagcompound = new NBTTagCompound(); - writeToNBT(nbttagcompound); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound); - } - - /** - * @param net - * @param packet - */ - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) - { - readFromNBT(packet.func_148857_g()); - worldObj.func_147479_m(xCoord, yCoord, zCoord); - } -} -- cgit v1.2.3