Compare commits

..

9 commits

Author SHA1 Message Date
Flanks255
f32f7187cc Fixed project not loading for Flanks 2024-10-17 16:56:04 -05:00
Mrbysco
87a24eb19f Increment version 2024-10-17 21:26:22 +02:00
Mrbysco
556fa487be Fix Enervator and Energizer gui crashing 2024-10-17 21:17:23 +02:00
Mrbysco
6aceee7365 Increment version 2024-10-17 19:54:51 +02:00
Mrbysco
8fd600dc86 Fix energy storage 2024-10-17 19:54:11 +02:00
Mrbysco
e870e5c48b Fix laser crash 2024-10-17 19:54:04 +02:00
Mrbysco
decfaef9c3 Update changelog.md 2024-10-17 19:14:07 +02:00
Mrbysco
27de160097 Increment version 2024-10-17 19:00:06 +02:00
Mrbysco
124cac11e4 Fix up Nether Wart farmer behavior 2024-10-17 18:53:49 +02:00
33 changed files with 151 additions and 134 deletions

View file

@ -115,18 +115,6 @@ jar {
from sourceSets.main.output from sourceSets.main.output
} }
processResources {
inputs.property('version', project.version)
inputs.property('neo_version_range', project.neo_version_range)
inputs.property('loader', project.loader)
inputs.property('minecraft_version_range', project.minecraft_version_range)
filesMatching(['META-INF/neoforge.mods.toml']) {
expand 'version': project.version, 'neo_version_range': project.neo_version_range, 'loader': project.loader, 'minecraft_version_range': project.minecraft_version_range
}
}
task apiJar(type: Jar) { task apiJar(type: Jar) {
from sourceSets.main.output from sourceSets.main.output
from sourceSets.main.java from sourceSets.main.java

View file

@ -2,17 +2,12 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
# Actually Additions # Actually Additions
mod_version=1.2.14 mod_version=1.3.2
# Forge # Forge
game_version=1.21.1 game_version=1.21.1
neo_version=21.1.71 neo_version=21.1.71
# mods.toml
loader=4
neo_version_range=[21.1.1,)
minecraft_version_range=[1.21.1,1.22)
# Parchment (Mappings) # Parchment (Mappings)
neogradle.subsystems.parchment.minecraftVersion=1.21 neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.07.28 neogradle.subsystems.parchment.mappingsVersion=2024.07.28

View file

@ -72,7 +72,7 @@ public class BlockShockSuppressor extends Block implements EntityBlock {
for (BlockPos pos : posesToRemove) { for (BlockPos pos : posesToRemove) {
if (suppressor.storage.getEnergyStored() >= use) { if (suppressor.storage.getEnergyStored() >= use) {
suppressor.storage.extractEnergy(use, false); suppressor.storage.extractEnergyInternal(use, false);
affectedBlocks.remove(pos); affectedBlocks.remove(pos);
} else { } else {
break; break;
@ -80,7 +80,7 @@ public class BlockShockSuppressor extends Block implements EntityBlock {
} }
for (Entity entity : entitiesToRemove) { for (Entity entity : entitiesToRemove) {
if (suppressor.storage.getEnergyStored() >= use) { if (suppressor.storage.getEnergyStored() >= use) {
suppressor.storage.extractEnergy(use, false); suppressor.storage.extractEnergyInternal(use, false);
affectedEntities.remove(entity); affectedEntities.remove(entity);
} else { } else {
break; break;

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; package de.ellpeck.actuallyadditions.mod.inventory;
import com.mojang.datafixers.util.Pair; import de.ellpeck.actuallyadditions.mod.inventory.slot.ArmorSlot;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
@ -22,12 +22,8 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentEffectComponents;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.capabilities.Capabilities;
import org.jetbrains.annotations.Nullable;
import java.util.Objects; import java.util.Objects;
@ -63,29 +59,8 @@ public class ContainerEnergizer extends AbstractContainerMenu {
for (int k = 0; k < 4; ++k) { for (int k = 0; k < 4; ++k) {
EquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; EquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k];
this.addSlot(new Slot(inventory, 36 + 3 - k, 102, 19 + k * 18) { ResourceLocation resourcelocation = InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot);
@Override this.addSlot(new ArmorSlot(inventory, slot, 36 + 3 - k, 102, 19 + k * 18, resourcelocation));
public int getMaxStackSize() {
return 1;
}
@Override
public boolean mayPlace(ItemStack stack) {
return !stack.isEmpty() && stack.getItem() instanceof ArmorItem;
}
@Override
public boolean mayPickup(Player player) {
ItemStack itemstack = this.getItem();
return (itemstack.isEmpty() || player.isCreative() || !EnchantmentHelper.has(itemstack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE)) && super.mayPickup(player);
}
@Nullable
@Override
public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot.getIndex()));
}
});
} }
} }

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; package de.ellpeck.actuallyadditions.mod.inventory;
import com.mojang.datafixers.util.Pair; import de.ellpeck.actuallyadditions.mod.inventory.slot.ArmorSlot;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
@ -23,10 +23,8 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.capabilities.Capabilities;
import org.jetbrains.annotations.Nullable;
import java.util.Objects; import java.util.Objects;
@ -56,24 +54,8 @@ public class ContainerEnervator extends AbstractContainerMenu {
for (int k = 0; k < 4; ++k) { for (int k = 0; k < 4; ++k) {
EquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k]; EquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k];
this.addSlot(new Slot(inventory, 36 + 3 - k, 102, 19 + k * 18) { ResourceLocation resourcelocation = InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot);
@Override this.addSlot(new ArmorSlot(inventory, slot, 36 + 3 - k, 102, 19 + k * 18, resourcelocation));
public int getMaxStackSize() {
return 1;
}
// TODO: [port] validate that this is correct
@Override
public boolean mayPlace(ItemStack stack) {
return StackUtil.isValid(stack) && stack.getItem() instanceof ArmorItem;
}
@Nullable
@Override
public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.TEXTURE_EMPTY_SLOTS.get(slot.getIndex()));
}
});
} }
} }

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui; package de.ellpeck.actuallyadditions.mod.inventory.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer; import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
@ -21,7 +20,6 @@ import net.minecraft.world.entity.player.Inventory;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class GuiEnergizer extends AAScreen<ContainerEnergizer> { public class GuiEnergizer extends AAScreen<ContainerEnergizer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer"); private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer");
@ -49,8 +47,6 @@ public class GuiEnergizer extends AAScreen<ContainerEnergizer> {
@Override @Override
public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) { public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86); guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86);
guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93); guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93);

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui; package de.ellpeck.actuallyadditions.mod.inventory.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnervator; import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnervator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
@ -21,8 +20,6 @@ import net.minecraft.world.entity.player.Inventory;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class GuiEnervator extends AAScreen<ContainerEnervator> { public class GuiEnervator extends AAScreen<ContainerEnervator> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer"); private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer");
@ -50,8 +47,6 @@ public class GuiEnervator extends AAScreen<ContainerEnervator> {
@Override @Override
public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) { public void renderBg(GuiGraphics guiGraphics, float f, int x, int y) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86); guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86);
guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93); guiGraphics.blit(RES_LOC, this.leftPos, this.topPos, 0, 0, 176, 93);

View file

@ -0,0 +1,56 @@
package de.ellpeck.actuallyadditions.mod.inventory.slot;
import com.mojang.datafixers.util.Pair;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentEffectComponents;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import org.jetbrains.annotations.Nullable;
/**
* A copy of vanilla's ArmorSlot without the owner entity
* Vanilla's ArmorSlot class is not public, so we have to copy it
*/
public class ArmorSlot extends Slot {
private final EquipmentSlot slot;
@Nullable
private final ResourceLocation emptyIcon;
public ArmorSlot(
Container container, EquipmentSlot slot, int slotIndex, int x, int y, @Nullable ResourceLocation emptyIcon
) {
super(container, slotIndex, x, y);
this.slot = slot;
this.emptyIcon = emptyIcon;
}
@Override
public int getMaxStackSize() {
return 1;
}
@Override
public boolean mayPlace(ItemStack stack) {
return !stack.isEmpty() && stack.getItem() instanceof ArmorItem;
}
@Override
public boolean mayPickup(Player player) {
ItemStack itemstack = this.getItem();
return !itemstack.isEmpty() && !player.isCreative() && EnchantmentHelper.has(itemstack, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE)
? false
: super.mayPickup(player);
}
@Override
public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
return this.emptyIcon != null ? Pair.of(InventoryMenu.BLOCK_ATLAS, this.emptyIcon) : super.getNoItemIcon();
}
}

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer;
import de.ellpeck.actuallyadditions.api.farmer.FarmerResult; import de.ellpeck.actuallyadditions.api.farmer.FarmerResult;
import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior; import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
import de.ellpeck.actuallyadditions.api.internal.IFarmer; import de.ellpeck.actuallyadditions.api.internal.IFarmer;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@ -27,6 +28,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.common.util.TriState;
import java.util.List; import java.util.List;
@ -35,14 +37,14 @@ public class NetherWartFarmerBehavior implements IFarmerBehavior {
@Override @Override
public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) { public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) {
int use = 500; int use = 500;
if (farmer.getEnergy() >= use) { if (farmer.getEnergy() >= use && seed.is(Items.NETHER_WART)) {
if (seed.getItem() == Items.NETHER_WART) { BlockState belowState = world.getBlockState(pos.below());
if (world.getBlockState(pos.below()).getBlock().canSustainPlant(world.getBlockState(pos), world, pos.below(), Direction.UP, Blocks.NETHER_WART.defaultBlockState()).isTrue()) { TriState result = belowState.canSustainPlant(world, pos, Direction.UP, Blocks.NETHER_WART.defaultBlockState());
world.setBlock(pos, Blocks.NETHER_WART.defaultBlockState(), 2); BlockState wartState = Blocks.NETHER_WART.defaultBlockState();
farmer.extractEnergy(use); if (result.isTrue() || wartState.canSurvive(world, pos)) {
return FarmerResult.SUCCESS; world.setBlock(pos, wartState, 2);
} farmer.extractEnergy(use);
return FarmerResult.FAIL; return FarmerResult.SUCCESS;
} }
} }
return FarmerResult.FAIL; return FarmerResult.FAIL;
@ -53,29 +55,26 @@ public class NetherWartFarmerBehavior implements IFarmerBehavior {
int use = 500; int use = 500;
if (farmer.getEnergy() >= use) { if (farmer.getEnergy() >= use) {
BlockState state = world.getBlockState(pos); BlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof NetherWartBlock) { if (state.getBlock() instanceof NetherWartBlock && state.getValue(BlockStateProperties.AGE_3) >= 3) {
if (state.getValue(BlockStateProperties.AGE_3) >= 3) { List<ItemStack> drops = state.getDrops(new LootParams.Builder(world)
List<ItemStack> drops = state.getDrops(new LootParams.Builder(world)
.withParameter(LootContextParams.ORIGIN, new Vec3(pos.getX(), pos.getY(), pos.getZ())) .withParameter(LootContextParams.ORIGIN, new Vec3(pos.getX(), pos.getY(), pos.getZ()))
.withParameter(LootContextParams.TOOL, ItemStack.EMPTY)); .withParameter(LootContextParams.TOOL, ItemStack.EMPTY));
if (!drops.isEmpty()) { if (!drops.isEmpty()) {
boolean toInput = farmer.canAddToSeeds(drops); boolean toInput = farmer.canAddToSeeds(drops);
if (toInput || farmer.canAddToOutput(drops)) { if (toInput || farmer.canAddToOutput(drops)) {
world.levelEvent(2001, pos, Block.getId(state)); world.levelEvent(2001, pos, Block.getId(state));
world.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState()); world.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
if (toInput) { if (toInput) {
farmer.addToSeeds(drops); farmer.addToSeeds(drops);
} else { } else {
farmer.addToOutput(drops); farmer.addToOutput(drops);
}
farmer.extractEnergy(use);
return FarmerResult.SUCCESS;
} }
farmer.extractEnergy(use);
return FarmerResult.SUCCESS;
} }
} }
return FarmerResult.FAIL;
} }
} }
return FarmerResult.FAIL; return FarmerResult.FAIL;

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Mth;
import net.neoforged.neoforge.energy.EnergyStorage; import net.neoforged.neoforge.energy.EnergyStorage;
public class CustomEnergyStorage extends EnergyStorage { public class CustomEnergyStorage extends EnergyStorage {
@ -32,6 +33,26 @@ public class CustomEnergyStorage extends EnergyStorage {
return super.extractEnergy(maxExtract, simulate); return super.extractEnergy(maxExtract, simulate);
} }
public int extractEnergyInternal(int maxExtract, boolean simulate) {
int before = this.maxExtract;
this.maxExtract = Integer.MAX_VALUE;
int toReturn = this.extractEnergy(maxExtract, simulate);
this.maxExtract = before;
return toReturn;
}
public int receiveEnergyInternal(int maxReceive, boolean simulate) {
int before = this.maxReceive;
this.maxReceive = Integer.MAX_VALUE;
int toReturn = this.receiveEnergy(maxReceive, simulate);
this.maxReceive = before;
return toReturn;
}
public boolean isDirty() { public boolean isDirty() {
return dirty; return dirty;
} }

View file

@ -185,7 +185,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
@Override @Override
public void extractEnergy(int amount) { public void extractEnergy(int amount) {
this.storage.extractEnergy(amount, false); this.storage.extractEnergyInternal(amount, false);
} }
@Override @Override

View file

@ -116,7 +116,7 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements Men
} }
} else { } else {
tile.burnTime--; tile.burnTime--;
tile.storage.receiveEnergy(tile.producePerTick, false); tile.storage.receiveEnergyInternal(tile.producePerTick, false);
} }
if ((tile.lastBurnTime != tile.burnTime || tile.lastProducePerTick != tile.producePerTick) && tile.sendUpdateWithInterval()) { if ((tile.lastBurnTime != tile.burnTime || tile.lastProducePerTick != tile.producePerTick) && tile.sendUpdateWithInterval()) {

View file

@ -108,7 +108,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me
if ((FluidStack.isSameFluid(r.getOutput(), tile.tank.getFluid()) || tile.tank.isEmpty()) && r.getOutput().getAmount() <= tile.tank.getCapacity() - tile.tank.getFluidAmount()) { if ((FluidStack.isSameFluid(r.getOutput(), tile.tank.getFluid()) || tile.tank.isEmpty()) && r.getOutput().getAmount() <= tile.tank.getCapacity() - tile.tank.getFluidAmount()) {
if (tile.storage.getEnergyStored() >= ENERGY_USE) { if (tile.storage.getEnergyStored() >= ENERGY_USE) {
tile.currentProcessTime++; tile.currentProcessTime++;
tile.storage.extractEnergy(ENERGY_USE, false); tile.storage.extractEnergyInternal(ENERGY_USE, false);
if (tile.currentProcessTime >= TIME) { if (tile.currentProcessTime >= TIME) {
tile.currentProcessTime = 0; tile.currentProcessTime = 0;

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe; import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator;
@ -108,7 +109,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
tile.currentBurnTime--; tile.currentBurnTime--;
int produce = tile.currentRecipe.value().getTotalEnergy() / tile.currentRecipe.value().getBurnTime(); int produce = tile.currentRecipe.value().getTotalEnergy() / tile.currentRecipe.value().getBurnTime();
if (produce > 0) { if (produce > 0) {
tile.storage.receiveEnergy(produce, false); tile.storage.receiveEnergyInternal(produce, false);
} }
} }

View file

@ -189,7 +189,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
} }
this.brewTime++; this.brewTime++;
this.storage.extractEnergy(ENERGY_USED, false); this.storage.extractEnergyInternal(ENERGY_USED, false);
if (this.brewTime >= TIME_USED) { if (this.brewTime >= TIME_USED) {
this.brewTime = 0; this.brewTime = 0;
ItemStack output = new ItemStack(ActuallyItems.COFFEE_CUP.get()); ItemStack output = new ItemStack(ActuallyItems.COFFEE_CUP.get());

View file

@ -131,7 +131,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2); finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
firstCrushTime = 0; firstCrushTime = 0;
} }
storage.extractEnergy(ENERGY_USE, false); storage.extractEnergyInternal(ENERGY_USE, false);
} }
crushed = storage.getEnergyStored() >= ENERGY_USE; crushed = storage.getEnergyStored() >= ENERGY_USE;
} else { } else {
@ -149,7 +149,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2); finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
secondCrushTime = 0; secondCrushTime = 0;
} }
storage.extractEnergy(ENERGY_USE, false); storage.extractEnergyInternal(ENERGY_USE, false);
} }
crushed = storage.getEnergyStored() >= ENERGY_USE; crushed = storage.getEnergyStored() >= ENERGY_USE;
} else { } else {

View file

@ -51,7 +51,7 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I
int energy = item.getUsePerTick(tile.inv.getStackInSlot(0), tile, tile.ticksElapsed); int energy = item.getUsePerTick(tile.inv.getStackInSlot(0), tile, tile.ticksElapsed);
if (tile.storage.getEnergyStored() >= energy) { if (tile.storage.getEnergyStored() >= energy) {
if (item.update(tile.inv.getStackInSlot(0), tile, tile.ticksElapsed)) { if (item.update(tile.inv.getStackInSlot(0), tile, tile.ticksElapsed)) {
tile.storage.extractEnergy(energy, false); tile.storage.extractEnergyInternal(energy, false);
} }
} }
} }

View file

@ -96,7 +96,7 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase {
boolean done = tile.processTime >= recipe.getTime(); boolean done = tile.processTime >= recipe.getTime();
for (TileEntityDisplayStand stand : stands) { for (TileEntityDisplayStand stand : stands) {
stand.storage.extractEnergy(recipe.getEnergyPerStand() / recipe.getTime(), false); stand.storage.extractEnergyInternal(recipe.getEnergyPerStand() / recipe.getTime(), false);
if (done) { if (done) {
stand.inv.getStackInSlot(0).shrink(1); stand.inv.getStackInSlot(0).shrink(1);

View file

@ -74,7 +74,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements Menu
boolean canTakeUp = capability.map(cap -> cap.getEnergyStored() >= cap.getMaxEnergyStored()).orElse(false); boolean canTakeUp = capability.map(cap -> cap.getEnergyStored() >= cap.getMaxEnergyStored()).orElse(false);
if (received > 0) { if (received > 0) {
tile.storage.extractEnergy(received, false); tile.storage.extractEnergyInternal(received, false);
} }
if (canTakeUp) { if (canTakeUp) {

View file

@ -72,7 +72,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements ISha
boolean canTakeUp = capability.map(cap -> cap.getEnergyStored() <= 0).orElse(false); boolean canTakeUp = capability.map(cap -> cap.getEnergyStored() <= 0).orElse(false);
if (extracted > 0) { if (extracted > 0) {
tile.storage.receiveEnergy(extracted, false); tile.storage.receiveEnergyInternal(extracted, false);
} }
if (canTakeUp) { if (canTakeUp) {

View file

@ -213,7 +213,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer
@Override @Override
public void extractEnergy(int amount) { public void extractEnergy(int amount) {
this.storage.extractEnergy(amount, false); this.storage.extractEnergyInternal(amount, false);
} }
@Override @Override

View file

@ -259,7 +259,7 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp
if (this.storage.getEnergyStored() >= USE_PER_SHOT) { if (this.storage.getEnergyStored() >= USE_PER_SHOT) {
this.spawnFireworks(this.level, this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ()); this.spawnFireworks(this.level, this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
this.storage.extractEnergy(USE_PER_SHOT, false); this.storage.extractEnergyInternal(USE_PER_SHOT, false);
} }
} }

View file

@ -81,7 +81,7 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE
} }
if (blocksAround.size() >= BLOCKS_NEEDED) { if (blocksAround.size() >= BLOCKS_NEEDED) {
tile.storage.receiveEnergy(ENERGY_PRODUCE, false); tile.storage.receiveEnergyInternal(ENERGY_PRODUCE, false);
tile.setChanged(); tile.setChanged();
tile.disappearTime++; tile.disappearTime++;

View file

@ -71,7 +71,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
if (tile.currentWorkTime >= 200) { if (tile.currentWorkTime >= 200) {
tile.currentWorkTime = 0; tile.currentWorkTime = 0;
level.setBlock(tile.worldPosition.above(), Blocks.LAVA.defaultBlockState(), 2); level.setBlock(tile.worldPosition.above(), Blocks.LAVA.defaultBlockState(), 2);
tile.storage.extractEnergy(ENERGY_USE, false); tile.storage.extractEnergyInternal(ENERGY_USE, false);
} }
} else { } else {
tile.currentWorkTime = 0; tile.currentWorkTime = 0;

View file

@ -87,7 +87,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE
level.setBlockAndUpdate(theCoord, Blocks.AIR.defaultBlockState()); level.setBlockAndUpdate(theCoord, Blocks.AIR.defaultBlockState());
tile.storage.receiveEnergy(energyProduced, false); tile.storage.receiveEnergyInternal(energyProduced, false);
AssetUtil.spawnLaserWithTimeServer((ServerLevel) level, pos.getX(), pos.getY(), pos.getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), 0x3EA34A, 25, 0, 0.075F, 0.8F); AssetUtil.spawnLaserWithTimeServer((ServerLevel) level, pos.getX(), pos.getY(), pos.getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), 0x3EA34A, 25, 0, 0.075F, 0.8F);
} }

View file

@ -111,7 +111,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
this.level.levelEvent(2001, coordsBlock, Block.getId(this.level.getBlockState(coordsBlock))); this.level.levelEvent(2001, coordsBlock, Block.getId(this.level.getBlockState(coordsBlock)));
this.level.setBlockAndUpdate(coordsBlock, Blocks.AIR.defaultBlockState()); this.level.setBlockAndUpdate(coordsBlock, Blocks.AIR.defaultBlockState());
StackUtil.addAll(this.inv, drops, false); StackUtil.addAll(this.inv, drops, false);
this.storage.extractEnergy(ENERGY_USE, false); this.storage.extractEnergyInternal(ENERGY_USE, false);
this.setChanged(); this.setChanged();
} }
} }

View file

@ -132,7 +132,7 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn
if (tile.currentBurnTime > 0 && tile.currentEnergyProduce > 0) { if (tile.currentBurnTime > 0 && tile.currentEnergyProduce > 0) {
tile.currentBurnTime--; tile.currentBurnTime--;
tile.storage.receiveEnergy(tile.currentEnergyProduce, false); tile.storage.receiveEnergyInternal(tile.currentEnergyProduce, false);
} else if (!tile.isRedstonePowered) { } else if (!tile.isRedstonePowered) {
RecipeHolder<LiquidFuelRecipe> recipeHolder = tile.getRecipeForCurrentFluid(); RecipeHolder<LiquidFuelRecipe> recipeHolder = tile.getRecipeForCurrentFluid();

View file

@ -96,7 +96,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy
int received = Optional.ofNullable(slot.getCapability(Capabilities.EnergyStorage.ITEM)) int received = Optional.ofNullable(slot.getCapability(Capabilities.EnergyStorage.ITEM))
.map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0); .map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0);
if (received > 0) { if (received > 0) {
tile.storage.extractEnergy(received, false); tile.storage.extractEnergyInternal(received, false);
} }
} }
} else { } else {

View file

@ -141,7 +141,7 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
tile.finishBurning(SLOT_INPUT_1, SLOT_OUTPUT_1); tile.finishBurning(SLOT_INPUT_1, SLOT_OUTPUT_1);
tile.firstSmeltTime = 0; tile.firstSmeltTime = 0;
} }
tile.storage.extractEnergy(ENERGY_USE, false); tile.storage.extractEnergyInternal(ENERGY_USE, false);
} }
smelted = true; smelted = true;
} else { } else {
@ -155,7 +155,7 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
tile.finishBurning(SLOT_INPUT_2, SLOT_OUTPUT_2); tile.finishBurning(SLOT_INPUT_2, SLOT_OUTPUT_2);
tile.secondSmeltTime = 0; tile.secondSmeltTime = 0;
} }
tile.storage.extractEnergy(ENERGY_USE, false); tile.storage.extractEnergyInternal(ENERGY_USE, false);
} }
smelted = true; smelted = true;
} else { } else {

View file

@ -156,7 +156,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
StackUtil.addAll(this.inv, drops, false); StackUtil.addAll(this.inv, drops, false);
this.setChanged(); this.setChanged();
this.storage.extractEnergy(actualUse, false); this.storage.extractEnergyInternal(actualUse, false);
this.shootParticles(pos.getX(), pos.getY(), pos.getZ()); this.shootParticles(pos.getX(), pos.getY(), pos.getZ());
} else { } else {
return false; return false;

View file

@ -11,14 +11,14 @@
package de.ellpeck.actuallyadditions.mod.util; package de.ellpeck.actuallyadditions.mod.util;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis; import com.mojang.math.Axis;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderTypes; import de.ellpeck.actuallyadditions.mod.blocks.render.RenderTypes;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient;
import de.ellpeck.actuallyadditions.mod.particle.ParticleBeam; import de.ellpeck.actuallyadditions.mod.particle.ParticleBeam;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import net.minecraft.client.Camera; import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font; import net.minecraft.client.gui.Font;
@ -30,7 +30,6 @@ import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.client.resources.model.BakedModel; import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
@ -356,7 +355,6 @@ public final class AssetUtil {
Matrix4f matrix = matrixStack.last().pose(); Matrix4f matrix = matrixStack.last().pose();
RenderSystem.setShader(GameRenderer::getPositionColorLightmapShader); RenderSystem.setShader(GameRenderer::getPositionColorLightmapShader);
var bufferbuilder = Tesselator.getInstance().begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR_LIGHTMAP);
TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(FORGE_WHITE); TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(FORGE_WHITE);
float minU = sprite.getU0(); float minU = sprite.getU0();
@ -390,7 +388,6 @@ public final class AssetUtil {
} }
matrixStack.popPose(); matrixStack.popPose();
BufferUploader.drawWithShader(bufferbuilder.buildOrThrow());
} }

View file

@ -1,10 +1,10 @@
modLoader="javafml" modLoader="javafml"
loaderVersion="[${loader},)" loaderVersion="[4,)"
license="MIT" license="MIT"
[[mods]] [[mods]]
modId="actuallyadditions" modId="actuallyadditions"
version="${version}" version="${file.jarVersion}"
displayName="Actually Additions" displayName="Actually Additions"
#logoFile="logo.png" #logoFile="logo.png"
credits="Author: Ellpeck; Textures and Models: BootyToast, GlenthorLP, canitzp; Porters: Flanks, MrBysco, ErrorMikey; 1.20+ Textures: Ridanisaurus" credits="Author: Ellpeck; Textures and Models: BootyToast, GlenthorLP, canitzp; Porters: Flanks, MrBysco, ErrorMikey; 1.20+ Textures: Ridanisaurus"
@ -18,13 +18,13 @@ config = "actuallyadditions.mixins.json"
[[dependencies.actuallyadditions]] [[dependencies.actuallyadditions]]
modId="neoforge" modId="neoforge"
type="required" type="required"
versionRange="${neo_version_range}" versionRange="[21.1.1,)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"
[[dependencies.actuallyadditions]] [[dependencies.actuallyadditions]]
modId="minecraft" modId="minecraft"
type="required" type="required"
versionRange="${minecraft_version_range}" versionRange="[1.21.1,1.22)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"

View file

@ -1,3 +1,15 @@
# 1.3.2+mc1.21.1
* Fix the gui of the Energizer/Enervator crashing
# 1.3.1+mc1.21.1
* Fix Empowerer laser crashing
* Fix energy storage of machines not working
# 1.3.0+mc1.21.1
* Update the mod to 1.21.1
* Fix crash when attempting to place Tiny Torch upside-down
* Fix Empowered Emeradic Crystal requiring Tall Grass instead of Short Grass
# 1.2.14+mc1.20.4 # 1.2.14+mc1.20.4
* Fixed Drill attributes going haywire. * Fixed Drill attributes going haywire.
* Fixed missing Crushing recipes for copper / some others. * Fixed missing Crushing recipes for copper / some others.