Added creative tab
This commit is contained in:
@@ -32,7 +32,7 @@ public class BlockLimbo extends Block
|
||||
{
|
||||
super(i, Material.ground);
|
||||
setTickRandomly(false);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ public class ExitDoor extends dimDoor
|
||||
{
|
||||
|
||||
super(par1, Material.wood);
|
||||
// this.blockIndexInTexture = 19;
|
||||
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
@@ -21,7 +21,7 @@ public class dimHatch extends BlockTrapDoor
|
||||
public dimHatch(int par1,int par2, Material par2Material)
|
||||
{
|
||||
super(par1, Material.iron);
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
// this.blockIndexInTexture = 16;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,10 @@ public class linkDimDoor extends dimDoor
|
||||
{
|
||||
private Icon blockIconBottom;
|
||||
public linkDimDoor(int par1, Material material) {
|
||||
|
||||
super(par1, material);
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class linkExitDoor extends ExitDoor
|
||||
//this.blockIndexInTexture = 20;
|
||||
|
||||
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -532,8 +532,7 @@ public class DungeonHelper
|
||||
int depth = dimHelper.instance.getDimDepth(incoming.locDimID);
|
||||
int depthWeight = rand.nextInt(depth + 2) + rand.nextInt(depth + 2) - 2;
|
||||
|
||||
ArrayList array = getDungeonDataBelow(dimHelper.dimList.get(incoming.destDimID));
|
||||
array.hashCode();
|
||||
|
||||
int count = 10;
|
||||
boolean flag = true;
|
||||
try
|
||||
@@ -651,6 +650,11 @@ public class DungeonHelper
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if(getDungeonDataInChain(dimHelper.dimList.get(incoming.locDimID)).contains(dungeon))
|
||||
{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
while (!flag && count > 0);
|
||||
}
|
||||
@@ -721,13 +725,13 @@ public class DungeonHelper
|
||||
WeightedContainer<DungeonGenerator> resultContainer = (WeightedContainer<DungeonGenerator>) WeightedRandom.getRandomItem(random, weights);
|
||||
return (resultContainer != null) ? resultContainer.getData() : null;
|
||||
}
|
||||
public static ArrayList<DungeonGenerator> getDungeonDataBelow(DimData dimData)
|
||||
public static ArrayList<DungeonGenerator> getDungeonDataInChain(DimData dimData)
|
||||
{
|
||||
DimData startingDim = dimHelper.dimList.get(dimHelper.instance.getLinkDataFromCoords(dimData.exitDimLink.destXCoord, dimData.exitDimLink.destYCoord, dimData.exitDimLink.destZCoord, dimData.exitDimLink.destDimID).destDimID);
|
||||
|
||||
return getDungeonDataAbove(startingDim);
|
||||
return getDungeonDataBelow(startingDim);
|
||||
}
|
||||
private static ArrayList<DungeonGenerator> getDungeonDataAbove(DimData dimData)
|
||||
private static ArrayList<DungeonGenerator> getDungeonDataBelow(DimData dimData)
|
||||
{
|
||||
ArrayList<DungeonGenerator> dungeonData = new ArrayList<DungeonGenerator>();
|
||||
if(dimData.dungeonGenerator!=null)
|
||||
@@ -740,7 +744,7 @@ public class DungeonHelper
|
||||
{
|
||||
if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null&&dimHelper.instance.getDimDepth(link.destDimID)==dimData.depth+1)
|
||||
{
|
||||
for(DungeonGenerator dungeonGen :getDungeonDataAbove(dimHelper.dimList.get(link.destDimID)) )
|
||||
for(DungeonGenerator dungeonGen :getDungeonDataBelow(dimHelper.dimList.get(link.destDimID)) )
|
||||
{
|
||||
if(!dungeonData.contains(dungeonGen))
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ItemChaosDoor extends itemDimDoor
|
||||
{
|
||||
super(par1, par2Material);
|
||||
this.doorMaterial = par2Material;
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
}
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ItemRiftBlade extends itemDimDoor
|
||||
super(par1, par2Material);
|
||||
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
// this.itemIcon=5;
|
||||
|
||||
@@ -27,14 +27,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
{
|
||||
super(par);
|
||||
this.setMaxStackSize(1);
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
|
||||
// this.itemIndex=5;
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
this.setMaxDamage(0);
|
||||
this.hasSubtypes=true;
|
||||
//TODO move to proxy
|
||||
|
||||
if (properties == null)
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
@@ -44,8 +39,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
// adds effect if item has a link stored
|
||||
|
||||
|
||||
if(par1ItemStack.hasTagCompound())
|
||||
{
|
||||
if(par1ItemStack.stackTagCompound.getBoolean("isCreated"))
|
||||
@@ -56,11 +49,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,18 +60,8 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
int key;
|
||||
LinkData linkData;
|
||||
int thisWorldID=par3World.provider.dimensionId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//par1ItemStack= par2EntityPlayer.getCurrentEquippedItem();
|
||||
Integer[] linkCoords =this.readFromNBT(par1ItemStack);
|
||||
|
||||
|
||||
|
||||
//System.out.println(key);
|
||||
int offset = 2;
|
||||
if(par1ItemStack.getTagCompound()!=null)
|
||||
{
|
||||
@@ -88,19 +69,14 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
{
|
||||
boolean hasEnder = false;
|
||||
// checks to see if the item has a link stored, if so, it creates it
|
||||
|
||||
if(par2EntityPlayer.inventory.hasItem(Item.enderPearl.itemID)||par2EntityPlayer.inventory.hasItem(properties.StableFabricItemID))
|
||||
{
|
||||
if(!par2EntityPlayer.inventory.consumeInventoryItem(properties.StableFabricItemID))
|
||||
|
||||
{
|
||||
par2EntityPlayer.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
||||
|
||||
}
|
||||
hasEnder=true;
|
||||
}
|
||||
|
||||
|
||||
if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID)
|
||||
{
|
||||
offset = 1;
|
||||
@@ -110,7 +86,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
if(dimHelper.instance.getLinkDataFromCoords(linkCoords[0], linkCoords[1], linkCoords[2], par3World)==null)
|
||||
{
|
||||
dimHelper.instance.createLink(linkCoords[3], par3World.provider.dimensionId, linkCoords[0], linkCoords[1], linkCoords[2],par4, par5+offset, par6);
|
||||
|
||||
}
|
||||
dimHelper.instance.createLink(par3World.provider.dimensionId, linkCoords[3], par4, par5+offset, par6, linkCoords[0], linkCoords[1], linkCoords[2]);
|
||||
par2EntityPlayer.sendChatToPlayer("Rift Created");
|
||||
@@ -119,11 +94,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
{
|
||||
par2EntityPlayer.sendChatToPlayer("No Ender Pearls!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if(!par3World.isRemote)
|
||||
@@ -135,21 +105,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
//otherwise, it creates the first half of the link. Next click will complete it.
|
||||
key= dimHelper.instance.createUniqueInterDimLinkKey();
|
||||
this.writeToNBT(par1ItemStack, par4, par5+offset, par6,par3World.provider.dimensionId);
|
||||
|
||||
|
||||
|
||||
par2EntityPlayer.sendChatToPlayer("Rift Signature Stored");
|
||||
|
||||
|
||||
}
|
||||
|
||||
//dimHelper.instance.save();
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -159,7 +117,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
*/
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
||||
if(par1ItemStack.hasTagCompound())
|
||||
{
|
||||
if(par1ItemStack.stackTagCompound.getBoolean("isCreated"))
|
||||
@@ -167,9 +124,7 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
Integer[] coords = this.readFromNBT(par1ItemStack);
|
||||
par3List.add(String.valueOf("Leads to dim "+coords[3] +" with depth "+dimHelper.instance.getDimDepth(dimHelper.instance.getDimDepth(coords[3]))));
|
||||
par3List.add("at x="+coords[0]+" y="+coords[1]+" z="+coords[2]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -177,8 +132,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
par3List.add ("second click creates two rifts,");
|
||||
par3List.add("that link the first location");
|
||||
par3List.add("with the second location");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,21 +142,17 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
if(itemStack.hasTagCompound())
|
||||
{
|
||||
tag = itemStack.getTagCompound();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
tag= new NBTTagCompound();
|
||||
}
|
||||
|
||||
tag.setInteger("linkX", x);
|
||||
tag.setInteger("linkY", y);
|
||||
tag.setInteger("linkZ", z);
|
||||
tag.setInteger("linkDimID", dimID);
|
||||
tag.setBoolean("isCreated", true);
|
||||
|
||||
itemStack.setTagCompound(tag);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,7 +160,6 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
*/
|
||||
public Integer[] readFromNBT(ItemStack itemStack)
|
||||
{
|
||||
|
||||
NBTTagCompound tag;
|
||||
Integer[] linkCoords = new Integer[5];
|
||||
if(itemStack.hasTagCompound())
|
||||
@@ -226,11 +174,8 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||
linkCoords[1]=tag.getInteger("linkY");
|
||||
linkCoords[2]=tag.getInteger("linkZ");
|
||||
linkCoords[3]=tag.getInteger("linkDimID");
|
||||
|
||||
|
||||
}
|
||||
return linkCoords;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemStableFabric extends Item
|
||||
{
|
||||
super(par1);
|
||||
// this.setitemIcon(Item.doorWood.getIconFromDamage(0));
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
}
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
|
||||
@@ -31,7 +31,7 @@ public class itemDimDoor extends ItemDoor
|
||||
{
|
||||
super(par1, par2Material);
|
||||
this.setMaxStackSize(64);
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
if (properties == null)
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class itemExitDoor extends itemDimDoor
|
||||
{
|
||||
super(par1, par2Material);
|
||||
this.doorMaterial = par2Material;
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class itemLinkSignature extends Item
|
||||
super(par1);
|
||||
this.setMaxStackSize(1);
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
// this.itemIcon=5;
|
||||
this.setMaxDamage(0);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class itemRiftRemover extends Item
|
||||
super(par1);
|
||||
this.setMaxStackSize(1);
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
// this.itemIcon=6;
|
||||
this.setMaxDamage(5);
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -134,6 +135,23 @@ public class mod_pocketDim
|
||||
public static long genTime;
|
||||
public static int teleTimer = 0;
|
||||
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(mod_pocketDim.itemDimDoor, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslatedTabLabel()
|
||||
{
|
||||
return "Dimensional Doors";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@PreInit
|
||||
public void PreInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
@@ -218,6 +236,8 @@ public class mod_pocketDim
|
||||
LanguageRegistry.addName(itemDimDoor, "Dimensional Door");
|
||||
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.dimDoorsCustomTab", "en_US", "Dimensional Doors Items");
|
||||
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
TickRegistry.registerTickHandler(new CommonTickHandler(), Side.SERVER);
|
||||
|
||||
@@ -403,13 +423,13 @@ public class mod_pocketDim
|
||||
CommandPrintDimensionData.instance().register(event);
|
||||
CommandPruneDimensions.instance().register(event);
|
||||
CommandStartDungeonCreation.instance().register(event);
|
||||
|
||||
dimHelper.instance.load();
|
||||
|
||||
if(!dimHelper.dimList.containsKey(properties.LimboDimensionID))
|
||||
{
|
||||
dimHelper.dimList.put(properties.LimboDimensionID, new DimData( properties.LimboDimensionID, false, 0, new LinkData()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user