This commit is contained in:
modmuss50 2019-06-13 13:14:11 +01:00
parent 4479116d1c
commit f8f20ce6ba
81 changed files with 280 additions and 434 deletions

View file

@ -65,7 +65,7 @@ public class TileTechStorageBase extends TileMachineBase
}
if (!storedItem.isEmpty()) {
storedItem.setAmount(Math.min(tagCompound.getInt("storedQuantity"), this.maxCapacity));
storedItem.setCount(Math.min(tagCompound.getInt("storedQuantity"), this.maxCapacity));
}
inventory.read(tagCompound);
@ -74,11 +74,11 @@ public class TileTechStorageBase extends TileMachineBase
public CompoundTag writeWithoutCoords(CompoundTag tagCompound) {
if (!storedItem.isEmpty()) {
ItemStack temp = storedItem.copy();
if (storedItem.getAmount() > storedItem.getMaxAmount()) {
temp.setAmount(storedItem.getMaxAmount());
if (storedItem.getCount() > storedItem.getMaxCount()) {
temp.setCount(storedItem.getMaxCount());
}
tagCompound.put("storedStack", temp.toTag(new CompoundTag()));
tagCompound.putInt("storedQuantity", Math.min(storedItem.getAmount(), maxCapacity));
tagCompound.putInt("storedQuantity", Math.min(storedItem.getCount(), maxCapacity));
} else {
tagCompound.putInt("storedQuantity", 0);
}
@ -92,7 +92,7 @@ public class TileTechStorageBase extends TileMachineBase
writeWithoutCoords(tileEntity);
dropStack.setTag(new CompoundTag());
dropStack.getTag().put("tileEntity", tileEntity);
storedItem.setAmount(0);
storedItem.setCount(0);
inventory.setStackInSlot(1, ItemStack.EMPTY);
syncWithAll();
@ -100,7 +100,7 @@ public class TileTechStorageBase extends TileMachineBase
}
public int getStoredCount() {
return storedItem.getAmount();
return storedItem.getCount();
}
public List<ItemStack> getContentDrops() {
@ -110,15 +110,15 @@ public class TileTechStorageBase extends TileMachineBase
if (!inventory.getInvStack(1).isEmpty()) {
stacks.add(inventory.getInvStack(1));
}
int size = storedItem.getMaxAmount();
int size = storedItem.getMaxCount();
for (int i = 0; i < getStoredCount() / size; i++) {
ItemStack droped = storedItem.copy();
droped.setAmount(size);
droped.setCount(size);
stacks.add(droped);
}
if (getStoredCount() % size != 0) {
ItemStack droped = storedItem.copy();
droped.setAmount(getStoredCount() % size);
droped.setCount(getStoredCount() % size);
stacks.add(droped);
}
}
@ -136,7 +136,7 @@ public class TileTechStorageBase extends TileMachineBase
outputStack = inventory.getInvStack(1);
}
if (!inventory.getInvStack(0).isEmpty()
&& (storedItem.getAmount() + outputStack.getAmount()) < maxCapacity) {
&& (storedItem.getCount() + outputStack.getCount()) < maxCapacity) {
ItemStack inputStack = inventory.getInvStack(0);
if (getStoredItemType().isEmpty()
|| (storedItem.isEmpty() && ItemUtils.isItemEqual(inputStack, outputStack, true, true))) {
@ -144,13 +144,13 @@ public class TileTechStorageBase extends TileMachineBase
storedItem = inputStack;
inventory.setStackInSlot(0, ItemStack.EMPTY);
} else if (ItemUtils.isItemEqual(getStoredItemType(), inputStack, true, true)) {
int reminder = maxCapacity - storedItem.getAmount() - outputStack.getAmount();
if (inputStack.getAmount() <= reminder) {
setStoredItemCount(inputStack.getAmount());
int reminder = maxCapacity - storedItem.getCount() - outputStack.getCount();
if (inputStack.getCount() <= reminder) {
setStoredItemCount(inputStack.getCount());
inventory.setStackInSlot(0, ItemStack.EMPTY);
} else {
setStoredItemCount(maxCapacity - outputStack.getAmount());
inventory.getInvStack(0).subtractAmount(reminder);
setStoredItemCount(maxCapacity - outputStack.getCount());
inventory.getInvStack(0).decrement(reminder);
}
}
markDirty();
@ -161,8 +161,8 @@ public class TileTechStorageBase extends TileMachineBase
if (outputStack.isEmpty()) {
ItemStack delivered = storedItem.copy();
delivered.setAmount(Math.min(storedItem.getAmount(), delivered.getMaxAmount()));
storedItem.subtractAmount(delivered.getAmount());
delivered.setCount(Math.min(storedItem.getCount(), delivered.getMaxCount()));
storedItem.decrement(delivered.getCount());
if (storedItem.isEmpty()) {
storedItem = ItemStack.EMPTY;
@ -172,12 +172,12 @@ public class TileTechStorageBase extends TileMachineBase
markDirty();
syncWithAll();
} else if (ItemUtils.isItemEqual(storedItem, outputStack, true, true)
&& outputStack.getAmount() < outputStack.getMaxAmount()) {
&& outputStack.getCount() < outputStack.getMaxCount()) {
int wanted = Math.min(storedItem.getAmount(),
outputStack.getMaxAmount() - outputStack.getAmount());
outputStack.setAmount(outputStack.getAmount() + wanted);
storedItem.subtractAmount(wanted);
int wanted = Math.min(storedItem.getCount(),
outputStack.getMaxCount() - outputStack.getCount());
outputStack.setCount(outputStack.getCount() + wanted);
storedItem.decrement(wanted);
if (storedItem.isEmpty()) {
storedItem = ItemStack.EMPTY;
@ -226,12 +226,12 @@ public class TileTechStorageBase extends TileMachineBase
int size = 0;
String name = "of nothing";
if (!storedItem.isEmpty()) {
name = storedItem.getDisplayName().getString();
size += storedItem.getAmount();
name = storedItem.getCustomName().getString();
size += storedItem.getCount();
}
if (!inventory.getInvStack(1).isEmpty()) {
name = inventory.getInvStack(1).getDisplayName().getString();
size += inventory.getInvStack(1).getAmount();
name = inventory.getInvStack(1).getCustomName().getString();
size += inventory.getInvStack(1).getCount();
}
info.add(new TextComponent(size + " " + name));
}
@ -243,13 +243,13 @@ public class TileTechStorageBase extends TileMachineBase
public void setStoredItemCount(int amount) {
storedItem.addAmount(amount);
storedItem.increment(amount);
markDirty();
}
public void setStoredItemType(ItemStack type, int amount) {
storedItem = type;
storedItem.setAmount(amount);
storedItem.setCount(amount);
markDirty();
}

View file

@ -139,7 +139,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
return true;
}
if (ItemUtils.isItemEqual(inventory.getInvStack(slot), stack, true, tags)) {
if (stack.getAmount() + inventory.getInvStack(slot).getAmount() <= stack.getMaxAmount()) {
if (stack.getCount() + inventory.getInvStack(slot).getCount() <= stack.getMaxCount()) {
return true;
}
}
@ -241,9 +241,9 @@ public class TileFusionControlComputer extends TilePowerAcceptor
if (canUseEnergy(currentRecipe.getStartEU())) {
useEnergy(currentRecipe.getStartEU());
hasStartedCrafting = true;
inventory.shrinkSlot(topStackSlot, currentRecipe.getTopInput().getAmount());
inventory.shrinkSlot(topStackSlot, currentRecipe.getTopInput().getCount());
if (!currentRecipe.getBottomInput().isEmpty()) {
inventory.shrinkSlot(bottomStackSlot, currentRecipe.getBottomInput().getAmount());
inventory.shrinkSlot(bottomStackSlot, currentRecipe.getBottomInput().getCount());
}
}
}
@ -264,13 +264,13 @@ public class TileFusionControlComputer extends TilePowerAcceptor
if (inventory.getInvStack(outputStackSlot).isEmpty()) {
inventory.setStackInSlot(outputStackSlot, currentRecipe.getOutput().copy());
} else {
inventory.shrinkSlot(outputStackSlot, -currentRecipe.getOutput().getAmount());
inventory.shrinkSlot(outputStackSlot, -currentRecipe.getOutput().getCount());
}
if (validateReactorRecipe(this.currentRecipe)) {
crafingTickTime = 0;
inventory.shrinkSlot(topStackSlot, currentRecipe.getTopInput().getAmount());
inventory.shrinkSlot(topStackSlot, currentRecipe.getTopInput().getCount());
if (!currentRecipe.getBottomInput().isEmpty()) {
inventory.shrinkSlot(bottomStackSlot, currentRecipe.getBottomInput().getAmount());
inventory.shrinkSlot(bottomStackSlot, currentRecipe.getBottomInput().getCount());
}
} else {
resetCrafter();

View file

@ -95,7 +95,7 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr
if (burnTime > 0) {
updateState();
burnItem = inventory.getInvStack(fuelSlot);
if (inventory.getInvStack(fuelSlot).getAmount() == 1) {
if (inventory.getInvStack(fuelSlot).getCount() == 1) {
if (inventory.getInvStack(fuelSlot).getItem() == Items.LAVA_BUCKET || inventory.getInvStack(fuelSlot).getItem() instanceof BucketItem) {
inventory.setStackInSlot(fuelSlot, new ItemStack(Items.BUCKET));
} else {

View file

@ -148,10 +148,10 @@ public class TileIronAlloyFurnace extends TileMachineBase
return false;
if (inventory.getInvStack(this.output).isEmpty())
return true;
if (!inventory.getInvStack(this.output).isEqualIgnoreTags(itemstack))
if (!inventory.getInvStack(this.output).isItemEqualIgnoreDamage(itemstack))
return false;
final int result = inventory.getInvStack(this.output).getAmount() + itemstack.getAmount();
return result <= inventory.getStackLimit() && result <= inventory.getInvStack(this.output).getMaxAmount(); // Forge
final int result = inventory.getInvStack(this.output).getCount() + itemstack.getCount();
return result <= inventory.getStackLimit() && result <= inventory.getInvStack(this.output).getMaxCount(); // Forge
// BugFix:
// Make
// it
@ -182,7 +182,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
if (inventory.getInvStack(this.output).isEmpty()) {
inventory.setStackInSlot(this.output, itemstack.copy());
} else if (inventory.getInvStack(this.output).getItem() == itemstack.getItem()) {
inventory.shrinkSlot(this.output, -itemstack.getAmount());
inventory.shrinkSlot(this.output, -itemstack.getCount());
}
for (final RebornRecipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {

View file

@ -92,9 +92,9 @@ public class TileIronFurnace extends TileMachineBase
ItemStack fuelStack = inventory.getInvStack(this.fuelslot);
if (fuelStack.getItem().hasRecipeRemainder()) {
inventory.setStackInSlot(this.fuelslot, new ItemStack(fuelStack.getItem().getRecipeRemainder()));
} else if (fuelStack.getAmount() > 1) {
} else if (fuelStack.getCount() > 1) {
inventory.shrinkSlot(this.fuelslot, 1);
} else if (fuelStack.getAmount() == 1) {
} else if (fuelStack.getCount() == 1) {
inventory.setStackInSlot(this.fuelslot, ItemStack.EMPTY);
}
updateInventory = true;
@ -124,10 +124,10 @@ public class TileIronFurnace extends TileMachineBase
if (inventory.getInvStack(this.output).isEmpty()) {
inventory.setStackInSlot(this.output, itemstack.copy());
} else if (inventory.getInvStack(this.output).isEqualIgnoreTags(itemstack)) {
inventory.getInvStack(this.output).addAmount(itemstack.getAmount());
} else if (inventory.getInvStack(this.output).isItemEqualIgnoreDamage(itemstack)) {
inventory.getInvStack(this.output).increment(itemstack.getCount());
}
if (inventory.getInvStack(this.input1).getAmount() > 1) {
if (inventory.getInvStack(this.input1).getCount() > 1) {
inventory.shrinkSlot(this.input1, 1);
} else {
inventory.setStackInSlot(this.input1, ItemStack.EMPTY);
@ -143,10 +143,10 @@ public class TileIronFurnace extends TileMachineBase
return false;
if (inventory.getInvStack(this.output).isEmpty())
return true;
if (!inventory.getInvStack(this.output).isEqualIgnoreTags(itemstack))
if (!inventory.getInvStack(this.output).isItemEqualIgnoreDamage(itemstack))
return false;
final int result = inventory.getInvStack(this.output).getAmount() + itemstack.getAmount();
return result <= inventory.getStackLimit() && result <= itemstack.getMaxAmount();
final int result = inventory.getInvStack(this.output).getCount() + itemstack.getCount();
return result <= inventory.getStackLimit() && result <= itemstack.getMaxCount();
}
public boolean isBurning() {
@ -181,7 +181,7 @@ public class TileIronFurnace extends TileMachineBase
boolean isFuel = FurnaceBlockEntity.canUseAsFuel(stack);
if(isFuel){
ItemStack fuelSlotStack = tile.inventory.getInvStack(tile.fuelslot);
if(fuelSlotStack.isEmpty() || ItemUtils.isItemEqual(stack, fuelSlotStack, true, true) && fuelSlotStack.getMaxAmount() != fuelSlotStack.getAmount()){
if(fuelSlotStack.isEmpty() || ItemUtils.isItemEqual(stack, fuelSlotStack, true, true) && fuelSlotStack.getMaxCount() != fuelSlotStack.getCount()){
return slotID == tile.fuelslot;
}
}

View file

@ -43,18 +43,18 @@ import techreborn.tiles.TileGenericMachine;
@RebornRegister(TechReborn.MOD_ID)
public class TileDistillationTower extends TileGenericMachine implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "EnvTypeillation_tower", key = "EnvTypeillationTowerMaxInput", comment = "EnvTypeillation Tower Max Input (Value in EU)")
@ConfigRegistry(config = "machines", category = "Distillation_tower", key = "DistillationTowerMaxInput", comment = "Distillation Tower Max Input (Value in EU)")
public static int maxInput = 128;
@ConfigRegistry(config = "machines", category = "EnvTypeillation_tower", key = "EnvTypeillationTowerMaxEnergy", comment = "EnvTypeillation Tower Max Energy (Value in EU)")
@ConfigRegistry(config = "machines", category = "Distillation_tower", key = "DistillationTowerMaxEnergy", comment = "Distillation Tower Max Energy (Value in EU)")
public static int maxEnergy = 10_000;
public MultiblockChecker multiblockChecker;
public TileDistillationTower() {
super(TRTileEntities.EnvTypeILLATION_TOWER,"EnvTypeillationTower", maxInput, maxEnergy, TRContent.Machine.EnvTypeILLATION_TOWER.block, 6);
super(TRTileEntities.DISTILLATION_TOWER,"DistillationTower", maxInput, maxEnergy, TRContent.Machine.DISTILLATION_TOWER.block, 6);
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new Inventory<>(7, "TileEnvTypeillationTower", 64, this).withConfiguredAccess();
this.inventory = new Inventory<>(7, "TileDistillationTower", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(ModRecipes.DISTILLATION_TOWER, this, 2, 4, this.inventory, inputs, outputs);
}
@ -89,7 +89,7 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
// IContainerProvider
@Override
public BuiltContainer createContainer(final PlayerEntity player) {
return new ContainerBuilder("EnvTypeillationtower").player(player.inventory).inventory().hotbar().addInventory()
return new ContainerBuilder("Distillationtower").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).slot(0, 35, 27).slot(1, 35, 47).outputSlot(2, 79, 37).outputSlot(3, 99, 37)
.outputSlot(4, 119, 37).outputSlot(5, 139, 37).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
.addInventory().create(this);

View file

@ -126,7 +126,7 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
private static IInventoryAccess<TileFluidReplicator> getInventoryAccess(){
return (slotID, stack, face, direction, tile) -> {
if(slotID == 0){
return stack.isEqualIgnoreTags(TRContent.Parts.UU_MATTER.getStack());
return stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack());
}
return true;
};
@ -143,7 +143,7 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
@Override
public BuiltContainer createContainer(PlayerEntity player) {
return new ContainerBuilder("fluidreplicator").player(player.inventory).inventory().hotbar().addInventory()
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isEqualIgnoreTags(TRContent.Parts.UU_MATTER.getStack()))
.tile(this).fluidSlot(1, 124, 35).filterSlot(0, 55, 45, stack -> stack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack()))
.outputSlot(2, 124, 55).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
.create(this);
}

View file

@ -123,7 +123,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
boolean missingOutput = false;
int[] stacksInSlots = new int[9];
for (int i = 0; i < 9; i++) {
stacksInSlots[i] = inventory.getInvStack(i).getAmount();
stacksInSlots[i] = inventory.getInvStack(i).getCount();
}
DefaultedList<Ingredient> ingredients = recipe.getPreviewInputs();
@ -133,7 +133,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
for (int i = 0; i < 9; i++) {
ItemStack stack = inventory.getInvStack(i);
int requiredSize = locked ? 1 : 0;
if (stack.getMaxAmount() == 1) {
if (stack.getMaxCount() == 1) {
requiredSize = 0;
}
if (stacksInSlots[i] > requiredSize) {
@ -178,7 +178,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
return true;
}
if (ItemUtils.isItemEqual(stack, output, true, true)) {
if (stack.getMaxAmount() > stack.getAmount() + output.getAmount()) {
if (stack.getMaxCount() > stack.getCount() + output.getCount()) {
return true;
}
}
@ -196,13 +196,13 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
ItemStack bestSlot = inventory.getInvStack(i);
if (ingredient.method_8093(bestSlot)) {
handleContainerItem(bestSlot);
bestSlot.subtractAmount(1);
bestSlot.decrement(1);
} else {
for (int j = 0; j < 9; j++) {
ItemStack stack = inventory.getInvStack(j);
if (ingredient.method_8093(stack)) {
handleContainerItem(stack);
stack.subtractAmount(1); // TODO is this right? or do I need
stack.decrement(1); // TODO is this right? or do I need
// to use it as an actull
// crafting grid
break;
@ -217,7 +217,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
inventory.setStackInSlot(9, ouputStack.copy());
} else {
// TODO use ouputStack in someway?
output.addAmount(recipe.getOutput().getAmount());
output.increment(recipe.getOutput().getCount());
}
return true;
}
@ -230,8 +230,8 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
if (extraOutputSlot.isEmpty()) {
inventory.setStackInSlot(10, containerItem.copy());
} else if (ItemUtils.isItemEqual(extraOutputSlot, containerItem, true, true)
&& extraOutputSlot.getMaxAmount() < extraOutputSlot.getAmount() + containerItem.getAmount()) {
extraOutputSlot.addAmount(1);
&& extraOutputSlot.getMaxCount() < extraOutputSlot.getCount() + containerItem.getCount()) {
extraOutputSlot.increment(1);
}
}
}
@ -271,7 +271,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
if (stackInSlot.isEmpty()) {
possibleSlots.add(i);
} else if (stackInSlot.getItem() == stack.getItem()) {
if (stackInSlot.getMaxAmount() >= stackInSlot.getAmount() + stack.getAmount()) {
if (stackInSlot.getMaxCount() >= stackInSlot.getCount() + stack.getCount()) {
possibleSlots.add(i);
}
}
@ -285,9 +285,9 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
return slot;
}
if (smallestCount == null) {
smallestCount = Pair.of(slot, slotStack.getAmount());
} else if (smallestCount.getRight() >= slotStack.getAmount()) {
smallestCount = Pair.of(slot, slotStack.getAmount());
smallestCount = Pair.of(slot, slotStack.getCount());
} else if (smallestCount.getRight() >= slotStack.getCount()) {
smallestCount = Pair.of(slot, slotStack.getCount());
}
}
if (smallestCount != null) {

View file

@ -75,10 +75,10 @@ public class TileElectricFurnace extends TilePowerAcceptor
if (inventory.getInvStack(output).isEmpty()) {
inventory.setStackInSlot(output, itemstack.copy());
} else if (inventory.getInvStack(output).isEqualIgnoreTags(itemstack)) {
inventory.getInvStack(output).addAmount(itemstack.getAmount());
} else if (inventory.getInvStack(output).isItemEqualIgnoreDamage(itemstack)) {
inventory.getInvStack(output).increment(itemstack.getCount());
}
if (inventory.getInvStack(input1).getAmount() > 1) {
if (inventory.getInvStack(input1).getCount() > 1) {
inventory.shrinkSlot(input1, 1);
} else {
inventory.setStackInSlot(input1, ItemStack.EMPTY);
@ -97,11 +97,11 @@ public class TileElectricFurnace extends TilePowerAcceptor
if (inventory.getInvStack(output).isEmpty()) {
return true;
}
if (!inventory.getInvStack(output).isEqualIgnoreTags(itemstack)) {
if (!inventory.getInvStack(output).isItemEqualIgnoreDamage(itemstack)) {
return false;
}
final int result = inventory.getInvStack(output).getAmount() + itemstack.getAmount();
return result <= this.inventory.getStackLimit() && result <= itemstack.getMaxAmount();
final int result = inventory.getInvStack(output).getCount() + itemstack.getCount();
return result <= this.inventory.getStackLimit() && result <= itemstack.getMaxCount();
}
public boolean isBurning() {

View file

@ -86,7 +86,7 @@ public class TileRecycler extends TilePowerAcceptor
inventory.setStackInSlot(1, itemstack.copy());
}
else {
inventory.getInvStack(1).addAmount(itemstack.getAmount());
inventory.getInvStack(1).increment(itemstack.getCount());
}
}
inventory.shrinkSlot(0, 1);
@ -99,7 +99,7 @@ public class TileRecycler extends TilePowerAcceptor
public boolean hasSlotGotSpace(int slot) {
if (inventory.getInvStack(slot).isEmpty()) {
return true;
} else if (inventory.getInvStack(slot).getAmount() < inventory.getInvStack(slot).getMaxAmount()) {
} else if (inventory.getInvStack(slot).getCount() < inventory.getInvStack(slot).getMaxCount()) {
return true;
}
return false;

View file

@ -148,10 +148,10 @@ public class TileRollingMachine extends TilePowerAcceptor
tickTime = 0;
hasCrafted = true;
} else {
if (inventory.getInvStack(outputSlot).getAmount()
+ currentRecipeOutput.getAmount() <= currentRecipeOutput.getMaxAmount()) {
if (inventory.getInvStack(outputSlot).getCount()
+ currentRecipeOutput.getCount() <= currentRecipeOutput.getMaxCount()) {
final ItemStack stack = inventory.getInvStack(outputSlot);
stack.setAmount(stack.getAmount() + currentRecipeOutput.getAmount());
stack.setCount(stack.getCount() + currentRecipeOutput.getCount());
inventory.setStackInSlot(outputSlot, stack);
tickTime = 0;
hasCrafted = true;
@ -237,7 +237,7 @@ public class TileRollingMachine extends TilePowerAcceptor
if(!possibleSlots.isEmpty()){
int totalItems = possibleSlots.stream()
.mapToInt(value -> inventory.getInvStack(value).getAmount()).sum();
.mapToInt(value -> inventory.getInvStack(value).getCount()).sum();
int slots = possibleSlots.size();
//This makes an array of ints with the best possible slot EnvTyperibution
@ -254,7 +254,7 @@ public class TileRollingMachine extends TilePowerAcceptor
}
List<Integer> slotEnvTyperubution = possibleSlots.stream()
.mapToInt(value -> inventory.getInvStack(value).getAmount())
.mapToInt(value -> inventory.getInvStack(value).getCount())
.boxed().collect(Collectors.toList());
boolean needsBalance = false;
@ -282,20 +282,20 @@ public class TileRollingMachine extends TilePowerAcceptor
bestSlot = Pair.of(slot, 0);
}
if (bestSlot == null) {
bestSlot = Pair.of(slot, slotStack.getAmount());
} else if (bestSlot.getRight() >= slotStack.getAmount()) {
bestSlot = Pair.of(slot, slotStack.getAmount());
bestSlot = Pair.of(slot, slotStack.getCount());
} else if (bestSlot.getRight() >= slotStack.getCount()) {
bestSlot = Pair.of(slot, slotStack.getCount());
}
}
if (bestSlot == null
|| bestSlot.getLeft() == balanceSlot
|| bestSlot.getRight() == sourceStack.getAmount()
|| bestSlot.getRight() == sourceStack.getCount()
|| inventory.getInvStack(bestSlot.getLeft()).isEmpty()
|| !ItemUtils.isItemEqual(sourceStack, inventory.getInvStack(bestSlot.getLeft()), true, true)) {
return Optional.empty();
}
sourceStack.subtractAmount(1);
inventory.getInvStack(bestSlot.getLeft()).addAmount(1);
sourceStack.decrement(1);
inventory.getInvStack(bestSlot.getLeft()).increment(1);
inventory.setChanged();
return Optional.of(getCraftingMatrix());
@ -319,7 +319,7 @@ public class TileRollingMachine extends TilePowerAcceptor
if (locked) {
for (int i = 0; i < craftMatrix.getInvSize(); i++) {
ItemStack stack1 = craftMatrix.getInvStack(i);
if (!stack1.isEmpty() && stack1.getAmount() < 2) {
if (!stack1.isEmpty() && stack1.getCount() < 2) {
return false;
}
}

View file

@ -38,11 +38,11 @@ public class TileCreativeQuantumChest extends TileQuantumChest {
super.tick();
ItemStack stack = inventory.getInvStack(1);
if (!stack.isEmpty() && storedItem.isEmpty()) {
stack.setAmount(stack.getMaxAmount());
stack.setCount(stack.getMaxCount());
storedItem = stack.copy();
}
storedItem.setAmount(maxCapacity - storedItem.getMaxAmount());
storedItem.setCount(maxCapacity - storedItem.getMaxCount());
}
@Override

View file

@ -73,7 +73,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
private boolean spaceForOutput(int slot) {
return inventory.getInvStack(slot).isEmpty()
|| ItemUtils.isItemEqual(inventory.getInvStack(slot), TRContent.Parts.UU_MATTER.getStack(), true, true)
&& inventory.getInvStack(slot).getAmount() < 64;
&& inventory.getInvStack(slot).getCount() < 64;
}
private void addOutputProducts() {
@ -90,7 +90,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
inventory.setStackInSlot(slot, TRContent.Parts.UU_MATTER.getStack());
}
else if (ItemUtils.isItemEqual(this.inventory.getInvStack(slot), TRContent.Parts.UU_MATTER.getStack(), true, true)) {
inventory.getInvStack(slot).setAmount((Math.min(64, 1 + inventory.getInvStack(slot).getAmount())));
inventory.getInvStack(slot).setCount((Math.min(64, 1 + inventory.getInvStack(slot).getCount())));
}
}
@ -109,7 +109,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
}
public int getValue(ItemStack itemStack) {
if (itemStack.isEqualIgnoreTags(TRContent.Parts.SCRAP.getStack())) {
if (itemStack.isItemEqualIgnoreDamage(TRContent.Parts.SCRAP.getStack())) {
return 200;
} else if (itemStack.getItem() == TRContent.SCRAP_BOX) {
return 2000;