Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
several simple port related fixes and usage of new methods
  • Loading branch information
HiWord9 committed Sep 16, 2024
1 parent 0ab8c4f commit e44059c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.HiWord9.RPRenames.util.rename.RenamesManager;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.client.render.model.BlockStatesLoader;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.render.model.json.JsonUnbakedModel;
import net.minecraft.util.Identifier;
Expand All @@ -21,7 +22,7 @@ public class ModelLoaderMixin {
private static final ModConfig config = ModConfig.INSTANCE;

@Inject(method = "<init>", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V"))
private void loadRenames(BlockColors blockColors, Profiler profiler, Map<Identifier, JsonUnbakedModel> jsonUnbakedModels, Map<Identifier, List<ModelLoader.SourceTrackedData>> blockStates, CallbackInfo ci) {
private void loadRenames(BlockColors blockColors, Profiler profiler, Map<Identifier, JsonUnbakedModel> jsonUnbakedModels, Map<Identifier, List<BlockStatesLoader.SourceTrackedData>> blockStates, CallbackInfo ci) {
if (!config.updateConfig) return;
RenamesManager.updateRenames(MinecraftClient.getInstance().getResourceManager(), profiler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.HiWord9.RPRenames.util.rename.renderer.PreviewTooltipPositioner;
import com.google.gson.Gson;
import com.google.gson.stream.JsonWriter;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.io.IOUtils;

import java.io.FileReader;
import java.io.FileWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private static void parseTextureSourceFile(ResourceManager resourceManager, Stri
ArrayList<String> textures = objToParamList(objFromInputStream(resourceJpm.getInputStream()), "texture");
if (textures.isEmpty()) return;

String textureName = prepareTexturePath(textures.get(0));
String textureName = prepareTexturePath(textures.getFirst());

Identifier propId = Identifier.of(Identifier.DEFAULT_NAMESPACE, texturePath + textureName + PROP_EXTENSION);
Optional<Resource> optionalResourceProp = resourceManager.getResource(propId);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/HiWord9/RPRenames/util/gui/Graphics.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.HiWord9.RPRenames.util.gui;

import com.HiWord9.RPRenames.util.gui.widget.button.external.FavoriteButton;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.item.Item;
import net.minecraft.screen.slot.Slot;
import net.minecraft.util.Identifier;
import net.minecraft.util.collection.DefaultedList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void setItems(ArrayList<Item> items) {
}

public Item getItem() {
return items.isEmpty() ? null : items.get(0);
return items.isEmpty() ? null : items.getFirst();
}

public void setItem(Item item) {
Expand Down

0 comments on commit e44059c

Please sign in to comment.