Cleaned up Transdimensional Trapdoor Code
Removed unnecessary code for the Transdimensional Trapdoor. Most of it was code dedicated to updating TileEntityTransTrapdoor.hasRift. That flag was never used for anything.
This commit is contained in:
@@ -63,14 +63,6 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
{
|
{
|
||||||
this.placeLink(world, x, y, z);
|
this.placeLink(world, x, y, z);
|
||||||
world.setBlockTileEntity(x, y, z, this.createNewTileEntity(world));
|
world.setBlockTileEntity(x, y, z, this.createNewTileEntity(world));
|
||||||
updateAttachedTile(world, x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
|
||||||
{
|
|
||||||
TileEntityTransTrapdoor tile = (TileEntityTransTrapdoor) world.getBlockTileEntity(x, y, z);
|
|
||||||
tile.hasRift = PocketManager.getLink(x, y, z, world) != null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -79,16 +71,6 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
return new TileEntityTransTrapdoor();
|
return new TileEntityTransTrapdoor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateAttachedTile(World world, int x, int y, int z)
|
|
||||||
{
|
|
||||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
|
||||||
if (tile instanceof TileEntityTransTrapdoor)
|
|
||||||
{
|
|
||||||
TileEntityTransTrapdoor trapdoorTile = (TileEntityTransTrapdoor) tile;
|
|
||||||
trapdoorTile.hasRift = (PocketManager.getLink(x, y, z, world) != null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void placeLink(World world, int x, int y, int z)
|
public void placeLink(World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
@@ -98,7 +80,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||||||
DimLink link = dimension.getLink(x, y, z);
|
DimLink link = dimension.getLink(x, y, z);
|
||||||
if (link == null && dimension.isPocketDimension())
|
if (link == null && dimension.isPocketDimension())
|
||||||
{
|
{
|
||||||
dimension.createLink(x, y, z, LinkTypes.UNSAFE_EXIT,0);
|
dimension.createLink(x, y, z, LinkTypes.UNSAFE_EXIT, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|||||||
|
|
||||||
public class TileEntityTransTrapdoor extends DDTileEntityBase
|
public class TileEntityTransTrapdoor extends DDTileEntityBase
|
||||||
{
|
{
|
||||||
public boolean hasRift;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUpdate()
|
public boolean canUpdate()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDimClient;
|
|||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockTrapDoor;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
@@ -38,21 +39,6 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
*/
|
*/
|
||||||
public void renderTransTrapdoorTileEntity(TileEntityTransTrapdoor tile, double x, double y, double z, float par8)
|
public void renderTransTrapdoorTileEntity(TileEntityTransTrapdoor tile, double x, double y, double z, float par8)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
mod_pocketDim.transTrapdoor.updateAttachedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// float playerX = (float)this.tileEntityRenderer.playerX;
|
|
||||||
// float playerY = (float)this.tileEntityRenderer.playerY;
|
|
||||||
// float playerZ = (float)this.tileEntityRenderer.playerZ;
|
|
||||||
|
|
||||||
//float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
Random random = new Random(31100L);
|
Random random = new Random(31100L);
|
||||||
int metadata = tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
int metadata = tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
@@ -77,7 +63,6 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
this.bindTexture(warpPath);
|
this.bindTexture(warpPath);
|
||||||
// move files into assets/modid and change to new ResourceLocation(modid:/WARP.png)
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||||
var16 = .5F;
|
var16 = .5F;
|
||||||
@@ -127,7 +112,7 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
GL11.glColor4d(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
GL11.glColor4d(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
||||||
if (TransTrapdoor.isTrapdoorSetLow(metadata))
|
if (TransTrapdoor.isTrapdoorSetLow(metadata))
|
||||||
{
|
{
|
||||||
if (TransTrapdoor.isTrapdoorOpen(metadata))
|
if (BlockTrapDoor.isTrapdoorOpen(metadata))
|
||||||
{
|
{
|
||||||
GL11.glVertex3d(x, y+0.2, z);
|
GL11.glVertex3d(x, y+0.2, z);
|
||||||
GL11.glVertex3d(x, y+0.2, z+1);
|
GL11.glVertex3d(x, y+0.2, z+1);
|
||||||
@@ -144,7 +129,7 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (TransTrapdoor.isTrapdoorOpen(metadata))
|
if (BlockTrapDoor.isTrapdoorOpen(metadata))
|
||||||
{
|
{
|
||||||
GL11.glVertex3d(x, y+0.95, z);
|
GL11.glVertex3d(x, y+0.95, z);
|
||||||
GL11.glVertex3d(x, y+0.95, z+1);
|
GL11.glVertex3d(x, y+0.95, z+1);
|
||||||
@@ -180,7 +165,8 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||||||
return this.field_76908_a;
|
return this.field_76908_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||||
{
|
{
|
||||||
if (properties.DoorRenderingEnabled)
|
if (properties.DoorRenderingEnabled)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user