OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraft.java
index 1e0c1cc..dc1dadc 100644 (file)
@@ -5,6 +5,7 @@ import net.minecraft.block.material.Material;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
+import net.minecraft.src.ModLoader;
 import net.minecraftforge.common.Configuration;
 import net.minecraftforge.common.Property;
 import net.minecraftforge.oredict.OreDictionary;
@@ -20,10 +21,12 @@ import pcc.chemicraft.creativetab.CreativeTabChemiCraft;
 import pcc.chemicraft.debug.CommandDeleteItem;
 import pcc.chemicraft.debug.CommandGenDebugRoom;
 import pcc.chemicraft.debug.CommandSetTile;
+import pcc.chemicraft.entity.EntityDust;
 import pcc.chemicraft.item.ItemAtoms;
 import pcc.chemicraft.item.ItemAtomsGrenade;
 import pcc.chemicraft.item.ItemChemiCell;
 import pcc.chemicraft.item.ItemCompounds;
+import pcc.chemicraft.item.ItemDust;
 import pcc.chemicraft.item.ItemGasCollectingBottle;
 import pcc.chemicraft.ore.BlockAtomOres;
 import pcc.chemicraft.ore.ItemAtomOres;
@@ -45,7 +48,9 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
 import cpw.mods.fml.common.event.FMLServerStartingEvent;
 import cpw.mods.fml.common.network.NetworkMod;
 import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.common.registry.EntityRegistry;
 import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
 /**
  * ChemiCraft本体
  * @author P.C.C.
@@ -139,6 +144,7 @@ public class ChemiCraft implements Runnable {
        public Item itemGasCollectingBottle;
        public Item itemAtomGrenade;
        public Item itemChemicalCells;
+       public Item itemDust;
 
        /**
         * このmodで使用するTextureのパス.
@@ -155,6 +161,7 @@ public class ChemiCraft implements Runnable {
        public final String GUI_CHEMICALCOMBINATION_TEXTURE = "/pcc/chemicraft/guis/ChemicalCombination.png";
        public final String GUI_TOOLANDWEAPONCRAFTING_TEXTURE = "/pcc/chemicraft/guis/ToolAndWeaponCrafting.png";
        public final String GUI_CHEMICALCRAFTING_TEXTURE = "/pcc/chemicraft/guis/MaterialCrafting.png";
+       public final String ENTITY_PARTICLE_TEXRURE = "/pcc/chemicraft/entityParticles/dust.png";
 
        /**
         * このmodに必要な補助クラスのインスタンス.
@@ -312,6 +319,7 @@ public class ChemiCraft implements Runnable {
                this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
                this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
                this.itemChemicalCells = new ItemChemiCell(this.chemicalCellsID).setItemName("chemiCell").setIconIndex(3);
+               this.itemDust = new ItemDust(15000).setItemName("dust").setIconIndex(12);
 
                // BlockをMinecraftに登録します
                GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
@@ -339,6 +347,8 @@ public class ChemiCraft implements Runnable {
                this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");
                this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");
                this.nameAuxiliary.addName(this.itemAtomGrenade, "ja_JP", "元素手榴弾");
+               this.nameAuxiliary.addName(this.itemDust, "dust");
+               this.nameAuxiliary.addName(this.itemDust, "ja_JP", "粉塵");
 
                // TileEntityを追加します
                GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");
@@ -518,6 +528,21 @@ public class ChemiCraft implements Runnable {
                                        api.getAtomOresAmounts().get(api.getAtomOresName().getKeyList(i)));
                }
 
+               //Entityを追加
+               LanguageRegistry.instance().addStringLocalization("entity.Dust.name", "en_US", "Dust");
+               EntityRegistry.registerModEntity(EntityDust.class,
+                               "Dust",
+                               ModLoader.getUniqueEntityId(),
+                               this,
+                               250,
+                               5,
+                               true);
+               /*
+               EntityRegistry.registerGlobalEntityID(EntityDust.class,
+                               "Dust",
+                               ModLoader.getUniqueEntityId());
+                               */
+
                this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
        }