Gold dim door working

Needs to gen the right type of door.
This commit is contained in:
StevenRS11
2013-09-10 15:50:15 -04:00
parent 52aa836f75
commit 08b36054ce
8 changed files with 26 additions and 14 deletions

View File

@@ -2,12 +2,15 @@ package StevenDimDoors.mod_pocketDim.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.core.DimLink;
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
import StevenDimDoors.mod_pocketDim.core.NewDimData;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
{
@@ -37,5 +40,11 @@ public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
{
return this.properties.GoldDoorItemID;
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileEntityDimDoorGold();
}
}

View File

@@ -45,6 +45,7 @@ public class ItemRiftSignature extends Item
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
//TODO- recognize doors and intelligently place rifts on them.
// We must use onItemUseFirst() instead of onItemUse() because Minecraft checks
// whether the user is in creative mode after calling onItemUse() and undoes any
// damage we might set to indicate the rift sig has been activated. Otherwise,

View File

@@ -148,6 +148,7 @@ public class mod_pocketDim
@PreInit
public void onPreInitialization(FMLPreInitializationEvent event)
{
this.instance = this;
//This should be the FIRST thing that gets done.
properties = DDProperties.initialize(event.getSuggestedConfigurationFile());
@@ -386,7 +387,6 @@ public class mod_pocketDim
//Register loot chests
DDLoot.registerInfo();
}
@ServerStopping
public void onServerStopping(FMLServerStoppingEvent event)
{
@@ -403,6 +403,8 @@ public class mod_pocketDim
@ServerStarting
public void onServerStarting(FMLServerStartingEvent event)
{
//TODO- load dims with forced chunks on server startup here
/*
CommandResetDungeons.instance().register(event);
CommandCreateDungeonRift.instance().register(event);

View File

@@ -21,16 +21,19 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
public void updateEntity()
{
if(this.chunkTicket==null)
{
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
if(PocketManager.getDimensionData(this.worldObj)!=null&&PocketManager.getDimensionData(this.worldObj).isPocketDimension()&&!this.worldObj.isRemote)
{
if(this.chunkTicket==null)
{
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
}
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4));
forceChunkLoading(chunkTicket);
}
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
this.forceChunkLoading(chunkTicket);
}
public void forceChunkLoading(Ticket chunkTicket)
@@ -48,10 +51,7 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
{
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((xCoord >> 4)+chunks, (zCoord >> 4)+chunks));
}
}
}