This commit is contained in:
Shadows_of_Fire 2018-09-26 03:53:48 -04:00
parent 1240287b3b
commit e282f56928
3 changed files with 6 additions and 5 deletions

View file

@ -23,7 +23,7 @@ if(hasProperty('buildnumber')){
} }
minecraft { minecraft {
version = "1.12.2-14.23.4.2739" version = "1.12.2-14.23.4.2760"
runDir = "run" runDir = "run"
mappings = "snapshot_20180720" mappings = "snapshot_20180720"
makeObfSourceJar = false makeObfSourceJar = false

View file

@ -128,12 +128,12 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
@Override @Override
public IAcceptor getAcceptor() { 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 @Override
public IRemover getRemover() { 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() { 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 (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.storage.getEnergyStored() >= ENERGY_USED) {
if (this.brewTime % 30 == 0) { 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++; this.brewTime++;

View file

@ -172,8 +172,9 @@ public final class StackUtil {
* Helper method to remove stack size and return the stack. * Helper method to remove stack size and return the stack.
*/ */
public static ItemStack shrinkForContainer(ItemStack s, int i) { public static ItemStack shrinkForContainer(ItemStack s, int i) {
ItemStack sc = s.copy();
s.shrink(i); s.shrink(i);
if (s.isEmpty()) return s.getItem().getContainerItem(s); if (s.isEmpty()) return sc.getItem().getContainerItem(sc);
return s; return s;
} }