mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-28 07:35:53 +00:00
Content update (continued)
This commit is contained in:
1 parent
9028d32b6e
commit
29eee40824
92 files changed
+3233
-2211
No files matched your search
@@ -0,0 +1,60 @@
|
||||
package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
|
||||
public class BlockNightshadeBush extends BlockBush
|
||||
{
|
||||
public BlockNightshadeBush ()
|
||||
{
|
||||
super(Material.plants);
|
||||
this.setBlockName("BlockNightshadeBush");
|
||||
this.setBlockTextureName("taintedmagic:BlockNightshadeBush");
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
public Item getItemDropped (int a, Random r, int b)
|
||||
{
|
||||
return ItemRegistry.ItemNightshadeBerries;
|
||||
}
|
||||
|
||||
public int quantityDropped (Random r)
|
||||
{
|
||||
return 1 + r.nextInt(3);
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock (World w, int x, int y, int z, Entity e)
|
||||
{
|
||||
super.onEntityCollidedWithBlock(w, x, y, z, e);
|
||||
|
||||
if (e instanceof EntityLivingBase)
|
||||
{
|
||||
e.attackEntityFrom(new DamageSource("nightshade"), 1.0F);
|
||||
((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face)
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face)
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class BlockWarpwoodLeaves extends Block implements IShearable
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setLightOpacity(0);
|
||||
this.setHardness(0.1F);
|
||||
this.setStepSound(ConfigBlocks.blockTaint.stepSound);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.setBlockName("BlockWarpwoodLeaves");
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -27,20 +28,17 @@ public class BlockWarpwoodSapling extends BlockSapling
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149878_d (World world, int x, int y, int z, Random rand)
|
||||
public void func_149878_d (World w, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
if (!w.isRemote)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int meta = w.getBlockMetadata(x, y, z);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
w.setBlockToAir(x, y, z);
|
||||
|
||||
WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree(true, BlockRegistry.BlockWarpwoodLog, BlockRegistry.BlockWarpwoodLeaves);
|
||||
WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree(true, 7, 5);
|
||||
|
||||
if (!tree.generate(world, rand, x, y, z))
|
||||
{
|
||||
world.setBlock(x, y, z, this, meta, 2);
|
||||
}
|
||||
if (!tree.generate(w, rand, x, y, z)) w.setBlock(x, y, z, this, meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user