15
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -9,6 +9,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
 | 
			
		||||
- Fixed not being able to search with JEI when the Grid is open.
 | 
			
		||||
- Fixed a bunch of issues where chunks would unintentionally be loaded by RS.
 | 
			
		||||
- Reduced block updates when a controller is turning on and off constantly.
 | 
			
		||||
 | 
			
		||||
## [v1.11.5] - 2023-02-12
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
 | 
			
		||||
- Fixed some craftable items not showing as craftable in JEI
 | 
			
		||||
- Fixed Grid crashing on exit if JEI mod is not used
 | 
			
		||||
- Fixed rare multithreading crash
 | 
			
		||||
@@ -57,6 +65,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 | 
			
		||||
 | 
			
		||||
- Ported to Minecraft 1.19.2.
 | 
			
		||||
 | 
			
		||||
## [v1.10.5] - 2023-02-12
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
 | 
			
		||||
- Fixed rare multithreading crash
 | 
			
		||||
- Fixed Constructor being able to drop more than the maximum stack size for an item
 | 
			
		||||
 | 
			
		||||
## [v1.10.4] - 2022-12-20
 | 
			
		||||
 | 
			
		||||
### Fixed
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ apply plugin: 'maven-publish'
 | 
			
		||||
 | 
			
		||||
group = 'com.refinedmods'
 | 
			
		||||
archivesBaseName = 'refinedstorage'
 | 
			
		||||
version = '1.11.5'
 | 
			
		||||
version = '1.11.6'
 | 
			
		||||
 | 
			
		||||
if (System.getenv('GITHUB_SHA') != null) {
 | 
			
		||||
    version += '+' + System.getenv('GITHUB_SHA').substring(0, 7)
 | 
			
		||||
 
 | 
			
		||||
@@ -56,6 +56,7 @@ import java.util.function.Predicate;
 | 
			
		||||
public class Network implements INetwork, IRedstoneConfigurable {
 | 
			
		||||
    private static final int THROTTLE_INACTIVE_TO_ACTIVE = 20;
 | 
			
		||||
    private static final int THROTTLE_ACTIVE_TO_INACTIVE = 4;
 | 
			
		||||
    private static final int THROTTLE_ENERGY_TYPE_CHANGE = 20;
 | 
			
		||||
 | 
			
		||||
    private static final String NBT_ENERGY = "Energy";
 | 
			
		||||
    private static final String NBT_ITEM_STORAGE_TRACKER_ID = "ItemStorageTrackerId";
 | 
			
		||||
@@ -89,6 +90,7 @@ public class Network implements INetwork, IRedstoneConfigurable {
 | 
			
		||||
    private boolean throttlingDisabled = true; // Will be enabled after first update
 | 
			
		||||
    private boolean couldRun;
 | 
			
		||||
    private int ticksSinceUpdateChanged;
 | 
			
		||||
    private int ticksSinceEnergyTypeChanged;
 | 
			
		||||
    private int ticks;
 | 
			
		||||
    private long[] tickTimes = new long[100];
 | 
			
		||||
    private int tickCounter = 0;
 | 
			
		||||
@@ -99,8 +101,10 @@ public class Network implements INetwork, IRedstoneConfigurable {
 | 
			
		||||
        this.type = type;
 | 
			
		||||
        this.root = new RootNetworkNode(this, level, pos);
 | 
			
		||||
        this.nodeGraph.addListener(() -> {
 | 
			
		||||
            if (!level.isLoaded(pos)) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            BlockEntity blockEntity = level.getBlockEntity(pos);
 | 
			
		||||
 | 
			
		||||
            if (blockEntity instanceof ControllerBlockEntity) {
 | 
			
		||||
                ((ControllerBlockEntity) blockEntity).getDataManager().sendParameterToWatchers(ControllerBlockEntity.NODES);
 | 
			
		||||
            }
 | 
			
		||||
@@ -213,13 +217,17 @@ public class Network implements INetwork, IRedstoneConfigurable {
 | 
			
		||||
            ControllerBlock.EnergyType energyType = getEnergyType();
 | 
			
		||||
 | 
			
		||||
            if (lastEnergyType != energyType) {
 | 
			
		||||
                ++ticksSinceEnergyTypeChanged;
 | 
			
		||||
                if (ticksSinceEnergyTypeChanged > THROTTLE_ENERGY_TYPE_CHANGE) {
 | 
			
		||||
                    lastEnergyType = energyType;
 | 
			
		||||
 | 
			
		||||
                    BlockState state = level.getBlockState(pos);
 | 
			
		||||
                    if (state.getBlock() instanceof ControllerBlock) {
 | 
			
		||||
                        level.setBlockAndUpdate(pos, state.setValue(ControllerBlock.ENERGY_TYPE, energyType));
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                ticksSinceEnergyTypeChanged = 0;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            tickTimes[tickCounter % tickTimes.length] = Util.getNanos() - tickStart;
 | 
			
		||||
            tickCounter++;
 | 
			
		||||
 
 | 
			
		||||
@@ -118,9 +118,11 @@ public class NetworkNodeGraph implements INetworkNodeGraph {
 | 
			
		||||
                for (Direction checkSide : Direction.values()) {
 | 
			
		||||
                    if (checkSide != side) { // Avoid going backward
 | 
			
		||||
                        INetworkNode nodeOnSide = NetworkUtils.getNodeFromBlockEntity(blockEntity);
 | 
			
		||||
 | 
			
		||||
                        if (nodeOnSide == node) {
 | 
			
		||||
                            operator.apply(level, pos.relative(checkSide), checkSide.getOpposite());
 | 
			
		||||
                            BlockPos relativePos = pos.relative(checkSide);
 | 
			
		||||
                            if (level.isLoaded(relativePos)) {
 | 
			
		||||
                                operator.apply(level, relativePos, checkSide.getOpposite());
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -100,6 +100,9 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
 | 
			
		||||
 | 
			
		||||
    private void pickupItems() {
 | 
			
		||||
        BlockPos front = pos.relative(getDirection());
 | 
			
		||||
        if (!level.isLoaded(front)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        List<ItemEntity> droppedItems = level.getEntitiesOfClass(ItemEntity.class, new AABB(front));
 | 
			
		||||
 | 
			
		||||
@@ -124,6 +127,9 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
 | 
			
		||||
 | 
			
		||||
    private void breakBlock() {
 | 
			
		||||
        BlockPos front = pos.relative(getDirection());
 | 
			
		||||
        if (!level.isLoaded(front)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        BlockState frontBlockState = level.getBlockState(front);
 | 
			
		||||
        Block frontBlock = frontBlockState.getBlock();
 | 
			
		||||
        ItemStack frontStack = frontBlock.getCloneItemStack(
 | 
			
		||||
@@ -174,6 +180,10 @@ public class DestructorNetworkNode extends NetworkNode implements IComparable, I
 | 
			
		||||
 | 
			
		||||
    private void breakFluid() {
 | 
			
		||||
        BlockPos front = pos.relative(getDirection());
 | 
			
		||||
        if (!level.isLoaded(front)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        BlockState frontBlockState = level.getBlockState(front);
 | 
			
		||||
        Block frontBlock = frontBlockState.getBlock();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ public class FluidInterfaceNetworkNode extends NetworkNode {
 | 
			
		||||
        protected void onContentsChanged() {
 | 
			
		||||
            super.onContentsChanged();
 | 
			
		||||
 | 
			
		||||
            if (!level.isClientSide) {
 | 
			
		||||
            if (!level.isClientSide && level.isLoaded(pos)) {
 | 
			
		||||
                ((FluidInterfaceBlockEntity) level.getBlockEntity(pos)).getDataManager().sendParameterToWatchers(FluidInterfaceBlockEntity.TANK_IN);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -237,12 +237,16 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void visit(Operator operator) {
 | 
			
		||||
        for (Direction facing : Direction.values()) {
 | 
			
		||||
            INetworkNode oppositeNode = NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(pos.relative(facing)));
 | 
			
		||||
            BlockPos facingPos = pos.relative(facing);
 | 
			
		||||
            if (!level.isLoaded(facingPos)) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            INetworkNode oppositeNode = NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(facingPos));
 | 
			
		||||
            if (oppositeNode == null) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (canConduct(facing) && oppositeNode.canReceive(facing.getOpposite())) {
 | 
			
		||||
                operator.apply(level, pos.relative(facing), facing.getOpposite());
 | 
			
		||||
                operator.apply(level, facingPos, facing.getOpposite());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -116,11 +116,11 @@ public class NetworkTransmitterNetworkNode extends NetworkNode {
 | 
			
		||||
            if (!isSameDimension()) {
 | 
			
		||||
                Level dimensionLevel = level.getServer().getLevel(receiverDimension);
 | 
			
		||||
 | 
			
		||||
                if (dimensionLevel != null && dimensionLevel.getBlockEntity(receiver) instanceof NetworkReceiverBlockEntity) {
 | 
			
		||||
                if (dimensionLevel != null && dimensionLevel.isLoaded(receiver) && dimensionLevel.getBlockEntity(receiver) instanceof NetworkReceiverBlockEntity) {
 | 
			
		||||
                    operator.apply(dimensionLevel, receiver, null);
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                if (level.getBlockEntity(receiver) instanceof NetworkReceiverBlockEntity) {
 | 
			
		||||
                if (level.isLoaded(receiver) && level.getBlockEntity(receiver) instanceof NetworkReceiverBlockEntity) {
 | 
			
		||||
                    operator.apply(level, receiver, null);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -107,7 +107,11 @@ public class RootNetworkNode implements INetworkNode, INetworkNodeVisitor {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void visit(Operator operator) {
 | 
			
		||||
        for (Direction facing : Direction.values()) {
 | 
			
		||||
            operator.apply(level, pos.relative(facing), facing.getOpposite());
 | 
			
		||||
            BlockPos relativePos = pos.relative(facing);
 | 
			
		||||
            if (!level.isLoaded(relativePos)) {
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            operator.apply(level, relativePos, facing.getOpposite());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,15 +4,14 @@ import com.refinedmods.refinedstorage.RS;
 | 
			
		||||
import com.refinedmods.refinedstorage.api.autocrafting.ICraftingManager;
 | 
			
		||||
import com.refinedmods.refinedstorage.api.autocrafting.task.ICraftingTask;
 | 
			
		||||
import com.refinedmods.refinedstorage.api.network.INetwork;
 | 
			
		||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
 | 
			
		||||
import com.refinedmods.refinedstorage.inventory.player.PlayerSlot;
 | 
			
		||||
import com.refinedmods.refinedstorage.item.NetworkItem;
 | 
			
		||||
import com.refinedmods.refinedstorage.item.WirelessCraftingMonitorItem;
 | 
			
		||||
import com.refinedmods.refinedstorage.network.craftingmonitor.WirelessCraftingMonitorSettingsUpdateMessage;
 | 
			
		||||
import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationParameter;
 | 
			
		||||
import com.refinedmods.refinedstorage.util.NetworkUtils;
 | 
			
		||||
import net.minecraft.core.BlockPos;
 | 
			
		||||
import net.minecraft.network.chat.Component;
 | 
			
		||||
 | 
			
		||||
import net.minecraft.resources.ResourceKey;
 | 
			
		||||
import net.minecraft.server.MinecraftServer;
 | 
			
		||||
import net.minecraft.server.level.ServerPlayer;
 | 
			
		||||
@@ -99,11 +98,14 @@ public class WirelessCraftingMonitor implements ICraftingMonitor {
 | 
			
		||||
 | 
			
		||||
    private INetwork getNetwork() {
 | 
			
		||||
        Level level = server.getLevel(nodeDimension);
 | 
			
		||||
        if (level != null) {
 | 
			
		||||
            return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
        }
 | 
			
		||||
        if (level == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        if (!level.isLoaded(nodePos)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public ItemStack getStack() {
 | 
			
		||||
        return stack;
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,6 @@ import com.refinedmods.refinedstorage.util.StackUtils;
 | 
			
		||||
import net.minecraft.core.BlockPos;
 | 
			
		||||
import net.minecraft.nbt.CompoundTag;
 | 
			
		||||
import net.minecraft.network.chat.Component;
 | 
			
		||||
 | 
			
		||||
import net.minecraft.resources.ResourceKey;
 | 
			
		||||
import net.minecraft.server.MinecraftServer;
 | 
			
		||||
import net.minecraft.server.level.ServerPlayer;
 | 
			
		||||
@@ -93,11 +92,14 @@ public class WirelessFluidGrid implements INetworkAwareGrid {
 | 
			
		||||
    @Nullable
 | 
			
		||||
    public INetwork getNetwork() {
 | 
			
		||||
        Level level = server.getLevel(nodeDimension);
 | 
			
		||||
        if (level != null) {
 | 
			
		||||
            return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
        }
 | 
			
		||||
        if (level == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        if (!level.isLoaded(nodePos)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public IStorageCacheListener createListener(ServerPlayer player) {
 | 
			
		||||
 
 | 
			
		||||
@@ -95,11 +95,14 @@ public class WirelessGrid implements INetworkAwareGrid {
 | 
			
		||||
    @Nullable
 | 
			
		||||
    public INetwork getNetwork() {
 | 
			
		||||
        Level level = server.getLevel(nodeDimension);
 | 
			
		||||
        if (level != null) {
 | 
			
		||||
            return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
        }
 | 
			
		||||
        if (level == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        if (!level.isLoaded(nodePos)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(level.getBlockEntity(nodePos)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public IStorageCacheListener createListener(ServerPlayer player) {
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,13 @@ public abstract class NetworkItem extends EnergyItem implements INetworkItemProv
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        INetwork network = NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(nodeLevel.getBlockEntity(new BlockPos(getX(stack), getY(stack), getZ(stack)))));
 | 
			
		||||
        BlockPos pos = new BlockPos(getX(stack), getY(stack), getZ(stack));
 | 
			
		||||
        if (!nodeLevel.isLoaded(pos)) {
 | 
			
		||||
            onError.accept(notFound);
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        INetwork network = NetworkUtils.getNetworkFromNode(NetworkUtils.getNodeFromBlockEntity(nodeLevel.getBlockEntity(pos)));
 | 
			
		||||
        if (network == null) {
 | 
			
		||||
            onError.accept(notFound);
 | 
			
		||||
            return;
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,9 @@ public class CrafterManagerScreen extends BaseScreen<CrafterManagerContainerMenu
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        addRenderableWidget(searchField);
 | 
			
		||||
        if (searchField.isFocused()) {
 | 
			
		||||
            setFocused(searchField);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -146,6 +146,9 @@ public class GridScreen extends BaseScreen<GridContainerMenu> implements IScreen
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        addRenderableWidget(searchField);
 | 
			
		||||
        if (searchField.isFocused()) {
 | 
			
		||||
            setFocused(searchField);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (grid.getViewType() != -1) {
 | 
			
		||||
            addSideButton(new GridViewTypeSideButton(this, grid));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user