mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
Merge pull request #2970 from HenryLoenwind/kickIt
Ignore non-vanilla buckets firing FillBucketEvent events
This commit is contained in:
commit
e43b51dafd
1 file changed
+8
-4
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -32,10 +33,13 @@ public class BucketHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBucketFill(FillBucketEvent event) {
|
||||
ItemStack res = getFilledBucket(event.world, event.target);
|
||||
if(res != null) {
|
||||
event.result = res;
|
||||
event.setResult(Result.ALLOW);
|
||||
// no instanceof check, someone may subclass the vanilla bucket
|
||||
if (event.current != null && event.current.getItem() == Items.bucket && event.current.stackSize > 0) {
|
||||
ItemStack res = getFilledBucket(event.world, event.target);
|
||||
if (res != null) {
|
||||
event.result = res;
|
||||
event.setResult(Result.ALLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user