a few last tweaks

This commit is contained in:
StevenRS11
2013-06-16 03:40:46 -04:00
parent cd4679c8fd
commit 5e107f37f9
5 changed files with 55 additions and 108 deletions

View File

@@ -0,0 +1,46 @@
package StevenDimDoors.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.Teleporter;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class BlankTeleporter extends Teleporter
{
public BlankTeleporter(WorldServer par1WorldServer)
{
super(par1WorldServer);
}
/**
* Create a new portal near an entity.
*/
@Override
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
{
}
public void setEntityPosition(Entity entity, double x, double y, double z)
{
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
entity.setPosition(x, y, z);
}
@Override
public void removeStalePortalLocations(long par1)
{
}
}

View File

@@ -1,102 +0,0 @@
package StevenDimDoors.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.Teleporter;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class RailTeleporter extends Teleporter
{
int x,y,z;
World world;
LinkData sendingLink;
public RailTeleporter(WorldServer par1WorldServer, LinkData link)
{
super(par1WorldServer);
this.x=link.destXCoord;
this.y=link.destYCoord;
this.z=link.destZCoord;
this.sendingLink=link;
world = par1WorldServer;
}
/**
* Create a new portal near an entity.
*/
@Override
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
{
int id;
id=dimHelper.instance.getDestOrientation(sendingLink);
//System.out.println("Teleporting with link oreintation "+id);
par1Entity.rotationYaw=(id*90)+90;
if(id==2||id==6)
{
this.setEntityPosition(par1Entity, x+2.5, y, z+.5 );
}
else if(id==3||id==7)
{
this.setEntityPosition(par1Entity, x+.5, y, z+2.5 );
}
else if(id==0||id==4)
{
this.setEntityPosition(par1Entity,x-1.5, y, z+.5);
}
else if(id==1||id==5)
{
this.setEntityPosition(par1Entity,x+.5, y, z-1.5);
}
else
{
this.setEntityPosition(par1Entity,x, y, z);
}
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
}
public void setEntityPosition(Entity entity, double x, double y, double z)
{
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
entity.setPosition(x, y, z);
}
@Override
public void removeStalePortalLocations(long par1)
{
}
}

View File

@@ -4,6 +4,7 @@ import java.util.Random;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.BlankTeleporter;
import StevenDimDoors.mod_pocketDim.DDProperties; import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.LinkData; import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.mod_pocketDim; import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@@ -83,7 +84,7 @@ public class BlockDimWallPerm extends Block
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z ); EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
//this complicated chunk teleports the player back to the overworld at some random location. Looks funky becaue it has to load the chunk //this complicated chunk teleports the player back to the overworld at some random location. Looks funky becaue it has to load the chunk
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) par5Entity, 0); FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) par5Entity, 0,new BlankTeleporter((WorldServer)par5Entity.worldObj));
//dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0), //dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0),
// EntityPlayer.class.cast(par5Entity)); // EntityPlayer.class.cast(par5Entity));

View File

@@ -313,7 +313,7 @@ public class DungeonHelper
this.deadEnds.add(new DungeonGenerator(0, "/schematics/randomTree.schematic", true)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/randomTree.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallHiddenTowerO.schematic", true)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallHiddenTowerO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallSilverfishRoom.schematic", false)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallSilverfishRoom.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/tntTrapO.schematic", false)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/tntTrapO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallDesert.schematic", true)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallDesert.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallPond.schematic", true)); this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallPond.schematic", true));

View File

@@ -93,6 +93,11 @@ public class MobObelisk extends EntityFlying implements IMob
@Override @Override
public void onEntityUpdate() public void onEntityUpdate()
{ {
if(!(this.worldObj.provider instanceof LimboProvider ||this.worldObj.provider instanceof pocketProvider))
{
this.setDead();
}
byte b0 = this.dataWatcher.getWatchableObjectByte(16); byte b0 = this.dataWatcher.getWatchableObjectByte(16);
this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png"; this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png";
@@ -199,10 +204,7 @@ public class MobObelisk extends EntityFlying implements IMob
this.aggro=0; this.aggro=0;
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1); entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1);
if(!(this.worldObj.provider instanceof LimboProvider ||this.worldObj.provider instanceof pocketProvider))
{
this.setDead();
}