SonarQube addiction, pt 14
This commit is contained in:
@@ -75,27 +75,27 @@ public class CableBlock extends NetworkNodeBlock implements IWaterLoggable {
|
|||||||
protected static VoxelShape getCableShape(BlockState state) {
|
protected static VoxelShape getCableShape(BlockState state) {
|
||||||
VoxelShape shape = SHAPE_CORE;
|
VoxelShape shape = SHAPE_CORE;
|
||||||
|
|
||||||
if (state.get(NORTH)) {
|
if (Boolean.TRUE.equals(state.get(NORTH))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_NORTH);
|
shape = VoxelShapes.or(shape, SHAPE_NORTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.get(EAST)) {
|
if (Boolean.TRUE.equals(state.get(EAST))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_EAST);
|
shape = VoxelShapes.or(shape, SHAPE_EAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.get(SOUTH)) {
|
if (Boolean.TRUE.equals(state.get(SOUTH))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_SOUTH);
|
shape = VoxelShapes.or(shape, SHAPE_SOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.get(WEST)) {
|
if (Boolean.TRUE.equals(state.get(WEST))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_WEST);
|
shape = VoxelShapes.or(shape, SHAPE_WEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.get(UP)) {
|
if (Boolean.TRUE.equals(state.get(UP))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_UP);
|
shape = VoxelShapes.or(shape, SHAPE_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.get(DOWN)) {
|
if (Boolean.TRUE.equals(state.get(DOWN))) {
|
||||||
shape = VoxelShapes.or(shape, SHAPE_DOWN);
|
shape = VoxelShapes.or(shape, SHAPE_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class CableBlock extends NetworkNodeBlock implements IWaterLoggable {
|
|||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public FluidState getFluidState(BlockState state) {
|
public FluidState getFluidState(BlockState state) {
|
||||||
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
|
return Boolean.TRUE.equals(state.get(WATERLOGGED)) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -49,7 +49,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = RSBlocks.WIRELESS_TRANSMITTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = RSBlocks.WIRELESS_TRANSMITTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.wirelessTransmitterBlock(block, state -> {
|
models.wirelessTransmitterBlock(block, state -> {
|
||||||
if (!state.get(NetworkNodeBlock.CONNECTED)) {
|
if (Boolean.FALSE.equals(state.get(NetworkNodeBlock.CONNECTED))) {
|
||||||
return models.createWirelessTransmitterModel(
|
return models.createWirelessTransmitterModel(
|
||||||
"block/" + folderName + "/disconnected",
|
"block/" + folderName + "/disconnected",
|
||||||
resourceLocation(folderName, "cutouts/disconnected")
|
resourceLocation(folderName, "cutouts/disconnected")
|
||||||
@@ -73,7 +73,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = RSBlocks.DETECTOR.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = RSBlocks.DETECTOR.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.simpleBlockStateModel(block, state -> {
|
models.simpleBlockStateModel(block, state -> {
|
||||||
if (!state.get(DetectorBlock.POWERED)) {
|
if (Boolean.FALSE.equals(state.get(DetectorBlock.POWERED))) {
|
||||||
return models.createDetectorModel(
|
return models.createDetectorModel(
|
||||||
"block/" + folderName + "/off",
|
"block/" + folderName + "/off",
|
||||||
resourceLocation(folderName, "cutouts/off")
|
resourceLocation(folderName, "cutouts/off")
|
||||||
@@ -97,7 +97,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = RSBlocks.SECURITY_MANAGER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = RSBlocks.SECURITY_MANAGER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.horizontalRSBlock(block, state -> {
|
models.horizontalRSBlock(block, state -> {
|
||||||
if (!state.get(NetworkNodeBlock.CONNECTED)) {
|
if (Boolean.FALSE.equals(state.get(NetworkNodeBlock.CONNECTED))) {
|
||||||
return models.createCubeCutoutModel(
|
return models.createCubeCutoutModel(
|
||||||
"block/" + folderName + "/disconnected",
|
"block/" + folderName + "/disconnected",
|
||||||
BOTTOM,
|
BOTTOM,
|
||||||
@@ -143,7 +143,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.simpleBlockStateModel(block, state -> {
|
models.simpleBlockStateModel(block, state -> {
|
||||||
if (!state.get(NetworkNodeBlock.CONNECTED)) {
|
if (Boolean.FALSE.equals(state.get(NetworkNodeBlock.CONNECTED))) {
|
||||||
return models.createCubeAllCutoutModel(
|
return models.createCubeAllCutoutModel(
|
||||||
"block/" + folderName + "/disconnected",
|
"block/" + folderName + "/disconnected",
|
||||||
resourceLocation(folderName, folderName),
|
resourceLocation(folderName, folderName),
|
||||||
@@ -171,7 +171,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = RSBlocks.CRAFTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = RSBlocks.CRAFTER.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.anyDirectionalRSBlock(block, state -> {
|
models.anyDirectionalRSBlock(block, state -> {
|
||||||
if (!state.get(NetworkNodeBlock.CONNECTED)) {
|
if (Boolean.FALSE.equals(state.get(NetworkNodeBlock.CONNECTED))) {
|
||||||
return models.createCubeCutoutModel(
|
return models.createCubeCutoutModel(
|
||||||
"block/" + folderName + "/disconnected",
|
"block/" + folderName + "/disconnected",
|
||||||
BOTTOM,
|
BOTTOM,
|
||||||
@@ -261,7 +261,7 @@ public class BlockModelGenerator extends BlockStateProvider {
|
|||||||
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
String folderName = blockMap.get(ColorMap.DEFAULT_COLOR).getId().getPath();
|
||||||
|
|
||||||
models.horizontalRSBlock(block, state -> {
|
models.horizontalRSBlock(block, state -> {
|
||||||
if (!state.get(NetworkNodeBlock.CONNECTED)) {
|
if (Boolean.FALSE.equals(state.get(NetworkNodeBlock.CONNECTED))) {
|
||||||
return models.createCubeNorthCutoutModel(
|
return models.createCubeNorthCutoutModel(
|
||||||
"block/" + folderName + "/disconnected",
|
"block/" + folderName + "/disconnected",
|
||||||
BOTTOM,
|
BOTTOM,
|
||||||
|
@@ -100,11 +100,11 @@ public class BlockModels {
|
|||||||
.texture("cutout_up", upCutout);
|
.texture("cutout_up", upCutout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockModelBuilder createControllerNearlyCutoutModel(String name, ResourceLocation particle, ResourceLocation all, ResourceLocation cutout_gray, ResourceLocation cutout) {
|
public BlockModelBuilder createControllerNearlyCutoutModel(String name, ResourceLocation particle, ResourceLocation all, ResourceLocation grayCutout, ResourceLocation cutout) {
|
||||||
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "block/controller_nearly"))
|
return generator.models().withExistingParent(name, new ResourceLocation(RS.ID, "block/controller_nearly"))
|
||||||
.texture("particle", particle)
|
.texture("particle", particle)
|
||||||
.texture("all", all)
|
.texture("all", all)
|
||||||
.texture("cutout_gray", cutout_gray)
|
.texture("cutout_gray", grayCutout)
|
||||||
.texture("cutout", cutout);
|
.texture("cutout", cutout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
public class ControllerItemPropertyGetter implements IItemPropertyGetter {
|
public class ControllerItemPropertyGetter implements IItemPropertyGetter {
|
||||||
@Override
|
@Override
|
||||||
public float call(ItemStack stack, @Nullable ClientWorld p_call_2_, @Nullable LivingEntity p_call_3_) {
|
public float call(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity) {
|
||||||
IEnergyStorage storage = stack.getCapability(CapabilityEnergy.ENERGY).orElse(null);
|
IEnergyStorage storage = stack.getCapability(CapabilityEnergy.ENERGY).orElse(null);
|
||||||
if (storage != null) {
|
if (storage != null) {
|
||||||
return Network.getEnergyType(storage.getEnergyStored(), storage.getMaxEnergyStored()).ordinal();
|
return Network.getEnergyType(storage.getEnergyStored(), storage.getMaxEnergyStored()).ordinal();
|
||||||
|
@@ -10,11 +10,11 @@ import net.minecraft.item.ItemStack;
|
|||||||
|
|
||||||
public class PatternItemStackTileRenderer extends ItemStackTileEntityRenderer {
|
public class PatternItemStackTileRenderer extends ItemStackTileEntityRenderer {
|
||||||
@Override
|
@Override
|
||||||
public void func_239207_a_(ItemStack stack, ItemCameraTransforms.TransformType transformType, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int p_239207_5_, int p_239207_6_) {
|
public void func_239207_a_(ItemStack stack, ItemCameraTransforms.TransformType transformType, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int combinedLight, int combinedOverlay) {
|
||||||
ICraftingPattern pattern = PatternItem.fromCache(null, stack);
|
ICraftingPattern pattern = PatternItem.fromCache(null, stack);
|
||||||
|
|
||||||
ItemStack outputStack = pattern.getOutputs().get(0);
|
ItemStack outputStack = pattern.getOutputs().get(0);
|
||||||
|
|
||||||
outputStack.getItem().getItemStackTileEntityRenderer().func_239207_a_(outputStack, transformType, matrixStack, renderTypeBuffer, p_239207_5_, p_239207_6_);
|
outputStack.getItem().getItemStackTileEntityRenderer().func_239207_a_(outputStack, transformType, matrixStack, renderTypeBuffer, combinedLight, combinedOverlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -153,12 +153,12 @@ public class CrafterManagerScreen extends BaseScreen<CrafterManagerContainer> im
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) {
|
public boolean charTyped(char unknown1, int unknown2) {
|
||||||
if (searchField.charTyped(p_charTyped_1_, p_charTyped_2_)) {
|
if (searchField.charTyped(unknown1, unknown2)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.charTyped(p_charTyped_1_, p_charTyped_2_);
|
return super.charTyped(unknown1, unknown2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage.tile.data.TileDataParameterClientListener;
|
|||||||
public class CrafterTileDataParameterClientListener implements TileDataParameterClientListener<Boolean> {
|
public class CrafterTileDataParameterClientListener implements TileDataParameterClientListener<Boolean> {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(boolean initial, Boolean hasRoot) {
|
public void onChanged(boolean initial, Boolean hasRoot) {
|
||||||
if (!hasRoot) {
|
if (Boolean.FALSE.equals(hasRoot)) {
|
||||||
BaseScreen.executeLater(CrafterScreen.class, gui -> gui.addSideButton(new CrafterModeSideButton(gui)));
|
BaseScreen.executeLater(CrafterScreen.class, gui -> gui.addSideButton(new CrafterModeSideButton(gui)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -555,20 +555,24 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_) {
|
public boolean charTyped(char unknown1, int unknown2) {
|
||||||
if (searchField.charTyped(p_charTyped_1_, p_charTyped_2_)) {
|
if (searchField.charTyped(unknown1, unknown2)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.charTyped(p_charTyped_1_, p_charTyped_2_);
|
return super.charTyped(unknown1, unknown2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean keyReleased(int key, int p_223281_2_, int p_223281_3_) {
|
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
|
||||||
if (key == GLFW.GLFW_KEY_LEFT_SHIFT || key == GLFW.GLFW_KEY_RIGHT_SHIFT || key == GLFW.GLFW_KEY_LEFT_CONTROL || key == GLFW.GLFW_KEY_RIGHT_CONTROL) {
|
if (keyCode == GLFW.GLFW_KEY_LEFT_SHIFT ||
|
||||||
|
keyCode == GLFW.GLFW_KEY_RIGHT_SHIFT ||
|
||||||
|
keyCode == GLFW.GLFW_KEY_LEFT_CONTROL ||
|
||||||
|
keyCode == GLFW.GLFW_KEY_RIGHT_CONTROL) {
|
||||||
view.sort();
|
view.sort();
|
||||||
}
|
}
|
||||||
return super.keyReleased(key, p_223281_2_, p_223281_3_);
|
|
||||||
|
return super.keyReleased(keyCode, scanCode, modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -47,11 +47,11 @@ public class CheckboxWidget extends CheckboxButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderButton(MatrixStack matrixStack, int p_230431_2_, int p_230431_3_, float p_230431_4_) {
|
public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||||
Minecraft minecraft = Minecraft.getInstance();
|
Minecraft minecraft = Minecraft.getInstance();
|
||||||
minecraft.getTextureManager().bindTexture(TEXTURE);
|
minecraft.getTextureManager().bindTexture(TEXTURE);
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
FontRenderer fontrenderer = minecraft.fontRenderer;
|
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
@@ -65,7 +65,7 @@ public class CheckboxWidget extends CheckboxButton {
|
|||||||
|
|
||||||
blit(matrixStack, this.x, this.y, textureX, textureY, width, height, 32, 32);
|
blit(matrixStack, this.x, this.y, textureX, textureY, width, height, 32, 32);
|
||||||
|
|
||||||
this.renderBg(matrixStack, minecraft, p_230431_2_, p_230431_3_);
|
this.renderBg(matrixStack, minecraft, mouseX, mouseY);
|
||||||
|
|
||||||
int color = 14737632;
|
int color = 14737632;
|
||||||
|
|
||||||
@@ -76,9 +76,9 @@ public class CheckboxWidget extends CheckboxButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shadow) {
|
if (shadow) {
|
||||||
drawString(matrixStack, fontrenderer, this.getMessage(), this.x + 13, this.y + (this.height - 8) / 2, color);
|
drawString(matrixStack, fontRenderer, this.getMessage(), this.x + 13, this.y + (this.height - 8) / 2, color);
|
||||||
} else {
|
} else {
|
||||||
fontrenderer.drawString(matrixStack, this.getMessage().getString(), this.x + 13, this.y + (this.height - 8) / 2F, color);
|
fontRenderer.drawString(matrixStack, this.getMessage().getString(), (float) this.x + 13, this.y + (this.height - 8) / 2F, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -173,10 +173,10 @@ public class SearchWidget extends TextFieldWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderButton(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_) {
|
public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (canSyncFromJEINow() && RSJeiPlugin.getRuntime().getIngredientListOverlay().hasKeyboardFocus()) {
|
if (canSyncFromJEINow() && RSJeiPlugin.getRuntime().getIngredientListOverlay().hasKeyboardFocus()) {
|
||||||
setTextFromJEI();
|
setTextFromJEI();
|
||||||
}
|
}
|
||||||
super.renderButton(p_230431_1_, p_230431_2_, p_230431_3_, p_230431_4_);
|
super.renderButton(matrixStack, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,12 +15,12 @@ public class ConstructorDropSideButton extends SideButton {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderButtonIcon(MatrixStack matrixStack, int x, int y) {
|
protected void renderButtonIcon(MatrixStack matrixStack, int x, int y) {
|
||||||
screen.blit(matrixStack, x, y, 64 + (ConstructorTile.DROP.getValue() ? 16 : 0), 16, 16, 16);
|
screen.blit(matrixStack, x, y, 64 + (Boolean.TRUE.equals(ConstructorTile.DROP.getValue()) ? 16 : 0), 16, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTooltip() {
|
public String getTooltip() {
|
||||||
return I18n.format("sidebutton.refinedstorage.constructor.drop") + "\n" + TextFormatting.GRAY + I18n.format(ConstructorTile.DROP.getValue() ? "gui.yes" : "gui.no");
|
return I18n.format("sidebutton.refinedstorage.constructor.drop") + "\n" + TextFormatting.GRAY + I18n.format(Boolean.TRUE.equals(ConstructorTile.DROP.getValue()) ? "gui.yes" : "gui.no");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user