Merge remote-tracking branch 'upstream/DevBranch' into rewrite
@@ -2,12 +2,15 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
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
|
public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
||||||
{
|
{
|
||||||
@@ -38,4 +41,10 @@ public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
|||||||
return this.properties.GoldDoorItemID;
|
return this.properties.GoldDoorItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world)
|
||||||
|
{
|
||||||
|
return new TileEntityDimDoorGold();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class ItemRiftSignature extends Item
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
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
|
// We must use onItemUseFirst() instead of onItemUse() because Minecraft checks
|
||||||
// whether the user is in creative mode after calling onItemUse() and undoes any
|
// 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,
|
// damage we might set to indicate the rift sig has been activated. Otherwise,
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ public class mod_pocketDim
|
|||||||
@PreInit
|
@PreInit
|
||||||
public void onPreInitialization(FMLPreInitializationEvent event)
|
public void onPreInitialization(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
|
this.instance = this;
|
||||||
//This should be the FIRST thing that gets done.
|
//This should be the FIRST thing that gets done.
|
||||||
properties = DDProperties.initialize(event.getSuggestedConfigurationFile());
|
properties = DDProperties.initialize(event.getSuggestedConfigurationFile());
|
||||||
|
|
||||||
@@ -386,7 +387,6 @@ public class mod_pocketDim
|
|||||||
//Register loot chests
|
//Register loot chests
|
||||||
DDLoot.registerInfo();
|
DDLoot.registerInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ServerStopping
|
@ServerStopping
|
||||||
public void onServerStopping(FMLServerStoppingEvent event)
|
public void onServerStopping(FMLServerStoppingEvent event)
|
||||||
{
|
{
|
||||||
@@ -403,6 +403,8 @@ public class mod_pocketDim
|
|||||||
@ServerStarting
|
@ServerStarting
|
||||||
public void onServerStarting(FMLServerStartingEvent event)
|
public void onServerStarting(FMLServerStartingEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO- load dims with forced chunks on server startup here
|
||||||
/*
|
/*
|
||||||
CommandResetDungeons.instance().register(event);
|
CommandResetDungeons.instance().register(event);
|
||||||
CommandCreateDungeonRift.instance().register(event);
|
CommandCreateDungeonRift.instance().register(event);
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity()
|
public void updateEntity()
|
||||||
|
{
|
||||||
|
if(PocketManager.getDimensionData(this.worldObj)!=null&&PocketManager.getDimensionData(this.worldObj).isPocketDimension()&&!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
if(this.chunkTicket==null)
|
if(this.chunkTicket==null)
|
||||||
{
|
{
|
||||||
@@ -29,8 +31,9 @@ public class TileEntityDimDoorGold extends TileEntityDimDoor
|
|||||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||||
|
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4));
|
||||||
this.forceChunkLoading(chunkTicket);
|
forceChunkLoading(chunkTicket);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void forceChunkLoading(Ticket 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));
|
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 |