Testing
This commit is contained in:
commit
8601e9faff
498 changed files with 45817 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
|
||||
public class LifeBucketHandler
|
||||
{
|
||||
@ForgeSubscribe
|
||||
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)
|
||||
{
|
||||
int blockID = world.getBlockId(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
if ((blockID == AlchemicalWizardry.blockLifeEssence.blockID) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0)
|
||||
{
|
||||
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
|
||||
return new ItemStack(AlchemicalWizardry.bucketLife);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue