Doors dont close on items, have short cooldown

readded decay and rift regen

Signed-off-by: StevenRS11 <stevenrs11@aol.com>
This commit is contained in:
StevenRS11 2013-04-07 02:33:11 -04:00
parent 9951581fb0
commit 2d6d430277
3 changed files with 23 additions and 6 deletions

View file

@ -14,6 +14,7 @@ public class CommonTickHandler implements ITickHandler
Random rand= new Random(); Random rand= new Random();
public int tickCount=0; public int tickCount=0;
public int tickCount2=0; public int tickCount2=0;
@Override @Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {} public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@ -40,7 +41,7 @@ public class CommonTickHandler implements ITickHandler
//replaces rifts in game that have been destroyed/have blocks placed over them. //replaces rifts in game that have been destroyed/have blocks placed over them.
private void onTickInGame() private void onTickInGame()
{ {
/**
try try
{ {
@ -50,13 +51,13 @@ public class CommonTickHandler implements ITickHandler
int i=0; int i=0;
while (i<15&&dimHelper.instance.linksForRendering.size()>0&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER) while (i<15&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
{ {
i++; i++;
LinkData link; LinkData link;
//actually gets the random rift based on the size of the list //actually gets the random rift based on the size of the list
link = (LinkData) dimHelper.instance.linksForRendering.get(rand.nextInt(dimHelper.instance.linksForRendering.size())); link = (LinkData) dimHelper.instance.getRandomLinkData(true);
@ -73,7 +74,6 @@ public class CommonTickHandler implements ITickHandler
{ {
if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null) if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
{ {
dimHelper.instance.linksForRendering.remove(link);
} }
else else
{ {
@ -157,7 +157,12 @@ public class CommonTickHandler implements ITickHandler
} }
tickCount2++; tickCount2++;
**/
if(mod_pocketDim.teleTimer>0)
{
mod_pocketDim.teleTimer--;
}
} }
} }

View file

@ -341,6 +341,15 @@ public class dimHelper extends DimensionManager
this.generatePocket(linkData); this.generatePocket(linkData);
this.generateDoor(world,linkData); this.generateDoor(world,linkData);
if(mod_pocketDim.teleTimer==0||entity instanceof EntityPlayer)
{
mod_pocketDim.teleTimer=2+rand.nextInt(2);
}
else
{
return;
}
@ -354,7 +363,8 @@ public class dimHelper extends DimensionManager
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity); GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
} }
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.endermen.portal", 1.0F, 1.0F); entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.endermen.portal", 1.0F, 1.0F);
int playerXCoord=MathHelper.floor_double(entity.posX); int playerXCoord=MathHelper.floor_double(entity.posX);
int playerYCoord=MathHelper.floor_double(entity.posY); int playerYCoord=MathHelper.floor_double(entity.posY);

View file

@ -636,4 +636,6 @@ public class mod_pocketDim
} }
public static int teleTimer=0;
} }