Fix lava crystal not syphoning LP (#1326)
This commit is contained in:
parent
22e8290921
commit
c8e42e3288
|
@ -43,7 +43,7 @@ public class ItemLavaCrystal extends ItemBindableBase implements IVariantProvide
|
||||||
if (binding == null)
|
if (binding == null)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (NetworkHelper.canSyphonFromContainer(stack, 25))
|
if (NetworkHelper.syphonFromContainer(stack, 25))
|
||||||
return 200;
|
return 200;
|
||||||
else {
|
else {
|
||||||
EntityPlayer player = PlayerHelper.getPlayerFromUUID(binding.getOwnerId());
|
EntityPlayer player = PlayerHelper.getPlayerFromUUID(binding.getOwnerId());
|
||||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ public class NetworkHelper {
|
||||||
* @param toSyphon - Amount of LP to syphon
|
* @param toSyphon - Amount of LP to syphon
|
||||||
* @return - If the syphon was successful.
|
* @return - If the syphon was successful.
|
||||||
*/
|
*/
|
||||||
public static boolean syphonFromContainer(ItemStack stack, int toSyphon) //TODO: Change to a String, int?
|
public static boolean syphonFromContainer(ItemStack stack, int toSyphon)
|
||||||
{
|
{
|
||||||
if (!(stack.getItem() instanceof IBindable))
|
if (!(stack.getItem() instanceof IBindable))
|
||||||
return false;
|
return false;
|
||||||
|
@ -129,10 +128,9 @@ public class NetworkHelper {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SoulNetwork network = getSoulNetwork(binding);
|
SoulNetwork network = getSoulNetwork(binding);
|
||||||
|
|
||||||
SoulNetworkEvent.ItemDrainInContainerEvent event = new SoulNetworkEvent.ItemDrainInContainerEvent(stack, binding.getOwnerId(), toSyphon);
|
SoulNetworkEvent.ItemDrainInContainerEvent event = new SoulNetworkEvent.ItemDrainInContainerEvent(stack, binding.getOwnerId(), toSyphon);
|
||||||
|
|
||||||
return !(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) && network.syphon(event.syphon) >= toSyphon;
|
return !MinecraftForge.EVENT_BUS.post(event) && network.syphon(event.syphon) >= toSyphon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue