1.7.10 commit of I-still-can't-do-any-branches

This commit is contained in:
WayofTime 2014-06-27 19:43:09 -04:00
parent 6aec0a87ea
commit cabc296b21
763 changed files with 64290 additions and 0 deletions

View file

@ -0,0 +1,42 @@
package WayofTime.alchemicalWizardry.common;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.ModItems;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class LifeBucketHandler
{
@SubscribeEvent
public void onBucketFill(FillBucketEvent event)
{
ItemStack result = fillCustomBucket(event.world, event.target);
if (result == null)
{
return;
}
event.result = result;
event.setResult(Result.ALLOW);
}
public ItemStack fillCustomBucket(World world, MovingObjectPosition pos)
{
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
if (block!=null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0)
{
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
return new ItemStack(ModItems.bucketLife);
} else
{
return null;
}
}
}