Fixed door render issue finally
Signed-off-by: StevenRS11 <steven.r.stafford.ii.14@dartmouth.edu>
This commit is contained in:
@@ -77,7 +77,7 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
dimHelper.getWorld(link.locDimID).setBlockWithNotify(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
||||||
|
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.monster.EntityEnderman;
|
import net.minecraft.entity.monster.EntityEnderman;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -15,6 +20,7 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||||
import net.minecraftforge.event.ForgeSubscribe;
|
import net.minecraftforge.event.ForgeSubscribe;
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||||
@@ -24,6 +30,19 @@ import net.minecraftforge.event.world.WorldEvent;
|
|||||||
public class EventHookContainer
|
public class EventHookContainer
|
||||||
{
|
{
|
||||||
Random rand= new Random();
|
Random rand= new Random();
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@ForgeSubscribe
|
||||||
|
public void onSoundLoad(SoundLoadEvent event)
|
||||||
|
{
|
||||||
|
File dataDir = Minecraft.getMinecraft().mcDataDir;
|
||||||
|
|
||||||
|
// event.manager.soundPoolSounds.addSound("mod/test/sound.ogg", new File(
|
||||||
|
// dataDir, "resources/mod/test/sound.ogg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
@ForgeSubscribe
|
||||||
public void onWorldLoad(WorldEvent.Load event)
|
public void onWorldLoad(WorldEvent.Load event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
{
|
{
|
||||||
link.linkOrientation= rotation;
|
link.linkOrientation= rotation;
|
||||||
dimHelper.instance.createLink(link);
|
dimHelper.instance.createLink(link);
|
||||||
System.out.println("doingup");
|
//System.out.println("doingup");
|
||||||
int ExitDimID= dimHelper.dimList.get(par2World.provider.dimensionId).exitDimLink.destDimID;
|
int ExitDimID= dimHelper.dimList.get(par2World.provider.dimensionId).exitDimLink.destDimID;
|
||||||
|
|
||||||
dimHelper.instance.createLink(link.locDimID, ExitDimID, x, y, z, x, y, z,rotation);
|
dimHelper.instance.createLink(link.locDimID, ExitDimID, x, y, z, x, y, z,rotation);
|
||||||
@@ -199,7 +199,8 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
placeDoorBlock(par2World, x, y, z, rotation, mod_pocketDim.transientDoor);
|
placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -213,7 +214,7 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
{
|
{
|
||||||
Boolean didFindThing=false;
|
Boolean didFindThing=false;
|
||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
||||||
if(hit!=null)
|
if(hit!=null&&!par2World.isRemote)
|
||||||
{
|
{
|
||||||
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
|
|
||||||
protected TransientDoor(int par1, Material material)
|
protected TransientDoor(int par1, Material material)
|
||||||
{
|
{
|
||||||
super(par1, Material.air);
|
super(par1, Material.grass);
|
||||||
// this.blockIndexInTexture = 18;
|
// this.blockIndexInTexture = 18;
|
||||||
this.setTextureFile("/PocketBlockTextures.png");
|
this.setTextureFile("/PocketBlockTextures.png");
|
||||||
|
|
||||||
@@ -35,9 +35,14 @@ public class TransientDoor extends ExitDoor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
this.updateAttatchedTile(par1World, par2, par3, par4);
|
this.updateAttatchedTile(par1World, par2, par3, par4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -83,17 +88,9 @@ public class TransientDoor extends ExitDoor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
||||||
{
|
|
||||||
return super.getCollisionBoundingBoxFromPool(par1World, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||||
@@ -107,12 +104,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
||||||
{
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function to open a door.
|
* A function to open a door.
|
||||||
|
|||||||
@@ -30,21 +30,22 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
|
||||||
}
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float playerX = (float)this.tileEntityRenderer.playerX;
|
// float playerX = (float)this.tileEntityRenderer.playerX;
|
||||||
float playerY = (float)this.tileEntityRenderer.playerY;
|
// float playerY = (float)this.tileEntityRenderer.playerY;
|
||||||
float playerZ = (float)this.tileEntityRenderer.playerZ;
|
// float playerZ = (float)this.tileEntityRenderer.playerZ;
|
||||||
|
|
||||||
float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
//float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
Random rand = new Random(31100L);
|
Random rand = new Random(31100L);
|
||||||
float var13 = 0.75F;
|
float var13 = 0.75F;
|
||||||
@@ -159,6 +160,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
||||||
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
||||||
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
||||||
@@ -268,6 +270,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
if(mod_pocketDim.enableDoorOpenGL)
|
if(mod_pocketDim.enableDoorOpenGL)
|
||||||
{
|
{
|
||||||
|
System.out.println("rendering");
|
||||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user