Bunch more work, lots of schematic work to fix + world generators..
Signed-off-by: Clienthax <clienthax@gmail.com>
This commit is contained in:
@@ -2,11 +2,17 @@ package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.config.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDLock;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemDDKey;
|
||||
import StevenDimDoors.mod_pocketDim.items.behaviors.DispenserBehaviorStabilizedRS;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
@@ -21,12 +27,19 @@ public class CraftingManager
|
||||
switch (properties.WorldThreadRequirementLevel)
|
||||
{
|
||||
case 1:
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(mod_pocketDim.itemStableFabric, 1),
|
||||
Items.ender_pearl, mod_pocketDim.itemWorldThread);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(mod_pocketDim.itemStableFabric, 1),
|
||||
Items.ender_pearl,
|
||||
mod_pocketDim.itemWorldThread
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemStableFabric, 1),
|
||||
"yxy", 'x', Items.ender_pearl, 'y', mod_pocketDim.itemWorldThread);
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(mod_pocketDim.itemStableFabric, 1),
|
||||
"yxy",
|
||||
'x', Items.ender_pearl,
|
||||
'y', mod_pocketDim.itemWorldThread
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemStableFabric, 1),
|
||||
@@ -116,49 +129,40 @@ public class CraftingManager
|
||||
|
||||
}
|
||||
|
||||
//TODO 1.7
|
||||
/*
|
||||
@Override
|
||||
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix)
|
||||
{
|
||||
if(item.getItem() instanceof ItemDDKey)
|
||||
{
|
||||
ItemDDKey keyItem = (ItemDDKey) item.getItem();
|
||||
@SubscribeEvent
|
||||
public void onCrafting(PlayerEvent.ItemCraftedEvent event) {
|
||||
if(event.crafting.getItem() instanceof ItemDDKey) {
|
||||
ItemDDKey keyItem = (ItemDDKey) event.crafting.getItem();
|
||||
ItemStack topKey = null;
|
||||
ItemStack bottomKey = null;
|
||||
int topKeySlot = 0;
|
||||
|
||||
for(int i = 0; i<craftMatrix.getSizeInventory();i++)
|
||||
{
|
||||
ItemStack slot = craftMatrix.getStackInSlot(i);
|
||||
if(slot!=null)
|
||||
{
|
||||
if(topKey==null)
|
||||
{
|
||||
|
||||
for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++) {
|
||||
ItemStack slot = event.craftMatrix.getStackInSlot(i);
|
||||
if(slot != null) {
|
||||
if (topKey == null) {
|
||||
topKey = slot;
|
||||
topKeySlot = i;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
bottomKey = slot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DDLock.addKeys(bottomKey, DDLock.getKeys(topKey));
|
||||
item.setTagCompound(bottomKey.getTagCompound());
|
||||
player.inventory.addItemStackToInventory(topKey);
|
||||
event.crafting.setTagCompound(bottomKey.getTagCompound());
|
||||
event.player.inventory.addItemStackToInventory(topKey);//TODO 1.7 is this needed?
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSmelting(EntityPlayer player, ItemStack item)
|
||||
@SubscribeEvent
|
||||
public void onSmelting(PlayerEvent.ItemSmeltedEvent event)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
public static void registerDispenserBehaviors()
|
||||
{
|
||||
// Register the dispenser behaviors for certain DD items
|
||||
|
||||
@@ -19,13 +19,16 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
||||
@@ -374,25 +377,26 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||
/**
|
||||
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
||||
*/
|
||||
//TODO 1.7
|
||||
/* @Override
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int idPicked(World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
return this.getDoorItem();
|
||||
return new ItemStack(this.getDoorItem(), 1);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
//TODO 1.7
|
||||
/* @Override
|
||||
public Item getItemDropped(int metadata, Random random, int fortune)
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
return isUpperDoorBlock(metadata) ? 0 : this.getDrops();
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
if(isUpperDoorBlock(metadata))
|
||||
drops.add(new ItemStack(this.getDrops(), 1));
|
||||
return drops;
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
{
|
||||
|
||||
@@ -87,8 +87,7 @@ public class BlockDimWallPerm extends Block
|
||||
if (Math.abs(xc) + Math.abs(zc) < random.nextInt(3) + 2 ||
|
||||
Math.abs(xc) + Math.abs(zc) < random.nextInt(3) + 3)
|
||||
{
|
||||
//TODO 1.7
|
||||
// overworld.setBlock(destinationX + xc, destinationY - 1, destinationZ + zc, properties.LimboBlockID);
|
||||
overworld.setBlock(destinationX + xc, destinationY - 1, destinationZ + zc, mod_pocketDim.blockLimbo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
@@ -49,41 +50,37 @@ public class BlockRift extends Block implements ITileEntityProvider
|
||||
super(par2Material);
|
||||
this.setTickRandomly(true);
|
||||
this.properties = properties;
|
||||
//TODO 1.7
|
||||
|
||||
this.modBlocksImmuneToRift = new ArrayList<Block>();
|
||||
/*
|
||||
this.modBlocksImmuneToRift.add(properties.FabricBlockID);
|
||||
this.modBlocksImmuneToRift.add(properties.PermaFabricBlockID);
|
||||
this.modBlocksImmuneToRift.add(properties.DimensionalDoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.WarpDoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.TransTrapdoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.UnstableDoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.RiftBlockID);
|
||||
this.modBlocksImmuneToRift.add(properties.TransientDoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.GoldenDimensionalDoorID);
|
||||
this.modBlocksImmuneToRift.add(properties.GoldenDoorID);
|
||||
*/
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.blockDimWall);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.blockDimWallPerm);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.dimensionalDoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.warpDoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.transTrapdoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.unstableDoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.blockRift);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.transientDoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.goldenDimensionalDoor);
|
||||
this.modBlocksImmuneToRift.add(mod_pocketDim.goldenDoor);
|
||||
|
||||
|
||||
this.blocksImmuneToRift = new ArrayList<Block>();
|
||||
/*
|
||||
this.blocksImmuneToRift.add(properties.FabricBlockID);
|
||||
this.blocksImmuneToRift.add(properties.PermaFabricBlockID);
|
||||
this.blocksImmuneToRift.add(properties.DimensionalDoorID);
|
||||
this.blocksImmuneToRift.add(properties.WarpDoorID);
|
||||
this.blocksImmuneToRift.add(properties.TransTrapdoorID);
|
||||
this.blocksImmuneToRift.add(properties.UnstableDoorID);
|
||||
this.blocksImmuneToRift.add(properties.RiftBlockID);
|
||||
this.blocksImmuneToRift.add(properties.TransientDoorID);
|
||||
this.blocksImmuneToRift.add(properties.GoldenDimensionalDoorID);
|
||||
this.blocksImmuneToRift.add(properties.GoldenDoorID);
|
||||
this.blocksImmuneToRift.add(properties.PersonalDimDoorID);
|
||||
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockIron.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockGold.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockDiamond.blockID);
|
||||
this.blocksImmuneToRift.add(Block.blockEmerald.blockID);
|
||||
*/
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.blockDimWall);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.blockDimWallPerm);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.dimensionalDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.warpDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.transTrapdoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.unstableDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.blockRift);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.transientDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.goldenDimensionalDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.goldenDoor);
|
||||
this.blocksImmuneToRift.add(mod_pocketDim.personalDimDoor);
|
||||
this.blocksImmuneToRift.add(Blocks.lapis_block);
|
||||
this.blocksImmuneToRift.add(Blocks.iron_block);
|
||||
this.blocksImmuneToRift.add(Blocks.gold_block);
|
||||
this.blocksImmuneToRift.add(Blocks.diamond_block);
|
||||
this.blocksImmuneToRift.add(Blocks.emerald_block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,8 +181,7 @@ public class BlockRift extends Block implements ITileEntityProvider
|
||||
if (random.nextInt(MAX_BLOCK_DESTRUCTION_CHANCE) < BLOCK_DESTRUCTION_CHANCE)
|
||||
{
|
||||
dropWorldThread(world.getBlock(target.getX(), target.getY(), target.getZ()), world, x, y, z, random);
|
||||
//TODO 1.7
|
||||
// world.destroyBlock(target.getX(), target.getY(), target.getZ(), false);
|
||||
world.func_147480_a(target.getX(), target.getY(), target.getZ(), false);//world.destroyBlock
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,14 +281,13 @@ public class BlockRift extends Block implements ITileEntityProvider
|
||||
|
||||
// Create a child, replace the block with a rift, and consider dropping World Thread
|
||||
block = world.getBlock(x, y, z);
|
||||
//TODO 1.7
|
||||
/* if (world.setBlock(x, y, z, properties.RiftBlockID))
|
||||
if (world.setBlock(x, y, z, mod_pocketDim.blockRift))
|
||||
{
|
||||
dimension.createChildLink(x, y, z, parent);
|
||||
dropWorldThread(block, world, x, y, z, random);
|
||||
return true;
|
||||
}
|
||||
*/ }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -375,19 +370,17 @@ public class BlockRift extends Block implements ITileEntityProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO 1.7
|
||||
/*
|
||||
@Override
|
||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
return 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
return 0;
|
||||
}*/
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
|
||||
@@ -15,7 +15,6 @@ public class PersonalDimDoor extends BaseDimDoor
|
||||
public PersonalDimDoor(Material material, DDProperties properties)
|
||||
{
|
||||
super(material, properties);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -16,6 +17,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
@@ -80,7 +82,8 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
if(this.checkCanOpen(par1World, par2, par3, par4, par5EntityPlayer))
|
||||
@@ -90,27 +93,26 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5)
|
||||
@Override
|
||||
public void func_150120_a(World par1World, int par2, int par3, int par4, boolean par5)
|
||||
{
|
||||
if(this.checkCanOpen(par1World, par2, par3, par4))
|
||||
{//TODO 1.7
|
||||
// super.onPoweredBlockChange(par1World, par2, par3, par4, par5);//onPoweredBlockChange
|
||||
{
|
||||
super.func_150120_a(par1World, par2, par3, par4, par5);//onPoweredBlockChange
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void enterDimDoor(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
//TODO 1.7
|
||||
/*
|
||||
if (!world.isRemote && isTrapdoorOpen(world.getBlockMetadata(x, y, z)))
|
||||
if (!world.isRemote && func_150118_d(world.getBlockMetadata(x, y, z)))//isTrapDoorOpen
|
||||
{
|
||||
DimLink link = PocketManager.getLink(x, y, z, world);
|
||||
if (link != null)
|
||||
{
|
||||
DDTeleporter.traverseDimDoor(world, link, entity,this);
|
||||
}
|
||||
super.onPoweredBlockChange(world, x, y, z, false);
|
||||
}*/
|
||||
super.func_150120_a(world, x, y, z, false);//onPoweredBlockChange
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,20 +142,20 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 1.7
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item idPicked(World world, int x, int y, int z)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
return this.getDoorItem();
|
||||
return new ItemStack(this.getDoorItem(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int metadata, Random random, int fortuneLevel)
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
return this.getDrops();
|
||||
}*/
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
drops.add(new ItemStack(this.getDrops(), 1));
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public net.minecraft.item.Item getDoorItem()
|
||||
|
||||
@@ -106,7 +106,6 @@ public class PocketManager
|
||||
@Override
|
||||
public void update(ClientDimData message)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,7 +761,6 @@ public class PocketManager
|
||||
|
||||
public static HashMap<String, NewDimData> getPersonalPocketMapping()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return personalPocketsMapping;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@ public class DispenserBehaviorStabilizedRS extends BehaviorDefaultDispenseItem
|
||||
int x = dispenser.getXInt();
|
||||
int y = dispenser.getYInt();
|
||||
int z = dispenser.getZInt();
|
||||
EnumFacing facing = EnumFacing.EAST;//TODO 1.7
|
||||
// BlockDispenser.getFacing(dispenser.getBlockMetadata());
|
||||
EnumFacing facing = BlockDispenser.func_149937_b(dispenser.getBlockMetadata());//getFacing
|
||||
int dx = facing.getFrontOffsetX();
|
||||
int dy = facing.getFrontOffsetY();
|
||||
int dz = facing.getFrontOffsetZ();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.ticking.*;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -56,10 +59,6 @@ import StevenDimDoors.mod_pocketDim.items.ItemUnstableDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemWarpDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemWorldThread;
|
||||
import StevenDimDoors.mod_pocketDim.items.itemRiftRemover;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.CustomLimboPopulator;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.LimboDecayScheduler;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.RiftRegenerator;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityRift;
|
||||
@@ -149,6 +148,7 @@ public class mod_pocketDim
|
||||
private static LimboDecayScheduler limboDecayScheduler;
|
||||
private static LimboDecay limboDecay;
|
||||
private static EventHookContainer hooks;
|
||||
private static ServerTickHandler serverTickHandler = new ServerTickHandler();
|
||||
|
||||
//TODO this is a temporary workaround for saving data
|
||||
private String currrentSaveRootDirectory;
|
||||
@@ -184,10 +184,10 @@ public class mod_pocketDim
|
||||
|
||||
@EventHandler
|
||||
public void onInitialization(FMLInitializationEvent event)
|
||||
{//TODO 1.7
|
||||
{
|
||||
// Initialize ServerTickHandler instance
|
||||
// serverTickHandler = new ServerTickHandler();
|
||||
// TickRegistry.registerTickHandler(serverTickHandler, Side.SERVER);
|
||||
serverTickHandler = new ServerTickHandler();
|
||||
FMLCommonHandler.instance().bus().register(serverTickHandler);
|
||||
|
||||
// Initialize LimboDecay instance: required for BlockLimbo
|
||||
limboDecay = new LimboDecay(properties);
|
||||
@@ -223,6 +223,21 @@ public class mod_pocketDim
|
||||
itemRiftBlade = (new ItemRiftBlade(properties)).setUnlocalizedName("ItemRiftBlade");
|
||||
itemStabilizedRiftSignature = (new ItemStabilizedRiftSignature()).setUnlocalizedName("itemStabilizedRiftSig");
|
||||
itemWorldThread = (new ItemWorldThread()).setUnlocalizedName("itemWorldThread");
|
||||
|
||||
GameRegistry.registerItem(itemDDKey, "itemDDKey");
|
||||
GameRegistry.registerItem(itemQuartzDoor, "quartzDoor");
|
||||
GameRegistry.registerItem(itemPersonalDoor, "personalDoor");
|
||||
GameRegistry.registerItem(itemGoldenDoor, "goldenDoor");
|
||||
GameRegistry.registerItem(itemGoldenDimensionalDoor, "goldenDimDoor");
|
||||
GameRegistry.registerItem(itemDimensionalDoor, "dimDoor");
|
||||
GameRegistry.registerItem(itemWarpDoor, "warpDoor");
|
||||
GameRegistry.registerItem(itemRiftSignature, "riftSignature");
|
||||
GameRegistry.registerItem(itemRiftRemover, "riftRemover");
|
||||
GameRegistry.registerItem(itemStableFabric, "stableFabric");
|
||||
GameRegistry.registerItem(itemUnstableDoor, "unstabledoor");
|
||||
GameRegistry.registerItem(itemRiftBlade, "riftBlade");
|
||||
GameRegistry.registerItem(itemStabilizedRiftSignature, "stabilizedRiftSignature");
|
||||
GameRegistry.registerItem(itemWorldThread, "worldThread");
|
||||
|
||||
// Check if other biomes have been registered with the same IDs we want. If so, crash Minecraft
|
||||
// to notify the user instead of letting it pass and conflicting with Biomes o' Plenty.
|
||||
@@ -232,20 +247,20 @@ public class mod_pocketDim
|
||||
mod_pocketDim.limboBiome = (new BiomeGenLimbo(properties.LimboBiomeID));
|
||||
mod_pocketDim.pocketBiome = (new BiomeGenPocket(properties.PocketBiomeID));
|
||||
|
||||
GameRegistry.registerBlock(quartzDoor, "Quartz Door");
|
||||
GameRegistry.registerBlock(personalDimDoor, "Personal Dimensional Door");
|
||||
GameRegistry.registerBlock(goldenDoor, "Golden Door");
|
||||
GameRegistry.registerBlock(goldenDimensionalDoor, "Golden Dimensional Door");
|
||||
GameRegistry.registerBlock(unstableDoor, "Unstable Door");
|
||||
GameRegistry.registerBlock(warpDoor, "Warp Door");
|
||||
GameRegistry.registerBlock(quartzDoor, "Quartz_Door");
|
||||
GameRegistry.registerBlock(personalDimDoor, "Personal_Dimensional_Door");
|
||||
GameRegistry.registerBlock(goldenDoor, "Golden_Door");
|
||||
GameRegistry.registerBlock(goldenDimensionalDoor, "Golden_Dimensional_Door");
|
||||
GameRegistry.registerBlock(unstableDoor, "Unstable_Door");
|
||||
GameRegistry.registerBlock(warpDoor, "Warp_Door");
|
||||
GameRegistry.registerBlock(blockRift, "Rift");
|
||||
GameRegistry.registerBlock(blockLimbo, "Unraveled Fabric");
|
||||
GameRegistry.registerBlock(dimensionalDoor, "Dimensional Door");
|
||||
GameRegistry.registerBlock(transTrapdoor,"Transdimensional Trapdoor");
|
||||
GameRegistry.registerBlock(blockDimWallPerm, "Fabric of RealityPerm");
|
||||
GameRegistry.registerBlock(blockLimbo, "Unraveled_Fabric");
|
||||
GameRegistry.registerBlock(dimensionalDoor, "Dimensional_Door");
|
||||
GameRegistry.registerBlock(transTrapdoor,"Transdimensional_Trapdoor");
|
||||
GameRegistry.registerBlock(blockDimWallPerm, "Fabric_of_RealityPerm");
|
||||
GameRegistry.registerBlock(transientDoor, "transientDoor");
|
||||
|
||||
GameRegistry.registerBlock(blockDimWall, ItemBlockDimWall.class, "Fabric of Reality");
|
||||
GameRegistry.registerBlock(blockDimWall, ItemBlockDimWall.class, "Fabric_of_Reality");
|
||||
|
||||
if (!DimensionManager.registerProviderType(properties.PocketProviderID, PocketProvider.class, false))
|
||||
throw new IllegalStateException("There is a provider ID conflict between PocketProvider from Dimensional Doors and another provider type. Fix your configuration!");
|
||||
@@ -305,13 +320,11 @@ public class mod_pocketDim
|
||||
|
||||
CraftingManager.registerRecipes(properties);
|
||||
CraftingManager.registerDispenserBehaviors();
|
||||
//TODO 1.7
|
||||
// GameRegistry.registerCraftingHandler(new CraftingManager());
|
||||
FMLCommonHandler.instance().bus().register(new CraftingManager());
|
||||
|
||||
DungeonHelper.initialize();
|
||||
gatewayGenerator = new GatewayGenerator(properties);
|
||||
//TODO 1.7
|
||||
// GameRegistry.registerWorldGenerator(mod_pocketDim.gatewayGenerator);
|
||||
GameRegistry.registerWorldGenerator(mod_pocketDim.gatewayGenerator, 9);
|
||||
|
||||
// Register loot chests
|
||||
DDLoot.registerInfo(properties);
|
||||
@@ -371,8 +384,7 @@ public class mod_pocketDim
|
||||
|
||||
// Unregister all tick receivers from serverTickHandler to avoid leaking
|
||||
// scheduled tasks between single-player game sessions
|
||||
//TODO 1.7
|
||||
// serverTickHandler.unregisterReceivers();
|
||||
serverTickHandler.unregisterReceivers();
|
||||
spawner = null;
|
||||
riftRegenerator = null;
|
||||
limboDecayScheduler = null;
|
||||
@@ -396,12 +408,10 @@ public class mod_pocketDim
|
||||
|
||||
// Register regular tick receivers
|
||||
// CustomLimboPopulator should be initialized before any provider instances are created
|
||||
//TODO 1.7
|
||||
/*
|
||||
spawner = new CustomLimboPopulator(serverTickHandler, properties);
|
||||
riftRegenerator = new RiftRegenerator(serverTickHandler, blockRift);
|
||||
limboDecayScheduler = new LimboDecayScheduler(serverTickHandler, limboDecay);
|
||||
*/
|
||||
|
||||
hooks.setSessionFields(worldProperties, riftRegenerator);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
/*
|
||||
|
||||
package StevenDimDoors.mod_pocketDim.ticking;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class ServerTickHandler implements ITickHandler, IRegularTickSender
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ServerTickHandler implements IRegularTickSender
|
||||
{
|
||||
//TODO rewrite for 1.7
|
||||
|
||||
private static final String PROFILING_LABEL = "Dimensional Doors: Server Tick";
|
||||
|
||||
private int tickCount = 0;
|
||||
@@ -36,31 +33,31 @@ public class ServerTickHandler implements ITickHandler, IRegularTickSender
|
||||
receivers.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
if (type.equals(EnumSet.of(TickType.SERVER)))
|
||||
@SubscribeEvent
|
||||
public void tickStart(TickEvent.WorldTickEvent event) {
|
||||
if(!event.phase.equals(TickEvent.Phase.START))
|
||||
return;
|
||||
|
||||
for(RegularTickReceiverInfo info : receivers)
|
||||
{
|
||||
for (RegularTickReceiverInfo info : receivers)
|
||||
{
|
||||
if (info.OnTickStart && tickCount % info.Interval == 0)
|
||||
{
|
||||
info.RegularTickReceiver.notifyTick();
|
||||
}
|
||||
}
|
||||
if( info.OnTickStart && tickCount % info.Interval == 0)
|
||||
info.RegularTickReceiver.notifyTick();
|
||||
}
|
||||
|
||||
|
||||
//TODO: Stuck this in here because it's already rather hackish.
|
||||
//We should standardize this as an IRegularTickReceiver in the future. ~SenseiKiwi
|
||||
if (DDTeleporter.cooldown > 0)
|
||||
{
|
||||
DDTeleporter.cooldown--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.WorldTickEvent event) {
|
||||
if(!event.phase.equals(TickEvent.Phase.END))
|
||||
return;
|
||||
|
||||
for (RegularTickReceiverInfo info : receivers)
|
||||
{
|
||||
if (!info.OnTickStart && tickCount % info.Interval == 0)
|
||||
@@ -71,16 +68,4 @@ public class ServerTickHandler implements ITickHandler, IRegularTickSender
|
||||
tickCount++; //There is no need to reset the counter. Let it overflow.
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks()
|
||||
{
|
||||
return EnumSet.of(TickType.SERVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel()
|
||||
{
|
||||
return PROFILING_LABEL; //Used for profiling!
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -83,8 +83,7 @@ public class GatewayGenerator implements IWorldGenerator
|
||||
|
||||
// Check if we're allowed to generate rift clusters in this dimension.
|
||||
// If so, randomly decide whether to one.
|
||||
if (mod_pocketDim.worldProperties.RiftClusterDimensions.isAccepted(dimensionID)
|
||||
&& random.nextInt(MAX_CLUSTER_GENERATION_CHANCE) < properties.ClusterGenerationChance)
|
||||
if (mod_pocketDim.worldProperties.RiftClusterDimensions.isAccepted(dimensionID) && random.nextInt(MAX_CLUSTER_GENERATION_CHANCE) < properties.ClusterGenerationChance)
|
||||
{
|
||||
link = null;
|
||||
dimension = null;
|
||||
@@ -120,8 +119,9 @@ public class GatewayGenerator implements IWorldGenerator
|
||||
|
||||
// Check if we can place a Rift Gateway in this dimension, then randomly decide whether to place one.
|
||||
// This only happens if a rift cluster was NOT generated.
|
||||
else if (mod_pocketDim.worldProperties.RiftGatewayDimensions.isAccepted(dimensionID) &&
|
||||
random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance)
|
||||
else if (mod_pocketDim.worldProperties.RiftGatewayDimensions.isAccepted(dimensionID) )
|
||||
//TODO reenable 1.7 testing
|
||||
//&& random.nextInt(MAX_GATEWAY_GENERATION_CHANCE) < properties.GatewayGenerationChance)
|
||||
{
|
||||
valid = false;
|
||||
x = y = z = 0; //Stop the compiler from freaking out
|
||||
|
||||
@@ -28,7 +28,6 @@ public class ClientPacketHandler
|
||||
@Override
|
||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
// TODO: Is this even necessary? I'm not convinced we can receive packets from other channels anyway!
|
||||
if (!packet.channel.equals(PacketConstants.CHANNEL_NAME))
|
||||
return;
|
||||
|
||||
|
||||
@@ -145,14 +145,12 @@ public class PrivatePocketRender implements ISimpleBlockRenderingHandler
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelid)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return renderID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user