Fixed a few bugs, more rendering changes
This commit is contained in:
@@ -55,6 +55,8 @@ public class TileEntityRift extends TileEntity
|
||||
}
|
||||
public void clearBlocksOnRift()
|
||||
{
|
||||
System.out.println(this.worldObj.getBlockId(xCoord, yCoord,zCoord));
|
||||
|
||||
for(double[] coord: this.renderingCenters.values())
|
||||
{
|
||||
int x = MathHelper.floor_double(coord[0]+.5);
|
||||
@@ -164,6 +166,11 @@ public class TileEntityRift extends TileEntity
|
||||
this.invalidate();
|
||||
this.worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
if(this.worldObj.getBlockId(xCoord, yCoord, zCoord)!=mod_pocketDim.blockRift.blockID)
|
||||
{
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
public void grow(int distance)
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ExitDoor extends dimDoor
|
||||
|
||||
}
|
||||
|
||||
//this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
||||
par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World));
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -281,6 +281,8 @@ public class dimDoor extends BlockContainer
|
||||
|
||||
}
|
||||
}
|
||||
par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DungeonPack
|
||||
{
|
||||
String standardName = typeName.toUpperCase();
|
||||
this.nameToTypeMapping.put(standardName, new DungeonType(this, standardName, index));
|
||||
this.groupedDungeons.add(new ArrayList<DungeonGenerator>());
|
||||
this.groupedDungeons.add(new ArrayList<DungeonGenerator>());
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
@@ -1125,17 +1125,13 @@ public class dimHelper extends DimensionManager
|
||||
}
|
||||
}
|
||||
}
|
||||
linkToMove.locDimID=dimID;
|
||||
linkToMove.locXCoord=x;
|
||||
linkToMove.locYCoord=y;
|
||||
linkToMove.locZCoord=z;
|
||||
this.createLink(new LinkData(dimID,linkToMove.destDimID,x,y,z,linkToMove.destXCoord,linkToMove.destYCoord,linkToMove.destZCoord,linkToMove.isLocPocket,linkToMove.linkOrientation));
|
||||
|
||||
if(this.getLinkDataFromCoords(oldX,oldY,oldZ,oldDimID)!=null)
|
||||
{
|
||||
// this.removeLink(this.getLinkDataFromCoords(oldX,oldY,oldZ,oldDimID));
|
||||
this.removeLink(this.getLinkDataFromCoords(oldX,oldY,oldZ,oldDimID));
|
||||
}
|
||||
this.createLink(linkToMove);
|
||||
LinkData linkTest = dimHelper.instance.getLinkDataFromCoords(x, y, z, dimID);
|
||||
linkTest.printLinkData();
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -26,6 +26,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderRift extends TileEntitySpecialRenderer
|
||||
{
|
||||
private Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double xWorld, double yWorld,
|
||||
@@ -41,7 +42,7 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
//GL11.glLogicOp(GL11.GL_INVERT);
|
||||
// GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
|
||||
|
||||
GL11.glColor4f(.3F, .3F, .3F, 1F);
|
||||
GL11.glColor4f(.2F, .2F, .2F, 1F);
|
||||
|
||||
GL11.glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
|
||||
@@ -71,11 +72,16 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
drawVertex(xWorld+.5, yWorld+Math.log(Math.pow(quads.size(),2)+1)/14, zWorld+.5);
|
||||
for(int i = 0;;i++)
|
||||
{
|
||||
|
||||
if(!quads.containsKey(i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
double[] coords = quads.get(i);
|
||||
float driftX = (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F;
|
||||
float driftY =(float)(Minecraft.getSystemTime() % 200000L) / 200000.0F;
|
||||
float driftZ = (float) (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F;
|
||||
|
||||
double width=Math.log(Math.pow(quads.size(),2-Math.log(i+1))+1)/14;
|
||||
if(coords[3]==0)
|
||||
{
|
||||
@@ -83,16 +89,16 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
if(quads.containsKey(i+1))
|
||||
{
|
||||
|
||||
drawVertex(xWorld+coords[0]+.5, yWorld+coords[1]-width/2 , zWorld+coords[2]);
|
||||
drawVertex(xWorld+coords[0]+.5 , yWorld+coords[1]+width/2 , zWorld+coords[2]);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5, yWorld+coords[1]+driftY-width/2 , zWorld+coords[2]+driftZ);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5 , yWorld+coords[1]+driftY+width/2 , zWorld+coords[2]+driftZ);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drawVertex(xWorld+coords[0]+.5, yWorld+coords[1]-width/200 , zWorld+coords[2]);
|
||||
drawVertex(xWorld+coords[0]+.5 , yWorld+coords[1]+width/200 , zWorld+coords[2]);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5, yWorld+coords[1]+driftY-width/200 , zWorld+coords[2]+driftZ);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5 , yWorld+coords[1]+driftY+width/200 , zWorld+coords[2]+driftZ);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -102,15 +108,15 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
|
||||
if(quads.containsKey(i+1))
|
||||
{
|
||||
drawVertex(xWorld+coords[0], yWorld+coords[1]-width/2 , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld+coords[0], yWorld+coords[1]+width/2 , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld+coords[0]+driftX, yWorld+coords[1]+driftY-width/2 , zWorld+coords[2]+driftZ+.5);
|
||||
drawVertex(xWorld+coords[0]+driftX, yWorld+coords[1]+driftY+width/2 , zWorld+coords[2]+driftZ+.5);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drawVertex(xWorld+coords[0], yWorld+coords[1]+width/200 , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld+coords[0], yWorld+coords[1]-width/200, zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld+coords[0]+driftX, yWorld+coords[1]+driftY+width/200 , zWorld+coords[2]+driftZ+.5);
|
||||
drawVertex(xWorld+coords[0]+driftX, yWorld+coords[1]+driftY-width/200, zWorld+coords[2]+driftZ+.5);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +143,12 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
break;
|
||||
}
|
||||
double[] coords = quads.get(i);
|
||||
|
||||
float driftX = (float) (rand.nextGaussian()/100)*i;
|
||||
float driftY = (float) (rand.nextGaussian()/100)*i;
|
||||
float driftZ = (float) (rand.nextGaussian()/100)*i;
|
||||
|
||||
|
||||
double width=Math.log(Math.pow(quads.size(),2-Math.log(i+1))+1)/14;
|
||||
if(coords[3]==0)
|
||||
{
|
||||
@@ -144,15 +156,15 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
|
||||
if(quads.containsKey(i+1))
|
||||
{
|
||||
drawVertex(xWorld+coords[0]+.5, yWorld-(coords[1]-width/2) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+.5 , yWorld-(coords[1]+width/2) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5, yWorld-(coords[1]-width/2) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5 , yWorld-(coords[1]+width/2) , zWorld-coords[2]+1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
drawVertex(xWorld+coords[0]+.5, yWorld-(coords[1]-width/200) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+.5 , yWorld-(coords[1]+width/200) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5, yWorld-(coords[1]-width/200) , zWorld-coords[2]+1);
|
||||
drawVertex(xWorld+coords[0]+driftX+.5 , yWorld-(coords[1]+width/200) , zWorld-coords[2]+1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -163,14 +175,14 @@ public class RenderRift extends TileEntitySpecialRenderer
|
||||
if(quads.containsKey(i+1))
|
||||
{
|
||||
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]-width/2) , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]+width/2) , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]-width/2) , zWorld+coords[2]+driftZ+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]+width/2) , zWorld+coords[2]+driftZ+.5);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]+width/200) , zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]-width/200), zWorld+coords[2]+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]+width/200) , zWorld+coords[2]+driftZ+.5);
|
||||
drawVertex(xWorld-coords[0]+1, yWorld-(coords[1]-width/200), zWorld+coords[2]+driftZ+.5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user