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
|
||||
{
|
||||
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;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
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.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,6 +20,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
@@ -24,6 +30,19 @@ import net.minecraftforge.event.world.WorldEvent;
|
||||
public class EventHookContainer
|
||||
{
|
||||
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
|
||||
public void onWorldLoad(WorldEvent.Load event)
|
||||
{
|
||||
|
||||
@@ -181,7 +181,7 @@ public class ItemRiftBlade extends itemDimDoor
|
||||
{
|
||||
link.linkOrientation= rotation;
|
||||
dimHelper.instance.createLink(link);
|
||||
System.out.println("doingup");
|
||||
//System.out.println("doingup");
|
||||
int ExitDimID= dimHelper.dimList.get(par2World.provider.dimensionId).exitDimLink.destDimID;
|
||||
|
||||
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
|
||||
{
|
||||
@@ -213,7 +214,7 @@ public class ItemRiftBlade extends itemDimDoor
|
||||
{
|
||||
Boolean didFindThing=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)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TransientDoor extends ExitDoor
|
||||
|
||||
protected TransientDoor(int par1, Material material)
|
||||
{
|
||||
super(par1, Material.air);
|
||||
super(par1, Material.grass);
|
||||
// this.blockIndexInTexture = 18;
|
||||
this.setTextureFile("/PocketBlockTextures.png");
|
||||
|
||||
@@ -40,6 +40,11 @@ public class TransientDoor extends ExitDoor
|
||||
this.updateAttatchedTile(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
||||
{
|
||||
@@ -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)
|
||||
@@ -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.
|
||||
|
||||
@@ -36,15 +36,16 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
float playerX = (float)this.tileEntityRenderer.playerX;
|
||||
float playerY = (float)this.tileEntityRenderer.playerY;
|
||||
float playerZ = (float)this.tileEntityRenderer.playerZ;
|
||||
// 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);
|
||||
//float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Random rand = new Random(31100L);
|
||||
float var13 = 0.75F;
|
||||
@@ -159,6 +160,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
||||
|
||||
|
||||
|
||||
|
||||
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
||||
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
||||
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
||||
@@ -268,6 +270,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
||||
{
|
||||
if(mod_pocketDim.enableDoorOpenGL)
|
||||
{
|
||||
System.out.println("rendering");
|
||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user