Giter Site home page Giter Site logo

Comments (9)

NathanAdhitya avatar NathanAdhitya commented on May 24, 2024 1

Confirmed, It happens on 1.11.2 on Spigot. Looks like it could be spigot's fault, There's nothing really going on in the code that can control that, The code looks okay to me.. The code looks okay to me.
public static ItemStack MELON_JUICE = new CustomPotion("&cMelon Juice", 8197, new String[0], new PotionEffect(PotionEffectType.SATURATION, 10, 0));

And the Listener Code doesn't do anything about it, Looks like all the listener code does it that it removes the glass bottles.

from slimefun4.

SoSeDiK avatar SoSeDiK commented on May 24, 2024

Same problem (also with ExoticGarden). I just added the command /effect (/effect [player] 23 5 1 for Slimefun juices, for example), when the potion is consumed. Maybe there is a better way.

from slimefun4.

Momshroom avatar Momshroom commented on May 24, 2024

Sorry, how did you do that? :3

from slimefun4.

CyberiumShadow avatar CyberiumShadow commented on May 24, 2024

@EventHandler public void onStarve(FoodLevelChangeEvent e) { if (e.getFoodLevel() < ((Player) e.getEntity()).getFoodLevel()) { Player p = (Player) e.getEntity(); for (ItemStack item: p.getInventory().getContents()) { if (SlimefunManager.isItemSimiliar(item, SlimefunItem.getItem("COOLER"), false)) { Inventory inv = Backpacks.getInventory(p, item); if (inv != null) { ItemStack drink = null; for (ItemStack i: inv.getContents()) { if (i != null && i.getType() == Material.POTION && i.hasItemMeta()) { drink = i; break; } } if (drink != null) { PotionMeta im = (PotionMeta) drink.getItemMeta(); for (PotionEffect effect: im.getCustomEffects()) { p.addPotionEffect(effect); } p.setSaturation(6F); p.playSound(p.getLocation(), Sound.ENTITY_GENERIC_DRINK, 1F, 1F); inv.removeItem(drink); Backpacks.saveBackpack(inv, item); break; } } } } } }

That's the listener code.

Essentially, there is no hook for slimefun to add the saturation effect when you drink a juice individually.

The juices will only work when put into a cooler.

however
This will reset your hunger bar to full as soon as you lose even a single food point as I tested with the elemental staff wind.

@TheBusyBiscuit I'm not sure if that was intended behaviour nor am I sure if this is intended behaviour of consuming 2 juices per "restoration"

from slimefun4.

TheBusyBiscuit avatar TheBusyBiscuit commented on May 24, 2024

@CyberiumShadow

Essentially, there is no hook for slimefun to add the saturation effect when you drink a juice individually.

There is no need for that either since Juices are Potions and the Potion Effect is applied by Minecraft itself.
At least, that is what Spigot is supposed to do.

from slimefun4.

CyberiumShadow avatar CyberiumShadow commented on May 24, 2024

Yeah I had a look through the source for Slimefun and The javadocs for Spigot.

I have a feeling its more a spigot issue.

However, could it be changed so that instead of consuming a juice on every foodlevel change.

have it consume it if the new food level is under a certain threshold

from slimefun4.

TheBusyBiscuit avatar TheBusyBiscuit commented on May 24, 2024

@CyberiumShadow It's Open-Source.

from slimefun4.

Poslovitch avatar Poslovitch commented on May 24, 2024

Duplicate of #333

from slimefun4.

Poslovitch avatar Poslovitch commented on May 24, 2024

Has to be closed too (#513)

from slimefun4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.