mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
fixing coal generator production to 20rf/t.
Cleaning up the furnace tile a bit.
This commit is contained in:
parent
af4f3c3c08
commit
1a3f223a4b
11 changed files with 41 additions and 33 deletions
|
@ -844,13 +844,13 @@ a63b57c27d8548ddd13d64d18b098d4f5c127a30 data/actuallyadditions/recipes/restonia
|
|||
85d2537a973d520c9eaaf2f15109c265faa2df3a data/actuallyadditions/recipes/rice_slime_potion.json
|
||||
d4ca5d77d16ff6fdfc60e665694fdd97bce25463 data/actuallyadditions/recipes/shock_suppressor.json
|
||||
655fab699bb97ec252deb61d91fbef6f4738fe1c data/actuallyadditions/recipes/single_battery.json
|
||||
cc4cd7379a8de3372d2a8310ea576bf5ca08c20e data/actuallyadditions/recipes/solid_fuel/charcoal-block.json
|
||||
8cb9b0e94a5de6e0bb74d808207ddf041d444280 data/actuallyadditions/recipes/solid_fuel/charcoal.json
|
||||
1207208a8393f613e537cb4542e1766a837282e4 data/actuallyadditions/recipes/solid_fuel/coal-block.json
|
||||
3a4c2b0ca2e150ef24edb2defe018f6574cb4827 data/actuallyadditions/recipes/solid_fuel/coal.json
|
||||
a7488a05a2fbc4e4017a4b7769f65ff8ce48613a data/actuallyadditions/recipes/solid_fuel/lava.json
|
||||
5bf07f52f8a4b7734a800dc64e5759caf48257b9 data/actuallyadditions/recipes/solid_fuel/stick.json
|
||||
1234e59cf88f96ae64032ce6bb0c734dc8870471 data/actuallyadditions/recipes/solid_fuel/tiny-coal.json
|
||||
dcf0bf28f7be72a9d65b7d34626d1a211c97365a data/actuallyadditions/recipes/solid_fuel/charcoal-block.json
|
||||
000ef9362f2202191f74132c3079ec4c1e2bfec8 data/actuallyadditions/recipes/solid_fuel/charcoal.json
|
||||
64211ff8cd4ae617f3be4bc6d7e9ff1f73c46e7d data/actuallyadditions/recipes/solid_fuel/coal-block.json
|
||||
340732fadc7be543ba9ae17f6f1c974022d31de3 data/actuallyadditions/recipes/solid_fuel/coal.json
|
||||
2bfd72d945bdffcb4c3daf722c85fcbc66cd5caa data/actuallyadditions/recipes/solid_fuel/lava.json
|
||||
7cea1293846d740cd9470ee0e86e12004ce36bd4 data/actuallyadditions/recipes/solid_fuel/stick.json
|
||||
652b6e46c68cc83528e47b09a57bef3c91ccbb07 data/actuallyadditions/recipes/solid_fuel/tiny-coal.json
|
||||
8ebd738f3968564e22ba6841eb821e5064c78588 data/actuallyadditions/recipes/stone_aiot.json
|
||||
bc7a41d9f36cc43e146e0b727b6f439cc0d29343 data/actuallyadditions/recipes/teleport_staff.json
|
||||
bdf7dbf563485903e444400d341e56d0bf308481 data/actuallyadditions/recipes/tiny_torch.json
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "actuallyadditions:charcoal_block"
|
||||
},
|
||||
"total_energy": 480000,
|
||||
"total_energy": 320000,
|
||||
"burn_time": 16000
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "minecraft:charcoal"
|
||||
},
|
||||
"total_energy": 48000,
|
||||
"total_energy": 32000,
|
||||
"burn_time": 1600
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "minecraft:coal_block"
|
||||
},
|
||||
"total_energy": 480000,
|
||||
"total_energy": 320000,
|
||||
"burn_time": 16000
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "minecraft:coal"
|
||||
},
|
||||
"total_energy": 48000,
|
||||
"total_energy": 32000,
|
||||
"burn_time": 1600
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "minecraft:lava_bucket"
|
||||
},
|
||||
"total_energy": 600000,
|
||||
"total_energy": 400000,
|
||||
"burn_time": 20000
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"item": "minecraft:stick"
|
||||
},
|
||||
"total_energy": 3000,
|
||||
"total_energy": 2000,
|
||||
"burn_time": 100
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
"item": {
|
||||
"tag": "actuallyadditions:tiny_coals"
|
||||
},
|
||||
"total_energy": 6000,
|
||||
"total_energy": 4000,
|
||||
"burn_time": 200
|
||||
}
|
|
@ -33,13 +33,13 @@ public class SolidFuelGenerator extends RecipeProvider {
|
|||
|
||||
@Override
|
||||
protected void buildShapelessRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
|
||||
addFuel(consumer, "coal", Items.COAL, 48000, 1600);
|
||||
addFuel(consumer, "stick", Items.STICK, 3000, 100);
|
||||
addFuel(consumer, "tiny-coal", ActuallyTags.Items.TINY_COALS, 6000, 200);
|
||||
addFuel(consumer, "charcoal", Items.CHARCOAL, 48000, 1600);
|
||||
addFuel(consumer, "coal-block", Items.COAL_BLOCK, 480000, 16000);
|
||||
addFuel(consumer, "charcoal-block", ActuallyBlocks.CHARCOAL_BLOCK.getItem(), 480000, 16000);
|
||||
addFuel(consumer, "lava", Items.LAVA_BUCKET, 600000, 20000);
|
||||
addFuel(consumer, "coal", Items.COAL, 32000, 1600);
|
||||
addFuel(consumer, "stick", Items.STICK, 2000, 100);
|
||||
addFuel(consumer, "tiny-coal", ActuallyTags.Items.TINY_COALS, 4000, 200);
|
||||
addFuel(consumer, "charcoal", Items.CHARCOAL, 32000, 1600);
|
||||
addFuel(consumer, "coal-block", Items.COAL_BLOCK, 320000, 16000);
|
||||
addFuel(consumer, "charcoal-block", ActuallyBlocks.CHARCOAL_BLOCK.getItem(), 320000, 16000);
|
||||
addFuel(consumer, "lava", Items.LAVA_BUCKET, 400000, 20000);
|
||||
}
|
||||
|
||||
private void addFuel(Consumer<IFinishedRecipe> consumer, String name, Item item, int energy, int burnTime) {
|
||||
|
|
|
@ -46,7 +46,6 @@ import java.util.Optional;
|
|||
|
||||
public class TileEntityCanolaPress extends TileEntityInventoryBase implements INamedContainerProvider, ISharingFluidHandler {
|
||||
|
||||
//public static final int PRODUCE = 80;
|
||||
public static final int ENERGY_USE = 35;
|
||||
private static final int TIME = 30;
|
||||
public final CustomEnergyStorage storage = new CustomEnergyStorage(40000, 100, 0);
|
||||
|
@ -64,10 +63,6 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IN
|
|||
super(ActuallyBlocks.CANOLA_PRESS.getTileEntityType(), 1);
|
||||
}
|
||||
|
||||
// public static boolean isCanola(ItemStack stack) {
|
||||
// return stack.getItem() == ActuallyBlocks.CANOLA.getItem();
|
||||
// }
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public int getTankScaled(int i) {
|
||||
return this.tank.getFluidAmount() * i / this.tank.getCapacity();
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.PressingRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.SingleItem;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||
|
@ -41,6 +43,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Optional;
|
||||
|
||||
public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider {
|
||||
|
||||
|
@ -184,9 +187,17 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
|
|||
}
|
||||
}
|
||||
|
||||
public boolean validInput(ItemStack stack) {
|
||||
return getOutputForInput(stack).isPresent();
|
||||
}
|
||||
|
||||
public Optional<ItemStack> getOutputForInput(ItemStack stack) {
|
||||
return level.getServer().getRecipeManager().getRecipeFor(IRecipeType.SMELTING, new SingleItem(stack), level).map(AbstractCookingRecipe::getResultItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAcceptor getAcceptor() {
|
||||
return (slot, stack, automation) -> !automation || (slot == SLOT_INPUT_1 || slot == SLOT_INPUT_2) && StackUtil.isValid(level.getServer().getRecipeManager().getRecipeFor(IRecipeType.SMELTING, new SingleItem(stack), this.level).map(AbstractCookingRecipe::getResultItem).orElse(ItemStack.EMPTY));
|
||||
return (slot, stack, automation) -> !automation || (slot == SLOT_INPUT_1 || slot == SLOT_INPUT_2) && validInput(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -195,18 +206,20 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
public boolean canSmeltOn(int theInput, int theOutput) {
|
||||
if (StackUtil.isValid(this.inv.getStackInSlot(theInput))) {
|
||||
ItemStack output = level.getServer().getRecipeManager().getRecipeFor(IRecipeType.SMELTING, new Inventory(this.inv.getStackInSlot(theInput)), this.level).map(AbstractCookingRecipe::getResultItem).orElse(ItemStack.EMPTY);
|
||||
if (StackUtil.isValid(output)) {
|
||||
return !StackUtil.isValid(this.inv.getStackInSlot(theOutput)) || this.inv.getStackInSlot(theOutput).sameItem(output) && this.inv.getStackInSlot(theOutput).getCount() <= this.inv.getStackInSlot(theOutput).getMaxStackSize() - output.getCount();
|
||||
ItemStack input = this.inv.getStackInSlot(theInput);
|
||||
ItemStack output = this.inv.getStackInSlot(theOutput);
|
||||
if (!input.isEmpty()) {
|
||||
ItemStack outputStack = getOutputForInput(input).orElse(ItemStack.EMPTY);
|
||||
if (!output.isEmpty()) {
|
||||
return output.isEmpty() || output.sameItem(outputStack) && output.getCount() <= output.getMaxStackSize() - outputStack.getCount();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void finishBurning(int theInput, int theOutput) {
|
||||
ItemStack output = level.getServer().getRecipeManager().getRecipeFor(IRecipeType.SMELTING, new Inventory(this.inv.getStackInSlot(theInput)), this.level).map(AbstractCookingRecipe::getResultItem).orElse(ItemStack.EMPTY);
|
||||
if (!StackUtil.isValid(this.inv.getStackInSlot(theOutput))) {
|
||||
ItemStack output = getOutputForInput(inv.getStackInSlot(theInput)).orElse(ItemStack.EMPTY);
|
||||
if (inv.getStackInSlot(theOutput).isEmpty()) {
|
||||
this.inv.setStackInSlot(theOutput, output.copy());
|
||||
} else if (this.inv.getStackInSlot(theOutput).getItem() == output.getItem()) {
|
||||
this.inv.getStackInSlot(theOutput).grow(output.getCount());
|
||||
|
|
Loading…
Reference in a new issue