Finished Server mode

Also added World Thread
This commit is contained in:
StevenRS11 2013-11-06 15:16:07 -05:00
parent e3df3cad08
commit 59489f290f
7 changed files with 175 additions and 122 deletions

View file

@ -0,0 +1,135 @@
package StevenDimDoors.mod_pocketDim;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import static StevenDimDoors.mod_pocketDim.mod_pocketDim.*;
public class CraftingManager
{
public static void registerRecipies()
{
Item coreCraftingItem = Item.enderPearl;
if(properties.enableServerMode)
{
coreCraftingItem = itemWorldThread;
}
if (properties.CraftingDimensionalDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', coreCraftingItem, 'y', Item.doorIron
});
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorIron
});
}
if(properties.CraftingUnstableDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', mod_pocketDim.itemDimDoor
});
}
if(properties.CraftingWarpDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', coreCraftingItem, 'y', Item.doorWood
});
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorWood
});
}
if(properties.CraftingTransTrapdoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(transTrapdoor, 1), new Object[]
{
" y ", " x ", " y ", 'x', coreCraftingItem, 'y', Block.trapdoor
});
GameRegistry.addRecipe(new ItemStack(transTrapdoor, 1), new Object[]
{
" y ", " x ", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Block.trapdoor
});
}
if(properties.CraftingRiftSignatureAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', coreCraftingItem, 'y', Item.ingotIron
});
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotIron
});
}
if(properties.CraftingRiftRemoverAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
" y ", "yxy", " y ", 'x', coreCraftingItem, 'y', Item.ingotGold
});
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
"yyy", "yxy", "yyy", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotGold
});
}
if (properties.CraftingRiftBladeAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
{
" x ", " x ", " y ", 'x', coreCraftingItem, 'y',mod_pocketDim.itemRiftRemover
});
}
if (properties.CraftingStableFabricAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 1), new Object[]
{
" y ", "yxy", " y ", 'x', coreCraftingItem, 'y', mod_pocketDim.itemWorldThread
});
}
if (properties.CraftingStabilizedRiftSignatureAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemStabilizedLinkSignature,1), new Object[]
{
" y ", "yxy", " y ", 'x', mod_pocketDim.itemLinkSignature, 'y', mod_pocketDim.itemStableFabric
});
}
if (properties.CraftingGoldDimDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDimDoor,1), new Object[]
{
" x ", " y ", " x ", 'x', mod_pocketDim.itemGoldDoor, 'y', Item.eyeOfEnder
});
}
if (properties.CraftingGoldDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
{
"yy ", "yy ", "yy ", 'y', Item.ingotGold
});
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
{
" yy", " yy", " yy", 'y', Item.ingotGold
});
}
}
}

View file

@ -43,6 +43,8 @@ public class DDProperties
public final int DimensionalDoorItemID;
public final int UnstableDoorItemID;
public final int WarpDoorItemID;
public final int ItemWorldThreadID;
/**
* Other IDs
@ -91,6 +93,7 @@ public class DDProperties
* Other Flags
*/
public final boolean enableServerMode;
public final boolean WorldRiftGenerationEnabled;
public final boolean RiftSpreadEnabled;
public final boolean RiftGriefingEnabled;
@ -100,6 +103,7 @@ public class DDProperties
public final boolean LimboReturnsInventoryEnabled;
public final boolean DoorRenderingEnabled;
public final boolean TNFREAKINGT_Enabled;
/**
* Other
@ -112,11 +116,13 @@ public class DDProperties
public final int LimboReturnRange;
public final String CustomSchematicDirectory;
//Singleton instance
private static DDProperties instance = null;
//Path for custom dungeons within configuration directory
private final String CUSTOM_SCHEMATIC_SUBDIRECTORY = "/DimDoors_Custom_schematics";
//Names of categories
private final String CATEGORY_SERVERMODE = "server mode";
private final String CATEGORY_CRAFTING = "crafting";
private final String CATEGORY_ENTITY = "entity";
private final String CATEGORY_DIMENSION = "dimension";
@ -178,6 +184,11 @@ public class DDProperties
"Weighs the chance that a block will not be TNT. Must be greater than or equal to 0. " +
"EXPLOSIONS must be set to true for this to have any effect.").getInt();
enableServerMode = config.get(CATEGORY_SERVERMODE, "Server Mode", false,
"Enables servermode, changing all crafting recipies to require stabilized fabric. " +
"Stabilized fabric, in turn, requires the item World Thread, which is not craftable or obtainable at all. "+
"It is up to the server manager on how to distribute it.").getBoolean(false);
DoorRenderEntityID=config.get(CATEGORY_ENTITY, "Door Render Entity ID", 89).getInt();
MonolithEntityID = config.get(CATEGORY_ENTITY, "Monolith Entity ID", 125).getInt();
@ -201,7 +212,8 @@ public class DDProperties
StabilizedRiftSignatureItemID = config.getItem("Stabilized Rift Signature Item ID", 5677).getInt();
GoldDoorItemID = config.getItem("Gold Door Item ID", 5678).getInt();
GoldDimDoorItemID = config.getItem("Gold Dim Door Item ID", 5679).getInt();
ItemWorldThreadID = config.getItem("World Thread Item ID", 5680).getInt();
LimboBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256", "Limbo Block ID", 217,
"Blocks used for the terrain in Limbo").getInt();
PermaFabricBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256",

View file

@ -53,9 +53,7 @@ public class ChunkLoaderHelper implements LoadingCallback
PocketManager.loadDimension(data.id());
}
}
}
}
}
}

View file

@ -0,0 +1,19 @@
package StevenDimDoors.mod_pocketDim.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
public class ItemWorldThread extends Item
{
public ItemWorldThread(int itemID)
{
super(itemID);
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
}
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
}
}

View file

@ -44,6 +44,7 @@ import StevenDimDoors.mod_pocketDim.items.ItemStabilizedRiftSignature;
import StevenDimDoors.mod_pocketDim.items.ItemStableFabric;
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.CommonTickHandler;
import StevenDimDoors.mod_pocketDim.ticking.LimboDecay;
@ -117,6 +118,8 @@ public class mod_pocketDim
public static Item itemGoldDimDoor;
public static Item itemGoldDoor;
public static Item itemWorldThread;
public static Item itemRiftBlade;
public static Item itemDimDoor;
public static Item itemExitDoor;
@ -201,7 +204,9 @@ public class mod_pocketDim
itemChaosDoor = (new ItemUnstableDoor(properties.UnstableDoorItemID, Material.iron)).setUnlocalizedName("itemChaosDoor");
itemRiftBlade = (new ItemRiftBlade(properties.RiftBladeItemID, EnumToolMaterial.GOLD, properties)).setUnlocalizedName("ItemRiftBlade");
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig");
itemWorldThread = (new ItemWorldThread(properties.ItemWorldThreadID)).setUnlocalizedName("itemWorldThread");
mod_pocketDim.limboBiome= (new BiomeGenLimbo(properties.LimboBiomeID));
mod_pocketDim.pocketBiome= (new BiomeGenPocket(properties.PocketBiomeID));
@ -246,6 +251,8 @@ public class mod_pocketDim
LanguageRegistry.addName(itemChaosDoor , "Unstable Door");
LanguageRegistry.addName(itemDimDoor, "Dimensional Door");
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
LanguageRegistry.addName(itemWorldThread, "World Thread");
/**
* Add names for multiblock inventory item
@ -266,120 +273,8 @@ public class mod_pocketDim
EntityList.entityEggs.put(properties.MonolithEntityID, new EntityEggInfo(properties.MonolithEntityID, 0, 0xffffff));
LanguageRegistry.instance().addStringLocalization("entity.DimDoors.Obelisk.name", "Monolith");
//GameRegistry.addBiome(this.limboBiome);
//GameRegistry.addBiome(this.pocketBiome);
if (properties.CraftingDimensionalDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorIron
});
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorIron
});
}
if(properties.CraftingUnstableDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', mod_pocketDim.itemDimDoor
});
}
if(properties.CraftingWarpDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', Item.enderPearl, 'y', Item.doorWood
});
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
{
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorWood
});
}
if(properties.CraftingTransTrapdoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(transTrapdoor, 1), new Object[]
{
" y ", " x ", " y ", 'x', Item.enderPearl, 'y', Block.trapdoor
});
GameRegistry.addRecipe(new ItemStack(transTrapdoor, 1), new Object[]
{
" y ", " x ", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Block.trapdoor
});
}
if(properties.CraftingRiftSignatureAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotIron
});
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
{
" y ", "yxy", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotIron
});
}
if(properties.CraftingRiftRemoverAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', Item.ingotGold
});
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
{
"yyy", "yxy", "yyy", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotGold
});
}
if (properties.CraftingRiftBladeAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
{
" x ", " x ", " y ", 'x', Item.enderPearl, 'y',mod_pocketDim.itemRiftRemover
});
}
if (properties.CraftingStableFabricAllowed)
{
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
{
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', mod_pocketDim.blockDimWall
});
}
if (properties.CraftingStabilizedRiftSignatureAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemStabilizedLinkSignature,1), new Object[]
{
" y ", "yxy", " y ", 'x', mod_pocketDim.itemLinkSignature, 'y', mod_pocketDim.itemStableFabric
});
}
if (properties.CraftingGoldDimDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDimDoor,1), new Object[]
{
" x ", " y ", " x ", 'x', mod_pocketDim.itemGoldDoor, 'y', Item.eyeOfEnder
});
}
if (properties.CraftingGoldDoorAllowed)
{
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
{
"yy ", "yy ", "yy ", 'y', Item.ingotGold
});
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemGoldDoor,1), new Object[]
{
" yy", " yy", " yy", 'y', Item.ingotGold
});
}
CraftingManager.registerRecipies();
DungeonHelper.initialize();
proxy.loadTextures();

View file

@ -1,6 +0,0 @@
package StevenDimDoors.mod_pocketDim.world;
public class ItemWorldThread
{
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB