Skip to content

Commit

Permalink
Fix some IntelliJ warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonEggBedrockBreaking committed Dec 26, 2023
1 parent 528edd5 commit e1981e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void repositionElements() {
}

@Override
public void render(GuiGraphics g, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull GuiGraphics g, int mouseX, int mouseY, float partialTick) {
this.renderDirtBackground(g);
for (Renderable renderable : this.renderables) {
renderable.render(g, mouseX, mouseY, partialTick);
Expand Down Expand Up @@ -111,7 +111,7 @@ public void onClose() {
}

class Tab extends GridLayoutTab {
public ObjectSet<String> leftList;
public final ObjectSet<String> leftList;
String search;

Tab(Component title, Object2ObjectMap<String, Object2ObjectMap<String, Component>> dataData, Object2ObjectMap<String, Object2ObjectMap<String, String>> data, String colsKey) {
Expand Down Expand Up @@ -202,7 +202,7 @@ class LeftEntry extends ContainerObjectSelectionList.Entry<LeftEntry> {
}

@Override
public void render(GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, float partialTick) {
public void render(@NotNull GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, float partialTick) {
this.button.setX(left - Math.max(0, (int) (width * 0.05)));
this.button.setY(top);
this.button.setWidth(width);
Expand All @@ -223,7 +223,7 @@ public void render(GuiGraphics guiGraphics, int index, int top, int left, int wi

class LeftList extends ContainerObjectSelectionList<LeftEntry> {
public LeftList(ObjectSet<String> leftItems, RightList rightList) {
super(CommandConfigScreen.this.minecraft, (int) (CommandConfigScreen.this.width * 0.43), CommandConfigScreen.this.height - 75, 50, 24);
super(Objects.requireNonNull(CommandConfigScreen.this.minecraft), (int) (CommandConfigScreen.this.width * 0.43), CommandConfigScreen.this.height - 75, 50, 24);
this.setX((int) (CommandConfigScreen.this.width * 0.02));
leftItems.stream().sorted().forEach(leftItem -> {
if (leftItem.contains("/") && leftItem.contains(":")) {
Expand Down Expand Up @@ -374,7 +374,7 @@ public void render(GuiGraphics guiGraphics, int index, int top, int left, int wi
}

class RightStringEntry extends RightEntry {
Button button;
final Button button;

RightStringEntry(String main, Component tooltip, String table) {
super(main, tooltip);
Expand Down Expand Up @@ -408,13 +408,13 @@ public void render(GuiGraphics guiGraphics, int index, int top, int left, int wi
}

class RightList extends ContainerObjectSelectionList<RightEntry> {
Object2ObjectMap<String, Object2ObjectMap<String, Component>> dataData;
Object2ObjectMap<String, Object2ObjectMap<String, String>> data;
Object2ObjectMap<String, DataType> dataTypeData;
String table;
final Object2ObjectMap<String, Object2ObjectMap<String, Component>> dataData;
final Object2ObjectMap<String, Object2ObjectMap<String, String>> data;
final Object2ObjectMap<String, DataType> dataTypeData;
final String table;

public RightList(int numCategories, Object2ObjectMap<String, Object2ObjectMap<String, Component>> dataData, Object2ObjectMap<String, Object2ObjectMap<String, String>> data, Object2ObjectMap<String, DataType> dataTypeData, String table) {
super(CommandConfigScreen.this.minecraft, (int) (CommandConfigScreen.this.width * 0.48), CommandConfigScreen.this.height - (numCategories <= 1 ? 75 : 100), numCategories <= 1 ? 50 : 75, 24);
super(Objects.requireNonNull(CommandConfigScreen.this.minecraft), (int) (CommandConfigScreen.this.width * 0.48), CommandConfigScreen.this.height - (numCategories <= 1 ? 75 : 100), numCategories <= 1 ? 50 : 75, 24);
this.setX(CommandConfigScreen.this.width / 2);
this.dataData = dataData;
this.data = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.components.Checkbox;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;

Expand Down Expand Up @@ -58,7 +59,7 @@ protected void init() {
}

@Override
public void render(GuiGraphics g, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull GuiGraphics g, int mouseX, int mouseY, float partialTick) {
this.renderBackground(g, mouseX, mouseY, partialTick);
super.render(g, mouseX, mouseY, partialTick);
g.drawCenteredString(this.font, this.title, width / 2, 36, 16777215);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;
import uk.debb.vanilla_disable.data.worldgen.WorldgenDataHandler;

import java.util.Objects;
Expand Down Expand Up @@ -49,7 +50,7 @@ protected void init() {
}

@Override
public void render(GuiGraphics g, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull GuiGraphics g, int mouseX, int mouseY, float partialTick) {
this.renderBackground(g, mouseX, mouseY, partialTick);
super.render(g, mouseX, mouseY, partialTick);
g.drawCenteredString(this.font, this.title, width / 2, 48, 16777215);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public static void populate() {
put("cooldown", "300");
}

if (!blockEntityRegistry.containsKey(blockRegistry.getKey(block))) {
if (!blockEntityRegistry.containsKey(Objects.requireNonNull(blockRegistry.getKey(block)))) {
if (block.equals(Blocks.OBSIDIAN) || block.equals(Blocks.CRYING_OBSIDIAN) ||
block.equals(Blocks.REINFORCED_DEEPSLATE) || block.equals(Blocks.RESPAWN_ANCHOR)) {
put("push_behaviour", "'" + PushReaction.BLOCK + "'");
Expand Down

0 comments on commit e1981e6

Please sign in to comment.