Compare commits

..

No commits in common. "96a9389f966f83393b5abd783d63d90eb2f21eaa" and "ae9c72bb73652fdd6c516493578d4f72eae0de5b" have entirely different histories.

8 changed files with 10 additions and 24 deletions

View file

@ -1,9 +1,6 @@
# 1.3.7+mc1.21.1 # 1.3.7+mc1.21.1
* Added recipes for AA crops in the IE cloche. * Added recipes for AA crops in the IE cloche.
* Fix All in One Tool stats * Fix All in One Tool stats
* Fixed the Vertical Miner / Phantom Breaker not breaking / harvesting blocks properly.
* Fixed Energy lasers not properly filling mekanism energy cubes only needing 2 FE.
* Fixed Batbox's not properly invalidating capabilities.
# 1.3.6+mc1.21.1 # 1.3.6+mc1.21.1
* Add the ability to open the Crafting Table On A Stick while inside a Curios slot * Add the ability to open the Crafting Table On A Stick while inside a Curios slot

View file

@ -59,7 +59,6 @@ neoForge {
} }
configureEach { run -> configureEach { run ->
logLevel = org.slf4j.event.Level.DEBUG
jvmArgument '-Xmx4G' jvmArgument '-Xmx4G'
if (run.project.javaToolchains.launcherFor(java.toolchain).map { it.metadata.vendor }.getOrElse("").contains("JetBrains")) { if (run.project.javaToolchains.launcherFor(java.toolchain).map { it.metadata.vendor }.getOrElse("").contains("JetBrains")) {

View file

@ -61,12 +61,11 @@ public class BlockBatteryBox extends BlockContainerBase {
protected ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult pHitResult) { protected ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult pHitResult) {
BlockEntity tile = world.getBlockEntity(pos); BlockEntity tile = world.getBlockEntity(pos);
if (tile instanceof TileEntityBatteryBox box) { if (tile instanceof TileEntityBatteryBox box) {
ItemStack stack = player.getItemInHand(hand); ItemStack stack = player.getItemInHand(hand);
if (!stack.isEmpty()) { if (!stack.isEmpty()) {
if (stack.getItem() instanceof ItemBattery && box.inv.getStackInSlot(0).isEmpty()) { if (stack.getItem() instanceof ItemBattery && box.inv.getStackInSlot(0).isEmpty()) {
box.inv.setStackInSlot(0, stack.copy()); box.inv.setStackInSlot(0, stack.copy());
box.invalidateCapabilities();
player.setItemInHand(hand, ItemStack.EMPTY); player.setItemInHand(hand, ItemStack.EMPTY);
return ItemInteractionResult.SUCCESS; return ItemInteractionResult.SUCCESS;
} }
@ -75,7 +74,6 @@ public class BlockBatteryBox extends BlockContainerBase {
if (!inSlot.isEmpty()) { if (!inSlot.isEmpty()) {
player.setItemInHand(hand, inSlot.copy()); player.setItemInHand(hand, inSlot.copy());
box.inv.setStackInSlot(0, ItemStack.EMPTY); box.inv.setStackInSlot(0, ItemStack.EMPTY);
box.invalidateCapabilities();
return ItemInteractionResult.SUCCESS; return ItemInteractionResult.SUCCESS;
} }
} }

View file

@ -135,7 +135,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh
for (BlockEntity tile : startTile.tilesAround) { for (BlockEntity tile : startTile.tilesAround) {
if (tile instanceof TileEntityBatteryBox box) { if (tile instanceof TileEntityBatteryBox box) {
if (!pushOffTo.contains(box)) { if (!pushOffTo.contains(box)) {
pushOffTo.add(box); pushOffTo.add(box);
this.energyPushOffLoop(box, pushOffTo); this.energyPushOffLoop(box, pushOffTo);

View file

@ -214,15 +214,13 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay {
int trans = 0; int trans = 0;
int theoreticalReceived = cap.receiveEnergy(Math.min(amountPer, lowestCap), true); int theoreticalReceived = cap.receiveEnergy(Math.min(amountPer, lowestCap), true);
if (theoreticalReceived > 0) { if (theoreticalReceived > 0) {
int deduct = this.calcDeduction(theoreticalReceived, highestLoss); // TODO maybe we do a minimum threshold before losses occur? int deduct = this.calcDeduction(theoreticalReceived, highestLoss);
if (deduct >= theoreticalReceived) { //Happens with small numbers if (deduct >= theoreticalReceived) { //Happens with small numbers
deduct = 0; deduct = 0;
} }
int actual = cap.receiveEnergy(theoreticalReceived - deduct, simulate);
if (actual > 0) { trans += cap.receiveEnergy(theoreticalReceived - deduct, simulate);
trans += actual; trans += deduct;
trans += deduct;
}
} }
return trans; return trans;

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -105,7 +104,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
Block blockToBreak = breakState.getBlock(); Block blockToBreak = breakState.getBlock();
if (blockToBreak != null && !this.level.isEmptyBlock(coordsBlock) && this.level.getBlockState(coordsBlock).getDestroySpeed(this.level, coordsBlock) > -1.0F) { if (blockToBreak != null && !this.level.isEmptyBlock(coordsBlock) && this.level.getBlockState(coordsBlock).getDestroySpeed(this.level, coordsBlock) > -1.0F) {
List<ItemStack> drops = Block.getDrops(breakState, (ServerLevel) this.level, coordsBlock, this.level.getBlockEntity(coordsBlock)); List<ItemStack> drops = Block.getDrops(breakState, (ServerLevel) this.level, coordsBlock, this.level.getBlockEntity(coordsBlock));
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, this.level, coordsBlock); float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, coordsBlock);
if (chance > 0 && this.level.random.nextFloat() <= chance) { if (chance > 0 && this.level.random.nextFloat() <= chance) {
if (StackUtil.canAddAll(this.inv, drops, false)) { if (StackUtil.canAddAll(this.inv, drops, false)) {

View file

@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner; import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.network.PacketHelperServer; import de.ellpeck.actuallyadditions.mod.network.PacketHelperServer;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
@ -140,7 +139,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
: 1); : 1);
if (this.storage.getEnergyStored() >= actualUse) { if (this.storage.getEnergyStored() >= actualUse) {
BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ); BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ);
ItemStack fakePickaxe = new ItemStack(ActuallyItems.NETHERITE_AIOT.get()); ItemStack fakePickaxe = Items.NETHERITE_PICKAXE.getDefaultInstance();
BlockState state = this.level.getBlockState(pos); BlockState state = this.level.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
@ -148,7 +147,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
if (!state.isAir()) { if (!state.isAir()) {
if (fakePickaxe.isCorrectToolForDrops(state) && state.getDestroySpeed(this.level, pos) >= 0F && this.isMinable(state, stack)) { if (fakePickaxe.isCorrectToolForDrops(state) && state.getDestroySpeed(this.level, pos) >= 0F && this.isMinable(state, stack)) {
List<ItemStack> drops = Block.getDrops(state, (ServerLevel) this.level, pos, this.level.getBlockEntity(pos)); List<ItemStack> drops = Block.getDrops(state, (ServerLevel) this.level, pos, this.level.getBlockEntity(pos));
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, this.level, pos); float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, pos);
if (chance > 0 && this.level.random.nextFloat() <= chance) { if (chance > 0 && this.level.random.nextFloat() <= chance) {
if (StackUtil.canAddAll(this.inv, drops, false)) { if (StackUtil.canAddAll(this.inv, drops, false)) {

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.util;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditionsClient; import de.ellpeck.actuallyadditions.mod.ActuallyAdditionsClient;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper; import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -258,12 +257,9 @@ public final class WorldUtil {
} }
//I think something is up with this, but I'm not entirely certain what. //I think something is up with this, but I'm not entirely certain what.
// TODO We really need to refactor this out of existence... -Flanks public static float fireFakeHarvestEventsForDropChance(BlockEntity caller, List<ItemStack> drops, Level level, BlockPos pos) {
public static float fireFakeHarvestEventsForDropChance(BlockEntity caller, Level level, BlockPos pos) {
if (level instanceof ServerLevel) { if (level instanceof ServerLevel) {
FakePlayer fake = FakePlayerFactory.getMinecraft((ServerLevel) level); FakePlayer fake = FakePlayerFactory.getMinecraft((ServerLevel) level);
ItemStack fakeTool = new ItemStack(ActuallyItems.NETHERITE_AIOT.get());
fake.getInventory().items.set(fake.getInventory().selected, fakeTool);
BlockPos tePos = caller.getBlockPos(); BlockPos tePos = caller.getBlockPos();
fake.setPos(tePos.getX() + 0.5, tePos.getY() + 0.5, tePos.getZ() + 0.5); fake.setPos(tePos.getX() + 0.5, tePos.getY() + 0.5, tePos.getZ() + 0.5);
BlockState state = level.getBlockState(pos); BlockState state = level.getBlockState(pos);