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.itemGrenade = new ItemGrenade(this.grenadeID).setItemName("grenade").setIconIndex(1);\r
+ this.itemGrenade = new ItemAtomGrenade(this.grenadeID).setItemName("grenade").setIconIndex(1);\r
\r
// BlockをMinecraftに登録します\r
GameRegistry.registerBlock(this.blockDecompositionTable);\r
this.NameAuxiliary.addName(this.itemAtoms, "ja_JP", atomsNameJP);\r
this.NameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");\r
this.NameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");\r
- this.NameAuxiliary.addName(this.itemGrenade, "Grenade");\r
- this.NameAuxiliary.addName(this.itemGrenade, "手榴弾");\r
+ this.NameAuxiliary.addName(this.itemGrenade, "AtomGrenade");\r
+ this.NameAuxiliary.addName(this.itemGrenade, "元素手榴弾");\r
\r
// TileEntityを追加します\r
GameRegistry.registerTileEntity(TileEntityDecompositionTable.class, "DecompositionTable");\r
--- /dev/null
+package chemicraft;
+
+import net.minecraft.src.DamageSource;
+import net.minecraft.src.Entity;
+import net.minecraft.src.EntityChicken;
+import net.minecraft.src.EntityLiving;
+import net.minecraft.src.EntityThrowable;
+import net.minecraft.src.MovingObjectPosition;
+import net.minecraft.src.World;
+
+public class EntityAtomGrenade extends EntityThrowable
+{
+
+ private int expSize;
+ private boolean expFire;
+
+ public EntityAtomGrenade(World par1World) {
+ super(par1World);
+ }
+
+ public EntityAtomGrenade(World par1World, EntityLiving par2EntityLiving) {
+ super(par1World, par2EntityLiving);
+ }
+
+ public EntityAtomGrenade(World par1World, double par2, double par4, double par6) {
+ super(par1World, par2, par4, par6);
+ }
+
+ @Override
+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
+ {
+ if (par1MovingObjectPosition.entityHit != null) {
+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.thrower), 0);
+
+ }
+
+ if (!this.worldObj.isRemote) {
+ this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, expSize, expFire);
+ }
+
+ }
+
+}
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.NBTTagList;
-public class ItemGrenade extends Item {
+public class ItemAtomGrenade extends Item {
- protected ItemGrenade(int par1) {
+ protected ItemAtomGrenade(int par1) {
super(par1);
}