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