package name changes

This commit is contained in:
Robert 2013-12-18 21:01:41 -05:00
parent b7d6a8c6cf
commit 425edd2bd6
19 changed files with 128 additions and 125 deletions

View file

@ -30,10 +30,10 @@ public class CoreRegistry
public static HashMap<Block, String> registredBlocks = new HashMap<Block, String>(); public static HashMap<Block, String> registredBlocks = new HashMap<Block, String>();
public static HashMap<Item, String> registredItems = new HashMap<Item, String>(); public static HashMap<Item, String> registredItems = new HashMap<Item, String>();
@SidedProxy(clientSide = "dark.core.ClientRegistryProxy", serverSide = "dark.core.RegistryProxy") @SidedProxy(clientSide = "com.dark.ClientRegistryProxy", serverSide = "com.dark.RegistryProxy")
public static RegistryProxy proxy; public static RegistryProxy proxy;
public static Configuration masterBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/EnabledBlocks.cfg")); public static Configuration masterBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/EnabledBlocks.cfg"));
public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass) public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass)
{ {
@ -78,13 +78,14 @@ public class CoreRegistry
return block; return block;
} }
/** Finishes the creation of the block loading config files and tile entities */
public static void finishCreation(Block block) public static void finishCreation(Block block)
{ {
if (block instanceof IExtraInfo) if (block instanceof IExtraInfo)
{ {
if (((IExtraInfo) block).hasExtraConfigs()) if (((IExtraInfo) block).hasExtraConfigs())
{ {
Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/blocks/" + block.getUnlocalizedName() + ".cfg")); Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/blocks/" + block.getUnlocalizedName() + ".cfg"));
extraBlockConfig.load(); extraBlockConfig.load();
((IExtraInfo) block).loadExtraConfigs(extraBlockConfig); ((IExtraInfo) block).loadExtraConfigs(extraBlockConfig);
extraBlockConfig.save(); extraBlockConfig.save();
@ -120,22 +121,11 @@ public class CoreRegistry
return null; return null;
} }
/** Method to get block via id /** Creates a new fluid block using the prefab following a few conditions.
* *
* @param blockID * @param modDomainPrefix - prefix of the mod, used for texture refrence and block registry
* @return Block requested */ * @param config - config file to pull the blockID from
public static Block getBlock(int blockID) * @param fluid - fluid to link to this block */
{
for (Entry<Block, String> entry : registredBlocks.entrySet())
{
if (entry.getKey().blockID == blockID)
{
return entry.getKey();
}
}
return null;
}
public static Block createNewFluidBlock(String modDomainPrefix, Configuration config, Fluid fluid) public static Block createNewFluidBlock(String modDomainPrefix, Configuration config, Fluid fluid)
{ {
Block fluidBlock = null; Block fluidBlock = null;
@ -193,7 +183,7 @@ public class CoreRegistry
{ {
if (((IExtraInfo) item).hasExtraConfigs()) if (((IExtraInfo) item).hasExtraConfigs())
{ {
Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/items/" + item.getUnlocalizedName() + ".cfg")); Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/items/" + item.getUnlocalizedName() + ".cfg"));
extraBlockConfig.load(); extraBlockConfig.load();
((IExtraInfo) item).loadExtraConfigs(extraBlockConfig); ((IExtraInfo) item).loadExtraConfigs(extraBlockConfig);
extraBlockConfig.save(); extraBlockConfig.save();

View file

@ -8,8 +8,8 @@ import universalelectricity.core.UniversalElectricity;
import com.dark.fluid.FluidHelper; import com.dark.fluid.FluidHelper;
import com.dark.helpers.PlayerKeyHandler; import com.dark.helpers.PlayerKeyHandler;
import com.dark.prefab.tile.network.NetworkUpdateHandler;
import com.dark.save.SaveManager; import com.dark.save.SaveManager;
import com.dark.tilenetwork.prefab.NetworkUpdateHandler;
import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;

View file

@ -20,7 +20,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public interface IExtraInfo public interface IExtraInfo
{ {
/** True will cause a config file to be generated for this block */ /** Does this object need to generate a settings config */
public boolean hasExtraConfigs(); public boolean hasExtraConfigs();
/** Loads the config file for this block. This is a single config file that is tied to just this /** Loads the config file for this block. This is a single config file that is tied to just this

View file

@ -1,68 +0,0 @@
package com.dark;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class IndustryCreativeTab extends CreativeTabs
{
public ItemStack itemStack = new ItemStack(Item.ingotIron, 1, 0);
private static IndustryCreativeTab tabAutomation = new IndustryCreativeTab("Automation");
private static IndustryCreativeTab tabIndustrial = new IndustryCreativeTab("Industrial");
private static IndustryCreativeTab tabHydrualic = new IndustryCreativeTab("Hydraulic");
private static IndustryCreativeTab tabMining = new IndustryCreativeTab("Mining");
public IndustryCreativeTab(String label)
{
super(label);
}
@Override
public ItemStack getIconItemStack()
{
return this.itemStack;
}
public void setIconItemStack(ItemStack stack)
{
this.itemStack = stack;
}
public static IndustryCreativeTab tabAutomation()
{
if (tabAutomation == null)
{
tabAutomation = new IndustryCreativeTab("Automation");
}
return tabAutomation;
}
public static IndustryCreativeTab tabIndustrial()
{
if (tabIndustrial == null)
{
tabIndustrial = new IndustryCreativeTab("Industrial");
}
return tabIndustrial;
}
public static IndustryCreativeTab tabHydraulic()
{
if (tabHydrualic == null)
{
tabHydrualic = new IndustryCreativeTab("Hydraulic");
}
return tabHydrualic;
}
public static IndustryCreativeTab tabMining()
{
if (tabMining == null)
{
tabMining = new IndustryCreativeTab("Mining");
}
return tabMining;
}
}

View file

@ -0,0 +1,68 @@
package com.dark;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class IndustryTabs extends CreativeTabs
{
public ItemStack itemStack = new ItemStack(Item.ingotIron, 1, 0);
private static IndustryTabs tabAutomation = new IndustryTabs("Automation");
private static IndustryTabs tabIndustrial = new IndustryTabs("Industrial");
private static IndustryTabs tabHydrualic = new IndustryTabs("Hydraulic");
private static IndustryTabs tabMining = new IndustryTabs("Mining");
public IndustryTabs(String label)
{
super(label);
}
@Override
public ItemStack getIconItemStack()
{
return this.itemStack;
}
public void setIconItemStack(ItemStack stack)
{
this.itemStack = stack;
}
public static IndustryTabs tabAutomation()
{
if (tabAutomation == null)
{
tabAutomation = new IndustryTabs("Automation");
}
return tabAutomation;
}
public static IndustryTabs tabIndustrial()
{
if (tabIndustrial == null)
{
tabIndustrial = new IndustryTabs("Industrial");
}
return tabIndustrial;
}
public static IndustryTabs tabHydraulic()
{
if (tabHydrualic == null)
{
tabHydrualic = new IndustryTabs("Hydraulic");
}
return tabHydrualic;
}
public static IndustryTabs tabMining()
{
if (tabMining == null)
{
tabMining = new IndustryTabs("Mining");
}
return tabMining;
}
}

View file

@ -2,12 +2,9 @@ package com.dark.access;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import com.dark.save.IVirtualObject;
import com.dark.save.NBTFileHelper;
import com.dark.save.SaveManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -15,6 +12,10 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import com.dark.save.IVirtualObject;
import com.dark.save.NBTFileHelper;
import com.dark.save.SaveManager;
/** Designed to be used as a container for AccessGroups and AccessUser. If you plan to use this make /** Designed to be used as a container for AccessGroups and AccessUser. If you plan to use this make
* sure to use it correctly. This is designed to be saved separate from the world save if marked for * sure to use it correctly. This is designed to be saved separate from the world save if marked for
* global access. Which means it can save/load at will from the world file. * global access. Which means it can save/load at will from the world file.
@ -34,6 +35,8 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
/** Save file by which this was loaded from. Mainly used to save it in the same location again. */ /** Save file by which this was loaded from. Mainly used to save it in the same location again. */
protected File saveFile; protected File saveFile;
private static final Set<AccessProfile> globalList = new HashSet<AccessProfile>();
static static
{ {
SaveManager.registerClass("AccessProfile", AccessProfile.class); SaveManager.registerClass("AccessProfile", AccessProfile.class);
@ -44,6 +47,7 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
if (global) if (global)
{ {
SaveManager.register(this); SaveManager.register(this);
AccessProfile.globalList.add(this);
} }
} }
@ -69,6 +73,18 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
} }
} }
public static AccessProfile get(String name)
{
for (AccessProfile profile : globalList)
{
if (profile.getID().equalsIgnoreCase(name))
{
return profile;
}
}
return null;
}
public AccessProfile generateNew(String name, Object object) public AccessProfile generateNew(String name, Object object)
{ {
GroupRegistry.loadNewGroupSet(this); GroupRegistry.loadNewGroupSet(this);

View file

@ -24,7 +24,6 @@ import com.google.common.io.ByteStreams;
import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player; import cpw.mods.fml.common.network.Player;
import dark.machines.PacketManagerEffects;
/** Packet manager based off the PacketManager from UE created by Calclavia. However changed so it /** Packet manager based off the PacketManager from UE created by Calclavia. However changed so it
* can easily be extended without changing the base handler file. Instead of changing the base file * can easily be extended without changing the base handler file. Instead of changing the base file
@ -40,13 +39,11 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver
public static HashMap<Integer, IPacketManager> packetTypes = new HashMap<Integer, IPacketManager>(); public static HashMap<Integer, IPacketManager> packetTypes = new HashMap<Integer, IPacketManager>();
public static PacketManagerTile tile = new PacketManagerTile(); public static PacketManagerTile tile = new PacketManagerTile();
public static PacketManagerEffects effects = new PacketManagerEffects();
public static int maxID = 0; public static int maxID = 0;
static static
{ {
registerManager(new PacketManagerTile()); registerManager(new PacketManagerTile());
registerManager(new PacketManagerEffects());
registerManager(PacketManagerKeyEvent.instance()); registerManager(PacketManagerKeyEvent.instance());
registerManager(new PacketManagerEntity()); registerManager(new PacketManagerEntity());
} }

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
/** Used on tiles that can contain more than one tile network. Currently WIP so don't use unless you /** Used on tiles that can contain more than one tile network. Currently WIP so don't use unless you
* know what your doing. When using this use networks like items and store them in slots. * know what your doing. When using this use networks like items and store them in slots.

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
import universalelectricity.core.block.IElectricalStorage; import universalelectricity.core.block.IElectricalStorage;

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
import java.util.List; import java.util.List;

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package com.dark.tile.network; package com.dark.tilenetwork;
import java.util.Set; import java.util.Set;

View file

@ -1,4 +1,4 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -10,8 +10,8 @@ import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
import com.builtbroken.common.Pair; import com.builtbroken.common.Pair;
import com.dark.tile.network.IMotionPath; import com.dark.tilenetwork.IMotionPath;
import com.dark.tile.network.INetworkPart; import com.dark.tilenetwork.INetworkPart;
/** Class that acts like the redpower pipes system. Each item is marked with a destination. Intended /** Class that acts like the redpower pipes system. Each item is marked with a destination. Intended

View file

@ -1,9 +1,9 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import com.dark.tile.network.INetworkPart; import com.dark.tilenetwork.INetworkPart;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -1,9 +1,9 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.dark.tile.network.INetworkPart; import com.dark.tilenetwork.INetworkPart;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -1,8 +1,8 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import com.dark.interfaces.IPowerLess; import com.dark.interfaces.IPowerLess;
import com.dark.tile.network.INetworkEnergyPart; import com.dark.tilenetwork.INetworkEnergyPart;
import com.dark.tile.network.INetworkPart; import com.dark.tilenetwork.INetworkPart;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import universalelectricity.core.block.IElectricalStorage; import universalelectricity.core.block.IElectricalStorage;

View file

@ -1,12 +1,12 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.dark.tile.network.INetworkPart; import com.dark.tilenetwork.INetworkPart;
import com.dark.tile.network.ITileNetwork; import com.dark.tilenetwork.ITileNetwork;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -1,4 +1,4 @@
package com.dark.prefab.tile.network; package com.dark.tilenetwork.prefab;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
@ -6,7 +6,7 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
import com.dark.tile.network.ITileNetwork; import com.dark.tilenetwork.ITileNetwork;
import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.ITickHandler;