mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge branch 'master' of https://github.com/TheBusyBiscuit/Slimefun4
This commit is contained in:
commit
4662144309
@ -50,6 +50,7 @@ public class SlimefunItem {
|
||||
private boolean replacing = false;
|
||||
private boolean addon = false;
|
||||
private String permission = "";
|
||||
private List<String> noPermissionTooltip;
|
||||
private Set<ItemHandler> itemhandlers = new HashSet<>();
|
||||
private boolean ticking = false;
|
||||
private BlockTicker blockTicker;
|
||||
@ -156,6 +157,7 @@ public class SlimefunItem {
|
||||
* @since 4.1.11
|
||||
*/
|
||||
public String getPermission() { return permission; }
|
||||
public List<String> getNoPermissionTooltip() { return noPermissionTooltip; }
|
||||
public Set<ItemHandler> getHandlers() { return itemhandlers; }
|
||||
public boolean isTicking() { return ticking; }
|
||||
/**
|
||||
@ -194,7 +196,8 @@ public class SlimefunItem {
|
||||
SlimefunPlugin.getItemCfg().setDefaultValue(this.id + ".allow-enchanting", this.enchantable);
|
||||
SlimefunPlugin.getItemCfg().setDefaultValue(this.id + ".allow-disenchanting", this.disenchantable);
|
||||
SlimefunPlugin.getItemCfg().setDefaultValue(this.id + ".required-permission", this.permission);
|
||||
|
||||
SlimefunPlugin.getItemCfg().setDefaultValue(this.id + ".no-permission-tooltip", new String[] {"&4&lLOCKED", "", "&rYou do not have Permission", "&rto access this Item"});
|
||||
|
||||
if (this.keys != null && this.values != null) {
|
||||
for (int i = 0; i < this.keys.length; i++) {
|
||||
SlimefunPlugin.getItemCfg().setDefaultValue(this.id + '.' + this.keys[i], this.values[i]);
|
||||
@ -221,6 +224,7 @@ public class SlimefunItem {
|
||||
this.enchantable = SlimefunPlugin.getItemCfg().getBoolean(this.id + ".allow-enchanting");
|
||||
this.disenchantable = SlimefunPlugin.getItemCfg().getBoolean(this.id + ".allow-disenchanting");
|
||||
this.permission = SlimefunPlugin.getItemCfg().getString(this.id + ".required-permission");
|
||||
this.noPermissionTooltip = SlimefunPlugin.getItemCfg().getStringList(this.id + ".no-permission-tooltip");
|
||||
SlimefunPlugin.getUtilities().enabledItems.add(this);
|
||||
if (slimefun) SlimefunPlugin.getUtilities().vanillaItems++;
|
||||
SlimefunPlugin.getUtilities().itemIDs.put(this.id, this);
|
||||
|
@ -49,7 +49,7 @@ public class RainbowTicker extends BlockTicker {
|
||||
|
||||
@Override
|
||||
public void uniqueTick() {
|
||||
index = ((index == queue.length - 1) ? 0: index + 1);
|
||||
index = ((index >= queue.length - 1) ? 0: index + 1);
|
||||
meta = queue[index];
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,6 @@ public final class Messages {
|
||||
local.setDefault("messages.cannot-place" ,"&cYou cannot place that block there!");
|
||||
local.setDefault("messages.no-pvp" ,"&cYou cannot pvp in here!");
|
||||
|
||||
local.setDefault("tooltips.item-permission", "", "&rYou do not have Permission", "&rto access this Item");
|
||||
|
||||
local.setDefault("machines.pattern-not-found", "&eSorry, I could not recognize this Pattern. Please place the Items in the correct Pattern into the Dispenser.");
|
||||
local.setDefault("machines.unknown-material", "&eSorry, I could not recognize the Item in my Dispenser. Please put something in that I know.");
|
||||
local.setDefault("machines.wrong-item", "&eSorry, I could not recognize the Item you right clicked me with. Check the Recipes and see which Items you can use.");
|
||||
|
@ -713,8 +713,8 @@ public final class SlimefunGuide {
|
||||
index++;
|
||||
}
|
||||
else {
|
||||
List<String> tooltip = Messages.local.getTranslation("tooltips.item-permission");
|
||||
menu.addItem(index, new CustomItem(Material.BARRIER, StringUtils.formatItemName(sfitem.getItem(), false), tooltip.toArray(new String[tooltip.size()])));
|
||||
List<String> message = sfitem.getNoPermissionTooltip();
|
||||
menu.addItem(index, new CustomItem(Material.BARRIER, StringUtils.formatItemName(sfitem.getItem(), false), message.toArray(new String[message.size()])));
|
||||
menu.addMenuClickHandler(index, (pl, slot, item, action) -> false);
|
||||
index++;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class FurnaceListener implements Listener {
|
||||
SlimefunItem furnace = BlockStorage.check(e.getBlock());
|
||||
|
||||
if (furnace instanceof EnhancedFurnace && ((EnhancedFurnace) furnace).getFuelEfficiency() > 0) {
|
||||
e.setBurnTime(((int) ((1 + 0.2 * ((EnhancedFurnace) furnace).getFuelEfficiency()) * e.getBurnTime())));
|
||||
e.setBurnTime(((EnhancedFurnace) furnace).getFuelEfficiency() * e.getBurnTime());
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class FurnaceListener implements Listener {
|
||||
ItemStack result = f.getInventory().getResult() == null ? RecipeCalculator.getSmeltedOutput(f.getInventory().getSmelting().getType()) : f.getInventory().getResult().clone();
|
||||
|
||||
if (result != null) {
|
||||
f.getInventory().setResult(new CustomItem(result, result.getAmount() + amount > result.getMaxStackSize() ? result.getMaxStackSize() : result.getAmount() + amount));
|
||||
f.getInventory().setResult(new CustomItem(result, Math.min(result.getAmount() + amount, result.getMaxStackSize())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user