mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
Small fixes, push to v1.8
This commit is contained in:
@@ -25,10 +25,12 @@ public class MCBarrel {
|
||||
|
||||
private byte brews = -1; // How many Brewery Brews are in this Barrel
|
||||
private final Inventory inv;
|
||||
private final int invSize;
|
||||
|
||||
|
||||
public MCBarrel(Inventory inv) {
|
||||
this.inv = inv;
|
||||
invSize = inv.getSize();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +58,7 @@ public class MCBarrel {
|
||||
if (item != null) {
|
||||
Brew brew = Brew.get(item);
|
||||
if (brew != null) {
|
||||
if (brews < maxBrews) {
|
||||
if (brews < maxBrews || maxBrews < 0) {
|
||||
// The time is in minutes, but brew.age() expects time in mc-days
|
||||
brew.age(item, ((float) time) / 20f, OAK);
|
||||
}
|
||||
@@ -99,6 +101,10 @@ public class MCBarrel {
|
||||
// There are still methods to place more Brews in that would be too tedious to catch.
|
||||
// This is only for direct visual Notification, the age routine above will never age more than 6 brews in any case.
|
||||
public void clickInv(InventoryClickEvent event) {
|
||||
if (maxBrews >= invSize || maxBrews < 0) {
|
||||
// There are enough brews allowed to fill the inventory, we don't need to keep track
|
||||
return;
|
||||
}
|
||||
boolean adding = false;
|
||||
switch (event.getAction()) {
|
||||
case PLACE_ALL:
|
||||
|
||||
@@ -1161,7 +1161,11 @@ public class ConfigUpdater {
|
||||
}
|
||||
}
|
||||
if (index != -1) {
|
||||
addLines(index + 1, "# Halte ein Item in der Hand und benutze /brew configname um dessen Material herauszufinden und für ein Rezept zu benutzen");
|
||||
addLines(index + 1, "# Halte ein Item in der Hand und benutze /brew ItemName um dessen Material herauszufinden und für ein Rezept zu benutzen");
|
||||
}
|
||||
index = indexOfStart("# wood: Holz des Fasses");
|
||||
if (index != -1) {
|
||||
addLines(index + 1, "# Das Minecraft Fass besteht aus Eiche");
|
||||
}
|
||||
if (P.use1_13) updateMaterialDescriptions(true);
|
||||
}
|
||||
@@ -1210,6 +1214,10 @@ public class ConfigUpdater {
|
||||
if (index != -1) {
|
||||
addLines(index + 1, "# With an item in your hand, use /brew ItemName to get its material for use in a recipe");
|
||||
}
|
||||
index = indexOfStart("# wood: Wood of the barrel");
|
||||
if (index != -1) {
|
||||
addLines(index + 1, "# The Minecraft barrel is made of oak");
|
||||
}
|
||||
if (P.use1_13) updateMaterialDescriptions(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CommandListener implements CommandExecutor {
|
||||
p.msg(sender, p.languageReader.get("Error_NoPermissions"));
|
||||
}
|
||||
|
||||
} else if (cmd.equalsIgnoreCase("configname") || cmd.equalsIgnoreCase("itemname")) {
|
||||
} else if (cmd.equalsIgnoreCase("configname") || cmd.equalsIgnoreCase("itemname") || cmd.equalsIgnoreCase("iteminfo")) {
|
||||
|
||||
if (sender.hasPermission("brewery.cmd.reload")) {
|
||||
cmdItemName(sender);
|
||||
|
||||
@@ -310,7 +310,7 @@ public class InventoryListener implements Listener {
|
||||
if (event.getSlot() > 2) {
|
||||
return;
|
||||
}
|
||||
} else if (!(event.getInventory().getHolder() instanceof Barrel) && !(event.getInventory().getHolder() instanceof org.bukkit.block.Barrel)) {
|
||||
} else if (!(event.getInventory().getHolder() instanceof Barrel) && !(P.use1_14 && event.getInventory().getHolder() instanceof org.bukkit.block.Barrel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user