mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #1907
This commit is contained in:
parent
11a0d24fd1
commit
4efc10db15
@ -63,6 +63,7 @@
|
||||
* Possibly fixed #1951
|
||||
* Fixed tab completion for /sf give showing players instead of amounts
|
||||
* Fixed #1993
|
||||
* Fixed #1907
|
||||
|
||||
## Release Candidate 12 (27 May 2020)
|
||||
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#12
|
||||
|
@ -60,14 +60,21 @@ public abstract class ElectricDustWasher extends AContainer {
|
||||
ChestMenuUtils.updateProgressbar(menu, 22, timeleft, processing.get(b).getTicks(), getProgressBar());
|
||||
|
||||
if (ChargableBlock.isChargable(b)) {
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) {
|
||||
return;
|
||||
}
|
||||
ChargableBlock.addCharge(b, -getEnergyConsumption());
|
||||
progress.put(b, timeleft - 1);
|
||||
}
|
||||
else progress.put(b, timeleft - 1);
|
||||
else {
|
||||
progress.put(b, timeleft - 1);
|
||||
}
|
||||
}
|
||||
else if (ChargableBlock.isChargable(b)) {
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ChargableBlock.addCharge(b, -getEnergyConsumption());
|
||||
|
||||
menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "));
|
||||
@ -88,19 +95,8 @@ public abstract class ElectricDustWasher extends AContainer {
|
||||
|
||||
private boolean process(Block b, BlockMenu menu, int slot) {
|
||||
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), SlimefunItems.SIFTED_ORE, true)) {
|
||||
if (!legacyMode) {
|
||||
boolean emptySlot = false;
|
||||
|
||||
for (int outputSlot : getOutputSlots()) {
|
||||
if (menu.getItemInSlot(outputSlot) == null) {
|
||||
emptySlot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!emptySlot) {
|
||||
return true;
|
||||
}
|
||||
if (!legacyMode && !hasFreeSlot(menu)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack adding = oreWasher.getRandomDust();
|
||||
@ -129,6 +125,16 @@ public abstract class ElectricDustWasher extends AContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean hasFreeSlot(BlockMenu menu) {
|
||||
for (int slot : getOutputSlots()) {
|
||||
if (menu.getItemInSlot(slot) == null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineIdentifier() {
|
||||
return "ELECTRIC_DUST_WASHER";
|
||||
|
@ -68,10 +68,14 @@ public abstract class ElectricGoldPan extends AContainer implements RecipeDispla
|
||||
ChargableBlock.addCharge(b, -getEnergyConsumption());
|
||||
progress.put(b, timeleft - 1);
|
||||
}
|
||||
else progress.put(b, timeleft - 1);
|
||||
else {
|
||||
progress.put(b, timeleft - 1);
|
||||
}
|
||||
}
|
||||
else if (ChargableBlock.isChargable(b)) {
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
|
||||
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) {
|
||||
return;
|
||||
}
|
||||
ChargableBlock.addCharge(b, -getEnergyConsumption());
|
||||
|
||||
menu.replaceExistingItem(22, new CustomItem(new ItemStack(Material.BLACK_STAINED_GLASS_PANE), " "));
|
||||
@ -83,13 +87,23 @@ public abstract class ElectricGoldPan extends AContainer implements RecipeDispla
|
||||
}
|
||||
else {
|
||||
for (int slot : getInputSlots()) {
|
||||
if (process(b, menu, slot)) {
|
||||
if (hasFreeSlot(menu) && process(b, menu, slot)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasFreeSlot(BlockMenu menu) {
|
||||
for (int slot : getOutputSlots()) {
|
||||
if (menu.getItemInSlot(slot) == null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean process(Block b, BlockMenu menu, int slot) {
|
||||
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), new ItemStack(Material.GRAVEL), true)) {
|
||||
ItemStack output = goldPan.getRandomOutput();
|
||||
|
Loading…
Reference in New Issue
Block a user