More SonarQube fixes.
This commit is contained in:
@@ -376,7 +376,7 @@ public class CraftingManager implements ICraftingManager {
|
|||||||
network.getFluidStorageCache().getCraftablesList().add(output);
|
network.getFluidStorageCache().getCraftablesList().add(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<ICraftingPatternContainer> containersForPattern = this.patternToContainer.computeIfAbsent(pattern, (key) -> new LinkedHashSet<>());
|
Set<ICraftingPatternContainer> containersForPattern = this.patternToContainer.computeIfAbsent(pattern, key -> new LinkedHashSet<>());
|
||||||
containersForPattern.add(container);
|
containersForPattern.add(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
||||||
import com.refinedmods.refinedstorage.capability.NetworkNodeProxyCapability;
|
import com.refinedmods.refinedstorage.capability.NetworkNodeProxyCapability;
|
||||||
import com.refinedmods.refinedstorage.tile.CableTile;
|
import com.refinedmods.refinedstorage.tile.CableTile;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
||||||
import com.refinedmods.refinedstorage.container.ConstructorContainer;
|
import com.refinedmods.refinedstorage.container.ConstructorContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
||||||
import com.refinedmods.refinedstorage.container.DestructorContainer;
|
import com.refinedmods.refinedstorage.container.DestructorContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.container.DiskDriveContainer;
|
import com.refinedmods.refinedstorage.container.DiskDriveContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
import com.refinedmods.refinedstorage.tile.DiskDriveTile;
|
import com.refinedmods.refinedstorage.tile.DiskDriveTile;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
||||||
import com.refinedmods.refinedstorage.container.ExporterContainer;
|
import com.refinedmods.refinedstorage.container.ExporterContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.api.network.node.INetworkNode;
|
import com.refinedmods.refinedstorage.api.network.node.INetworkNode;
|
||||||
import com.refinedmods.refinedstorage.api.storage.cache.InvalidateCause;
|
import com.refinedmods.refinedstorage.api.storage.cache.InvalidateCause;
|
||||||
import com.refinedmods.refinedstorage.apiimpl.network.node.ExternalStorageNetworkNode;
|
import com.refinedmods.refinedstorage.apiimpl.network.node.ExternalStorageNetworkNode;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.api.network.security.Permission;
|
import com.refinedmods.refinedstorage.api.network.security.Permission;
|
||||||
import com.refinedmods.refinedstorage.container.FluidInterfaceContainer;
|
import com.refinedmods.refinedstorage.container.FluidInterfaceContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.apiimpl.network.node.storage.FluidStorageNetworkNode;
|
import com.refinedmods.refinedstorage.apiimpl.network.node.storage.FluidStorageNetworkNode;
|
||||||
import com.refinedmods.refinedstorage.apiimpl.storage.FluidStorageType;
|
import com.refinedmods.refinedstorage.apiimpl.storage.FluidStorageType;
|
||||||
import com.refinedmods.refinedstorage.container.FluidStorageContainer;
|
import com.refinedmods.refinedstorage.container.FluidStorageContainer;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
import com.refinedmods.refinedstorage.block.shape.ShapeCache;
|
||||||
import com.refinedmods.refinedstorage.container.ImporterContainer;
|
import com.refinedmods.refinedstorage.container.ImporterContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.refinedmods.refinedstorage.block;
|
package com.refinedmods.refinedstorage.block;
|
||||||
|
|
||||||
import com.refinedmods.refinedstorage.RS;
|
|
||||||
import com.refinedmods.refinedstorage.api.network.security.Permission;
|
import com.refinedmods.refinedstorage.api.network.security.Permission;
|
||||||
import com.refinedmods.refinedstorage.container.InterfaceContainer;
|
import com.refinedmods.refinedstorage.container.InterfaceContainer;
|
||||||
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
import com.refinedmods.refinedstorage.container.factory.PositionalTileContainerProvider;
|
||||||
|
@@ -15,10 +15,6 @@ public class TagGenerator extends ItemTagsProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerTags() {
|
protected void registerTags() {
|
||||||
RSItems.COLORED_ITEM_TAGS.forEach((tag, map) -> {
|
RSItems.COLORED_ITEM_TAGS.forEach((tag, map) -> map.values().forEach(item -> getOrCreateBuilder(tag).add(item.get())));
|
||||||
map.values().forEach(item -> {
|
|
||||||
getOrCreateBuilder(tag).add(item.get());
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -273,7 +273,7 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void bindTexture(String namespace, String filenameInTexturesFolder) {
|
public void bindTexture(String namespace, String filenameInTexturesFolder) {
|
||||||
minecraft.getTextureManager().bindTexture(TEXTURE_CACHE.computeIfAbsent(namespace + ":" + filenameInTexturesFolder, (newId) -> new ResourceLocation(namespace, "textures/" + filenameInTexturesFolder)));
|
minecraft.getTextureManager().bindTexture(TEXTURE_CACHE.computeIfAbsent(namespace + ":" + filenameInTexturesFolder, newId -> new ResourceLocation(namespace, "textures/" + filenameInTexturesFolder)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderItem(MatrixStack matrixStack, int x, int y, ItemStack stack) {
|
public void renderItem(MatrixStack matrixStack, int x, int y, ItemStack stack) {
|
||||||
@@ -298,7 +298,7 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
|
|||||||
renderQuantity(matrixStack, x, y, text, textColor);
|
renderQuantity(matrixStack, x, y, text, textColor);
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.warn("Couldn't render stack: " + stack.getItem().toString(), t);
|
logger.warn("Couldn't render stack: {}", stack.getItem().getRegistryName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,13 +27,13 @@ public class KeyInputListener {
|
|||||||
PlayerInventory inv = Minecraft.getInstance().player.inventory;
|
PlayerInventory inv = Minecraft.getInstance().player.inventory;
|
||||||
|
|
||||||
if (RSKeyBindings.OPEN_WIRELESS_GRID.isKeyDown()) {
|
if (RSKeyBindings.OPEN_WIRELESS_GRID.isKeyDown()) {
|
||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_GRID.get(), RSItems.CREATIVE_WIRELESS_GRID.get());
|
findAndOpen(inv, error -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_GRID.get(), RSItems.CREATIVE_WIRELESS_GRID.get());
|
||||||
} else if (RSKeyBindings.OPEN_WIRELESS_FLUID_GRID.isKeyDown()) {
|
} else if (RSKeyBindings.OPEN_WIRELESS_FLUID_GRID.isKeyDown()) {
|
||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_FLUID_GRID.get(), RSItems.CREATIVE_WIRELESS_FLUID_GRID.get());
|
findAndOpen(inv, error -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_FLUID_GRID.get(), RSItems.CREATIVE_WIRELESS_FLUID_GRID.get());
|
||||||
} else if (RSKeyBindings.OPEN_PORTABLE_GRID.isKeyDown()) {
|
} else if (RSKeyBindings.OPEN_PORTABLE_GRID.isKeyDown()) {
|
||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.PORTABLE_GRID.get(), RSItems.CREATIVE_PORTABLE_GRID.get());
|
findAndOpen(inv, error -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.PORTABLE_GRID.get(), RSItems.CREATIVE_PORTABLE_GRID.get());
|
||||||
} else if (RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR.isKeyDown()) {
|
} else if (RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR.isKeyDown()) {
|
||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_CRAFTING_MONITOR.get(), RSItems.CREATIVE_WIRELESS_CRAFTING_MONITOR.get());
|
findAndOpen(inv, error -> Minecraft.getInstance().player.sendMessage(error, Util.DUMMY_UUID), RSItems.WIRELESS_CRAFTING_MONITOR.get(), RSItems.CREATIVE_WIRELESS_CRAFTING_MONITOR.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -307,7 +307,8 @@ public class AlternativesScreen extends BaseScreen<AlternativesContainer> {
|
|||||||
|
|
||||||
public TagLine(ResourceLocation tagName, boolean checked) {
|
public TagLine(ResourceLocation tagName, boolean checked) {
|
||||||
this.tagName = tagName;
|
this.tagName = tagName;
|
||||||
this.widget = addCheckBox(-100, -100, new StringTextComponent(RenderUtils.shorten(tagName.toString(), 22)), checked, (btn) -> {
|
this.widget = addCheckBox(-100, -100, new StringTextComponent(RenderUtils.shorten(tagName.toString(), 22)), checked, btn -> {
|
||||||
|
// NO OP
|
||||||
});
|
});
|
||||||
|
|
||||||
widget.setFGColor(0xFF373737);
|
widget.setFGColor(0xFF373737);
|
||||||
|
@@ -19,6 +19,7 @@ import javax.annotation.Nullable;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class FluidGridStack implements IGridStack {
|
public class FluidGridStack implements IGridStack {
|
||||||
|
private static final String ERROR_PLACEHOLDER = "<Error>";
|
||||||
private final Logger logger = LogManager.getLogger(getClass());
|
private final Logger logger = LogManager.getLogger(getClass());
|
||||||
|
|
||||||
private final UUID id;
|
private final UUID id;
|
||||||
@@ -79,9 +80,9 @@ public class FluidGridStack implements IGridStack {
|
|||||||
try {
|
try {
|
||||||
cachedName = stack.getDisplayName().getString();
|
cachedName = stack.getDisplayName().getString();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.warn("Could not retrieve fluid name of " + stack.getFluid().getRegistryName().toString(), t);
|
logger.warn("Could not retrieve fluid name of {}", stack.getFluid().getRegistryName());
|
||||||
|
|
||||||
cachedName = "<Error>";
|
cachedName = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ public class FluidGridStack implements IGridStack {
|
|||||||
if (registryName != null) {
|
if (registryName != null) {
|
||||||
cachedModId = registryName.getNamespace();
|
cachedModId = registryName.getNamespace();
|
||||||
} else {
|
} else {
|
||||||
cachedModId = "<Error>";
|
cachedModId = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ public class FluidGridStack implements IGridStack {
|
|||||||
cachedModName = ItemGridStack.getModNameByModId(getModId());
|
cachedModName = ItemGridStack.getModNameByModId(getModId());
|
||||||
|
|
||||||
if (cachedModName == null) {
|
if (cachedModName == null) {
|
||||||
cachedModName = "<Error>";
|
cachedModName = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,9 +137,9 @@ public class FluidGridStack implements IGridStack {
|
|||||||
try {
|
try {
|
||||||
tooltip = Arrays.asList(stack.getDisplayName());
|
tooltip = Arrays.asList(stack.getDisplayName());
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.warn("Could not retrieve fluid tooltip of " + stack.getFluid().getRegistryName().toString(), t);
|
logger.warn("Could not retrieve fluid tooltip of {}", stack.getFluid().getRegistryName());
|
||||||
|
|
||||||
tooltip = Arrays.asList(new StringTextComponent("<Error>"));
|
tooltip = Arrays.asList(new StringTextComponent(ERROR_PLACEHOLDER));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bypassCache) {
|
if (bypassCache) {
|
||||||
|
@@ -21,6 +21,8 @@ import javax.annotation.Nullable;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class ItemGridStack implements IGridStack {
|
public class ItemGridStack implements IGridStack {
|
||||||
|
private static final String ERROR_PLACEHOLDER = "<Error>";
|
||||||
|
|
||||||
private final Logger logger = LogManager.getLogger(getClass());
|
private final Logger logger = LogManager.getLogger(getClass());
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
@@ -92,9 +94,9 @@ public class ItemGridStack implements IGridStack {
|
|||||||
try {
|
try {
|
||||||
cachedName = stack.getDisplayName().getString();
|
cachedName = stack.getDisplayName().getString();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.warn("Could not retrieve item name of " + stack.getItem().toString(), t);
|
logger.warn("Could not retrieve item name of {}", stack.getItem().getRegistryName());
|
||||||
|
|
||||||
cachedName = "<Error>";
|
cachedName = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +109,7 @@ public class ItemGridStack implements IGridStack {
|
|||||||
cachedModId = stack.getItem().getCreatorModId(stack);
|
cachedModId = stack.getItem().getCreatorModId(stack);
|
||||||
|
|
||||||
if (cachedModId == null) {
|
if (cachedModId == null) {
|
||||||
cachedModId = "<Error>";
|
cachedModId = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +122,7 @@ public class ItemGridStack implements IGridStack {
|
|||||||
cachedModName = getModNameByModId(getModId());
|
cachedModName = getModNameByModId(getModId());
|
||||||
|
|
||||||
if (cachedModName == null) {
|
if (cachedModName == null) {
|
||||||
cachedModName = "<Error>";
|
cachedModName = ERROR_PLACEHOLDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,10 +149,10 @@ public class ItemGridStack implements IGridStack {
|
|||||||
try {
|
try {
|
||||||
tooltip = RenderUtils.getTooltipFromItem(stack);
|
tooltip = RenderUtils.getTooltipFromItem(stack);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.warn("Could not retrieve item tooltip of " + stack.getItem().toString(), t);
|
logger.warn("Could not retrieve item tooltip of {}", stack.getItem().getRegistryName());
|
||||||
|
|
||||||
tooltip = new ArrayList<>();
|
tooltip = new ArrayList<>();
|
||||||
tooltip.add(new StringTextComponent("<Error>"));
|
tooltip.add(new StringTextComponent(ERROR_PLACEHOLDER));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bypassCache) {
|
if (bypassCache) {
|
||||||
|
@@ -56,7 +56,7 @@ public class GridTile extends NetworkNodeTile<GridNetworkNode> {
|
|||||||
t.getNode().setSize(v);
|
t.getNode().setSize(v);
|
||||||
t.getNode().markDirty();
|
t.getNode().markDirty();
|
||||||
}
|
}
|
||||||
}, (initial, p) -> BaseScreen.executeLater(GridScreen.class, (screen) -> screen.resize(screen.getMinecraft(), screen.width, screen.height)));
|
}, (initial, p) -> BaseScreen.executeLater(GridScreen.class, grid -> grid.resize(grid.getMinecraft(), grid.width, grid.height)));
|
||||||
public static final TileDataParameter<Integer, GridTile> TAB_SELECTED = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabSelected(), (t, v) -> {
|
public static final TileDataParameter<Integer, GridTile> TAB_SELECTED = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabSelected(), (t, v) -> {
|
||||||
t.getNode().setTabSelected(v == t.getNode().getTabSelected() ? -1 : v);
|
t.getNode().setTabSelected(v == t.getNode().getTabSelected() ? -1 : v);
|
||||||
t.getNode().markDirty();
|
t.getNode().markDirty();
|
||||||
|
@@ -332,7 +332,7 @@ public final class StackUtils {
|
|||||||
item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString(NBT_ITEM_ID)));
|
item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString(NBT_ITEM_ID)));
|
||||||
|
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
LOGGER.warn("Could not deserialize item from string ID, it no longer exists: " + tag.getString(NBT_ITEM_ID));
|
LOGGER.warn("Could not deserialize item from string ID {}, it no longer exists", tag.getString(NBT_ITEM_ID));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("Cannot deserialize ItemStack: no " + NBT_ITEM_ID + " tag was found!");
|
throw new IllegalStateException("Cannot deserialize ItemStack: no " + NBT_ITEM_ID + " tag was found!");
|
||||||
|
Reference in New Issue
Block a user