Fixed Slow Rift Regeneration and Various Improvements #173

Merged
SenseiKiwi merged 12 commits from master into master 2014-07-11 20:12:08 +00:00
3 changed files with 6 additions and 40 deletions
Showing only changes of commit 107aa4b7f2 - Show all commits

View File

@@ -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)
{ {

View File

@@ -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()
{ {

View File

@@ -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,6 +165,7 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
return this.field_76908_a; return this.field_76908_a;
} }
@Override
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
{ {
if (properties.DoorRenderingEnabled) if (properties.DoorRenderingEnabled)