mirror of
https://github.com/GTNewHorizons/IguanaTweaksTConstruct.git
synced 2026-11-27 23:33:06 +00:00
Fix buckets
This commit is contained in:
1 parent
c919e4d60f
commit
f34900edeb
9 files changed
+24
-8
No files matched your search
@@ -0,0 +1 @@
|
||||
gradlew setupDevWorkspace
|
||||
@@ -0,0 +1 @@
|
||||
gradlew setupDecompWorkspace --refresh-dependencies
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
mod_version=2.1.6
|
||||
minecraft_version=1.7.10
|
||||
forge_version=10.13.3.1399-1.7.10
|
||||
forge_version=10.13.4.1566-1.7.10
|
||||
tconstruct_version=1.8.4.build951
|
||||
fmp_version=1.1.2.334
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,10 @@
|
||||
package iguanaman.iguanatweakstconstruct.claybuckets;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import javafx.scene.layout.Priority;
|
||||
import mods.railcraft.common.plugins.forge.WorldPlugin;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
@@ -11,13 +14,13 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.event.entity.player.EntityInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
|
||||
public class ClayBucketHandler {
|
||||
// milking cows
|
||||
@SubscribeEvent
|
||||
public void EntityInteract(EntityInteractEvent event)
|
||||
{
|
||||
public void EntityInteract(EntityInteractEvent event){
|
||||
if(event.target == null || !(event.target instanceof EntityCow))
|
||||
return;
|
||||
if(event.entityPlayer == null)
|
||||
@@ -41,11 +44,20 @@ public class ClayBucketHandler {
|
||||
}
|
||||
|
||||
// filling buckets with molten metal, same behaviour as regular buckets from TConstruct, but with clay buckets
|
||||
@SubscribeEvent
|
||||
public void bucketFill (FillBucketEvent event)
|
||||
{
|
||||
if (event.current.getItem() == IguanaItems.clayBucketFired && event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void bucketFill (FillBucketEvent event){
|
||||
if (event.current.getItem() == IguanaItems.clayBucketFired && event.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
Block block = WorldPlugin.getBlock(event.world, event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||
if (Block.isEqualTo(block, Block.getBlockFromName("tile.blockFuel")) ||
|
||||
Block.isEqualTo(block, Block.getBlockFromName("tile.blockOil")) ||
|
||||
Block.isEqualTo(block, Block.getBlockFromName("tile.railcraft.fluid.creosote"))) {
|
||||
event.result = new ItemStack(IguanaItems.clayBucketFired);
|
||||
event.setResult(Event.Result.DENY);
|
||||
if (event.isCancelable()) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if(event.getResult() != Event.Result.DEFAULT)
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user