mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Closes #1174
This commit is contained in:
parent
1240287b3b
commit
e282f56928
3 changed files with 6 additions and 5 deletions
|
@ -23,7 +23,7 @@ if(hasProperty('buildnumber')){
|
|||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.4.2739"
|
||||
version = "1.12.2-14.23.4.2760"
|
||||
runDir = "run"
|
||||
mappings = "snapshot_20180720"
|
||||
makeObfSourceJar = false
|
||||
|
|
|
@ -128,12 +128,12 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
|
||||
@Override
|
||||
public IAcceptor getAcceptor() {
|
||||
return (slot, stack, automation) -> (slot >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (slot == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (slot == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal());
|
||||
return (slot, stack, automation) -> !automation || (slot >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (slot == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (slot == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRemover getRemover() {
|
||||
return (slot, automation) -> slot == SLOT_OUTPUT || (slot >= 3 && slot < this.inv.getSlots() && ItemCoffee.getIngredientFromStack(inv.getStackInSlot(slot)) == null);
|
||||
return (slot, automation) -> !automation || slot == SLOT_OUTPUT || (slot >= 3 && slot < this.inv.getSlots() && ItemCoffee.getIngredientFromStack(inv.getStackInSlot(slot)) == null);
|
||||
}
|
||||
|
||||
public void storeCoffee() {
|
||||
|
@ -152,7 +152,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
if (StackUtil.isValid(input) && input.getItem() == InitItems.itemMisc && input.getItemDamage() == TheMiscItems.CUP.ordinal() && !StackUtil.isValid(this.inv.getStackInSlot(SLOT_OUTPUT)) && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE) {
|
||||
if (this.storage.getEnergyStored() >= ENERGY_USED) {
|
||||
if (this.brewTime % 30 == 0) {
|
||||
this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.coffeeMachine, SoundCategory.BLOCKS, 0.35F, 1.0F);
|
||||
this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.coffeeMachine, SoundCategory.BLOCKS, 0.1F, 1.0F);
|
||||
}
|
||||
|
||||
this.brewTime++;
|
||||
|
|
|
@ -172,8 +172,9 @@ public final class StackUtil {
|
|||
* Helper method to remove stack size and return the stack.
|
||||
*/
|
||||
public static ItemStack shrinkForContainer(ItemStack s, int i) {
|
||||
ItemStack sc = s.copy();
|
||||
s.shrink(i);
|
||||
if (s.isEmpty()) return s.getItem().getContainerItem(s);
|
||||
if (s.isEmpty()) return sc.getItem().getContainerItem(sc);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue