mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
Ignore non-vanilla buckets firing FillBucketEvent events
They need to handle this event themselves. We only handle converting vanilla buckets into Ender IO buckets.
This commit is contained in:
1 parent
5210764001
commit
6b130f9d34
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