mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-05 08:29:09 +01:00
2c6bcd72cf
-Coffee Machine -Paxels
28 lines
1.1 KiB
Java
28 lines
1.1 KiB
Java
package ellpeck.actuallyadditions.event;
|
|
|
|
import cpw.mods.fml.common.eventhandler.Event;
|
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
|
import ellpeck.actuallyadditions.items.InitItems;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
|
|
|
public class BucketFillEvent{
|
|
|
|
@SubscribeEvent
|
|
public void onBucketFilled(FillBucketEvent event){
|
|
Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ);
|
|
if(block == InitBlocks.blockCanolaOil){
|
|
event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ);
|
|
event.result = new ItemStack(InitItems.itemBucketCanolaOil);
|
|
event.setResult(Event.Result.ALLOW);
|
|
}
|
|
if(block == InitBlocks.blockOil){
|
|
event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ);
|
|
event.result = new ItemStack(InitItems.itemBucketOil);
|
|
event.setResult(Event.Result.ALLOW);
|
|
}
|
|
}
|
|
|
|
}
|