Skip to content

Commit

Permalink
Replaced resourcelocation initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Stereowalker committed Nov 23, 2024
1 parent 2b8e6e7 commit b473384
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/rpgz/forge/Rpgz.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.stereowalker.unionlib.api.collectors.ConfigCollector;
import com.stereowalker.unionlib.mod.MinecraftMod;
import com.stereowalker.unionlib.mod.ServerSegment;
import com.stereowalker.unionlib.util.VersionHelper;

import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
Expand Down Expand Up @@ -75,6 +76,6 @@ private void clientSetup(final FMLClientSetupEvent event) {

public static ResourceLocation locationz(String name)
{
return new ResourceLocation(MOD_ID, name);
return VersionHelper.toLoc(MOD_ID, name);
}
}
6 changes: 4 additions & 2 deletions src/main/java/net/rpgz/init/SoundInit.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package net.rpgz.init;

import com.stereowalker.unionlib.util.VersionHelper;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.registries.RegisterEvent.RegisterHelper;

public class SoundInit {

public static final ResourceLocation LOOT_SOUND = new ResourceLocation("rpgz:loot");
public static final ResourceLocation COIN_LOOT_SOUND = new ResourceLocation("rpgz:coin_loot");
public static final ResourceLocation LOOT_SOUND = VersionHelper.toLoc("rpgz:loot");
public static final ResourceLocation COIN_LOOT_SOUND = VersionHelper.toLoc("rpgz:coin_loot");

public static SoundEvent LOOT_SOUND_EVENT = SoundEvent.createVariableRangeEvent(LOOT_SOUND);
public static SoundEvent COIN_LOOT_SOUND_EVENT = SoundEvent.createVariableRangeEvent(COIN_LOOT_SOUND);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/net/rpgz/init/TagInit.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.rpgz.init;

import com.stereowalker.unionlib.util.VersionHelper;

import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
Expand All @@ -8,8 +10,8 @@

public class TagInit {

public static final TagKey<Item> RARE_ITEMS = TagKey.create(Registries.ITEM, new ResourceLocation("rpgz", "rare_items"));
public static final TagKey<EntityType<?>> EXCLUDED_ENTITIES = TagKey.create(Registries.ENTITY_TYPE, new ResourceLocation("rpgz", "excluded_entities"));
public static final TagKey<Item> RARE_ITEMS = TagKey.create(Registries.ITEM, VersionHelper.toLoc("rpgz", "rare_items"));
public static final TagKey<EntityType<?>> EXCLUDED_ENTITIES = TagKey.create(Registries.ENTITY_TYPE, VersionHelper.toLoc("rpgz", "excluded_entities"));

public static void init() {
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/rpgz/mixin/InGameHudMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.mojang.blaze3d.systems.RenderSystem;
import com.stereowalker.unionlib.util.VersionHelper;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
Expand Down Expand Up @@ -36,7 +37,6 @@ public InGameHudMixin(Minecraft mc) {
@Inject(method = "render", at = @At(value = "TAIL"))
private void renderIngameGuiMixin(GuiGraphics pGuiGraphics, float f, CallbackInfo info) {
this.renderLootBag(pGuiGraphics);
System.out.println("Graphics");
}

private void renderLootBag(GuiGraphics guiComponent) {
Expand All @@ -47,7 +47,7 @@ private void renderLootBag(GuiGraphics guiComponent) {
if (deadBody != null && deadBody.deathTime > 20) {
int scaledWidth = this.minecraft.getWindow().getGuiScaledWidth();
int scaledHeight = this.minecraft.getWindow().getGuiScaledHeight();
guiComponent.blit(new ResourceLocation("rpgz:textures/sprite/loot_bag.png"), (scaledWidth / 2), (scaledHeight / 2) - 16, 0.0F, 0.0F, 16, 16, 16,
guiComponent.blit(VersionHelper.toLoc("rpgz:textures/sprite/loot_bag.png"), (scaledWidth / 2), (scaledHeight / 2) - 16, 0.0F, 0.0F, 16, 16, 16,
16);
}
}
Expand Down

0 comments on commit b473384

Please sign in to comment.