import chemicraft.debug.CommandDeleteItem;\r
import chemicraft.debug.CommandGenDebugRoom;\r
import chemicraft.debug.CommandSetTile;\r
-import chemicraft.entity.EntityAtomGrenade;\r
-import chemicraft.item.ItemAtomGrenade;\r
+import chemicraft.entity.EntityAtomsGrenade;\r
import chemicraft.item.ItemAtoms;\r
+import chemicraft.item.ItemAtomsGrenade;\r
import chemicraft.item.ItemCompounds;\r
import chemicraft.item.ItemGasCollectingBottle;\r
import chemicraft.system.CommonProxy;\r
this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");\r
this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");\r
this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);\r
- this.itemAtomGrenade = new ItemAtomGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);\r
+ this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);\r
\r
// BlockをMinecraftに登録します\r
GameRegistry.registerBlock(this.blockDecompositionTable);\r
proxy.registerTextures();\r
\r
//Entityを追加します\r
- EntityRegistry.registerModEntity(EntityAtomGrenade.class, "EntityAtomGrenade", 1, this, 250, 5, false);\r
- EntityRegistry.registerGlobalEntityID(EntityAtomGrenade.class, "EntityAtomGrenade", 220);\r
+ EntityRegistry.registerModEntity(EntityAtomsGrenade.class, "EntityAtomGrenade", 1, this, 250, 5, false);\r
+ EntityRegistry.registerGlobalEntityID(EntityAtomsGrenade.class, "EntityAtomGrenade", 220);\r
\r
//化学作業台類のレシピを追加します\r
GameRegistry.addRecipe(new ItemStack(this.blockDecompositionTable),\r
ChemiCraftAPI.getInstance().addDecompositionRecipe(new ItemStack(Block.dirt), new ItemStack[]{new ItemStack(Block.stone)});\r
\r
// 化合物を追加します\r
+ ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");\r
ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
\r
//手榴弾の追加\r
// API用の処理\r
this.nameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getInstance().getCompoundsName().toArray());\r
this.nameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getInstance().getCompoundsLangName().toArray());\r
+ ChemiCraftAPI.getInstance().addCompoundHash(ChemiCraftAPI.getInstance().getCompoundsName().toArray());\r
}\r
\r
private void debug(final FMLPostInitializationEvent event) {\r
public int getDamageByName(String englishName){
for(int i = 0;i < compoundsNameList.size();i++){
if(englishName.equals(compoundsNameList.get(i))){
- compoundHash.put(englishName, i);
return i;
}
}
+ public void addCompoundHash(String key, int value){
+ compoundHash.put(key, value);
+ }
+
+
+
+ public void addCompoundHash(Object[] object){
+ for(int i = 0;i < compoundsNameList.size();i++){
+ if(object[i].equals(compoundsNameList.get(i))){
+ compoundHash.put((String) object[i], i);
+ }
+ }
+ }
+
+
+
public int getCompound(String key){
if(compoundHash.get(key) != null){
return compoundHash.get(key);
import net.minecraft.src.PotionEffect;
import net.minecraft.src.World;
-public class EntityAtomGrenade extends EntityThrowable
+public class EntityAtomsGrenade extends EntityThrowable
{
private float explodeSize;
private boolean onFire;
private boolean isNuke;
- public EntityAtomGrenade(World par1World, EntityLiving par2EntityLiving, boolean par3, boolean par4, boolean par5) {
+ public EntityAtomsGrenade(World par1World, EntityLiving par2EntityLiving, boolean par3, boolean par4, boolean par5) {
super(par1World, par2EntityLiving);
this.isExplode = par3;
this.onFire = par4;
import java.util.List;
-import net.minecraft.src.Entity;
+import chemicraft.entity.EntityAtomsGrenade;
+
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.NBTTagList;
import net.minecraft.src.World;
-import net.minecraft.src.WorldClient;
-import net.minecraft.src.WorldServer;
-import chemicraft.entity.EntityAtomGrenade;
-public class ItemAtomGrenade extends Item {
+public class ItemAtomsGrenade extends Item {
- public ItemAtomGrenade(int par1) {
+ public ItemAtomsGrenade(int par1) {
super(par1);
}
}
}
}
- EntityAtomGrenade entity = new EntityAtomGrenade(par2World, par3EntityPlayer, var1, var2, var3);
+ EntityAtomsGrenade entity = new EntityAtomsGrenade(par2World, par3EntityPlayer, var1, var2, var3);
par2World.spawnEntityInWorld(entity);
par1ItemStack.stackSize--;
return par1ItemStack;
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
- int var11 = par3World.getBlockId(par4, par5, par6);
- Block block = Block.blocksList[var11];
+ int blockID = par3World.getBlockId(par4, par5, par6);
+ Block block = Block.blocksList[blockID];
- if (block instanceof BlockFire){
+ int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
+ Block uniqueBlock = Block.blocksList[uniqueBlockID];
+
+ if (uniqueBlock instanceof BlockFire){
par1ItemStack.damageItem(1, par2EntityPlayer);
int result1 = MathHelperPlus.probability(99, 1);
if (result1 == 0) {
this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par2EntityPlayer);
} else {
- this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par2EntityPlayer);
+ this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonMonoxide")), par2EntityPlayer);
}
return true;
import org.lwjgl.opengl.GL12;
import chemicraft.ChemiCraft;
-import chemicraft.entity.EntityAtomGrenade;
+import chemicraft.entity.EntityAtomsGrenade;
+import cpw.mods.fml.common.Side;
+import cpw.mods.fml.common.asm.SideOnly;
+@SideOnly(Side.CLIENT)
public class RenderAtomsGrenade extends Render {
private float field_77002_a;
this.field_77002_a = par1;
}
- public void doRenderAtomsGrenade(EntityAtomGrenade par1AtomGrenade, double par2, double par4, double par6, float par8, float par9)
+ public void doRenderAtomsGrenade(EntityAtomsGrenade par1AtomGrenade, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
- this.doRenderAtomsGrenade((EntityAtomGrenade)par1Entity, par2, par4, par6, par8, par9);
+ this.doRenderAtomsGrenade((EntityAtomsGrenade)par1Entity, par2, par4, par6, par8, par9);
}
}