Progress on the New Save Format and Minor Fixes #88
@@ -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
|
||||
{
|
||||
@@ -38,4 +41,10 @@ public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
||||
return this.properties.GoldDoorItemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileEntityDimDoorGold();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -21,16 +21,19 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
if(this.chunkTicket==null)
|
||||
if(PocketManager.getDimensionData(this.worldObj)!=null&&PocketManager.getDimensionData(this.worldObj).isPocketDimension()&&!this.worldObj.isRemote)
|
||||
{
|
||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||
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)
|
||||
@@ -49,9 +52,6 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
|
||||
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((xCoord >> 4)+chunks, (zCoord >> 4)+chunks));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |