20w15a
This commit is contained in:
parent
0bf6159801
commit
55f9a5df52
33 changed files with 195 additions and 360 deletions
|
@ -56,8 +56,8 @@ public class FluidUtils {
|
|||
}
|
||||
|
||||
public static boolean drainContainers(GenericFluidContainer<Direction> target, Inventory inventory, int inputSlot, int outputSlot) {
|
||||
ItemStack inputStack = inventory.getInvStack(inputSlot);
|
||||
ItemStack outputStack = inventory.getInvStack(outputSlot);
|
||||
ItemStack inputStack = inventory.getStack(inputSlot);
|
||||
ItemStack outputStack = inventory.getStack(outputSlot);
|
||||
|
||||
if(!(inputStack.getItem() instanceof ItemFluidInfo)) return false;
|
||||
if (outputStack.getCount() >= outputStack.getMaxCount()) return false;
|
||||
|
@ -82,7 +82,7 @@ public class FluidUtils {
|
|||
targetFluidInstance.addAmount(FluidValue.BUCKET);
|
||||
|
||||
if(outputStack.isEmpty()){
|
||||
inventory.setInvStack(outputSlot, itemFluidInfo.getEmpty());
|
||||
inventory.setStack(outputSlot, itemFluidInfo.getEmpty());
|
||||
} else {
|
||||
outputStack.increment(1);
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ public class FluidUtils {
|
|||
}
|
||||
|
||||
public static boolean fillContainers(GenericFluidContainer<Direction> source, Inventory inventory, int inputSlot, int outputSlot, Fluid fluidToFill) {
|
||||
ItemStack inputStack = inventory.getInvStack(inputSlot);
|
||||
ItemStack outputStack = inventory.getInvStack(outputSlot);
|
||||
ItemStack inputStack = inventory.getStack(inputSlot);
|
||||
ItemStack outputStack = inventory.getStack(outputSlot);
|
||||
|
||||
if(!(inputStack.getItem() instanceof ItemFluidInfo)) return false;
|
||||
if (!FluidUtils.isContainerEmpty(inputStack)) return false;
|
||||
|
@ -119,7 +119,7 @@ public class FluidUtils {
|
|||
}
|
||||
|
||||
if(outputStack.isEmpty()){
|
||||
inventory.setInvStack(outputSlot, itemFluidInfo.getFull(sourceFluid.getFluid()));
|
||||
inventory.setStack(outputSlot, itemFluidInfo.getFull(sourceFluid.getFluid()));
|
||||
} else {
|
||||
outputStack.increment(1);
|
||||
}
|
||||
|
|
|
@ -50,8 +50,8 @@ public final class PoweredCraftingHandler implements ItemCraftCallback {
|
|||
@Override
|
||||
public void onCraft(ItemStack stack, CraftingInventory craftingInventory, PlayerEntity playerEntity) {
|
||||
if (Energy.valid(stack)) {
|
||||
double totalEnergy = IntStream.range(0, craftingInventory.getInvSize())
|
||||
.mapToObj(craftingInventory::getInvStack)
|
||||
double totalEnergy = IntStream.range(0, craftingInventory.size())
|
||||
.mapToObj(craftingInventory::getStack)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.filter(Energy::valid)
|
||||
.mapToDouble(s -> Energy.of(s).getEnergy())
|
||||
|
@ -64,8 +64,8 @@ public final class PoweredCraftingHandler implements ItemCraftCallback {
|
|||
return;
|
||||
}
|
||||
Map<Enchantment, Integer> map = Maps.newLinkedHashMap();
|
||||
for (int i = 0; i < craftingInventory.getInvSize(); i++){
|
||||
ItemStack ingredient = craftingInventory.getInvStack(i);
|
||||
for (int i = 0; i < craftingInventory.size(); i++){
|
||||
ItemStack ingredient = craftingInventory.getStack(i);
|
||||
if (ingredient.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue