diff --git a/AntimatterAPI b/AntimatterAPI index 41d606e4d..a3e936102 160000 --- a/AntimatterAPI +++ b/AntimatterAPI @@ -1 +1 @@ -Subproject commit 41d606e4d930dbaf05b215d592068f3d7a1facfa +Subproject commit a3e936102a94bdb9e32f4d8078e4c3c46bc41ab6 diff --git a/common/src/main/java/muramasa/gregtech/blockentity/miniportals/BlockEntityMiniPortal.java b/common/src/main/java/muramasa/gregtech/blockentity/miniportals/BlockEntityMiniPortal.java index 76826f428..e935beb13 100644 --- a/common/src/main/java/muramasa/gregtech/blockentity/miniportals/BlockEntityMiniPortal.java +++ b/common/src/main/java/muramasa/gregtech/blockentity/miniportals/BlockEntityMiniPortal.java @@ -1,6 +1,7 @@ package muramasa.gregtech.blockentity.miniportals; import muramasa.antimatter.blockentity.BlockEntityMachine; +import muramasa.antimatter.blockentity.IExtendingBlockEntity; import muramasa.antimatter.machine.MachineState; import muramasa.antimatter.machine.types.Machine; import muramasa.antimatter.tool.AntimatterToolType; @@ -17,6 +18,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.Nullable; @@ -24,7 +26,7 @@ import java.util.ArrayList; import java.util.List; -public abstract class BlockEntityMiniPortal extends BlockEntityMachine { +public abstract class BlockEntityMiniPortal extends BlockEntityMachine implements IExtendingBlockEntity { public static List sListWorldSide = new ArrayList<>(); @@ -106,6 +108,16 @@ protected boolean allowExplosionsInRain() { return false; } + @Override + public void onBlockUpdate(BlockPos neighbor) { + super.onBlockUpdate(neighbor); + Direction facing = Utils.getOffsetFacing(this.getBlockPos(), neighbor); + if (otherSide != null && !otherSide.isRemoved()){ + BlockPos offset = otherSide.getBlockPos().relative(facing.getOpposite()); + otherSide.getLevel().neighborChanged(offset, otherSide.getLevel().getBlockState(offset).getBlock(), otherSide.getBlockPos()); + } + } + @Override public InteractionResult onInteractBoth(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit, @Nullable AntimatterToolType type) { ItemStack stack = player.getItemInHand(hand); @@ -220,6 +232,14 @@ public boolean toggleMachine() { return false; } + @Override + public BlockEntity getExtendedBlockEntity(Direction side) { + if (otherSide != null && !otherSide.isRemoved()){ + return otherSide.getCachedBlockEntity(side); + } + return this; + } + @Override public List getInfo(boolean simple) { List info = super.getInfo(simple);