mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-26 14:53:07 +00:00
Cleanup & reformat
This commit is contained in:
1 parent
f479b19255
commit
38e0cefaa2
76 files changed
+2371
-2766
No files matched your search
@@ -15,7 +15,6 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
@@ -23,61 +22,51 @@ import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
|
||||
public class BlockNightshadeBush extends BlockBush
|
||||
{
|
||||
public BlockNightshadeBush ()
|
||||
{
|
||||
public class BlockNightshadeBush extends BlockBush {
|
||||
|
||||
public BlockNightshadeBush () {
|
||||
super(Material.plants);
|
||||
this.setBlockName("BlockNightshadeBush");
|
||||
this.setBlockTextureName("taintedmagic:BlockNightshadeBush");
|
||||
this.setCreativeTab(TaintedMagic.tabTM);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
setBlockName("BlockNightshadeBush");
|
||||
setBlockTextureName("taintedmagic:BlockNightshadeBush");
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setStepSound(soundTypeGrass);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public Item getItemDropped (int a, Random random, int b)
|
||||
{
|
||||
@Override
|
||||
public Item getItemDropped (final int a, final Random random, final int b) {
|
||||
return ItemRegistry.ItemNightshadeBerries;
|
||||
}
|
||||
|
||||
public int quantityDropped (Random random)
|
||||
{
|
||||
@Override
|
||||
public int quantityDropped (final Random random) {
|
||||
return 1 + random.nextInt(3);
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock (final World world, final int x, final int y, final int z, final Entity entity) {
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
entity.attackEntityFrom(new DamageSource("nightshade"), 1.0F);
|
||||
try
|
||||
{
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 140, 0));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 140, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public int getFlammability (IBlockAccess world, int x, int y, int z, ForgeDirection face)
|
||||
{
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getFireSpreadSpeed (IBlockAccess world, int x, int y, int z, ForgeDirection face)
|
||||
{
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreak (BlockEvent.HarvestDropsEvent event)
|
||||
{
|
||||
public void onBreak (final BlockEvent.HarvestDropsEvent event) {
|
||||
if (event.harvester != null && event.harvester.getHeldItem() != null
|
||||
&& event.harvester.getHeldItem().getItem() instanceof ItemShears)
|
||||
{
|
||||
&& event.harvester.getHeldItem().getItem() instanceof ItemShears) {
|
||||
event.drops.clear();
|
||||
event.drops.add(new ItemStack(BlockRegistry.BlockNightshadeBush, 1, 0));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user