diff --git a/src/main/java/net/mcreator/superbwarfare/ModUtils.java b/src/main/java/net/mcreator/superbwarfare/ModUtils.java index ff7c8c628..ed31b8ec5 100644 --- a/src/main/java/net/mcreator/superbwarfare/ModUtils.java +++ b/src/main/java/net/mcreator/superbwarfare/ModUtils.java @@ -130,4 +130,8 @@ public class ModUtils { event.enqueueWork(() -> BrewingRecipeRegistry.addRecipe(Ingredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), ModPotion.SHOCK.get())), Ingredient.of(Items.GLOWSTONE_DUST), PotionUtils.setPotion(new ItemStack(Items.POTION), ModPotion.STRONG_SHOCK.get()))); } + + public static ResourceLocation loc(String path) { + return new ResourceLocation(MODID, path); + } } diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/AmmoBarOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/AmmoBarOverlay.java index 77588196a..6d7d3715b 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/AmmoBarOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/AmmoBarOverlay.java @@ -20,12 +20,12 @@ import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(value = Dist.CLIENT) public class AmmoBarOverlay { - private static final ResourceLocation LINE = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/line.png"); - private static final ResourceLocation SEMI = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/semi.png"); - private static final ResourceLocation BURST = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/burst.png"); - private static final ResourceLocation AUTO = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/auto.png"); - private static final ResourceLocation TOP = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/top.png"); - private static final ResourceLocation DIR = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/fire_mode/dir.png"); + private static final ResourceLocation LINE = ModUtils.loc("textures/gun_icon/fire_mode/line.png"); + private static final ResourceLocation SEMI = ModUtils.loc("textures/gun_icon/fire_mode/semi.png"); + private static final ResourceLocation BURST = ModUtils.loc("textures/gun_icon/fire_mode/burst.png"); + private static final ResourceLocation AUTO = ModUtils.loc("textures/gun_icon/fire_mode/auto.png"); + private static final ResourceLocation TOP = ModUtils.loc("textures/gun_icon/fire_mode/top.png"); + private static final ResourceLocation DIR = ModUtils.loc("textures/gun_icon/fire_mode/dir.png"); private static boolean creativeAmmo() { Player player = Minecraft.getInstance().player; diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/CannonHudOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/CannonHudOverlay.java index 9ed8fd704..2fff0dc50 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/CannonHudOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/CannonHudOverlay.java @@ -9,7 +9,6 @@ import net.mcreator.superbwarfare.tools.TraceTool; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; @@ -53,8 +52,8 @@ public class CannonHudOverlay { } else if (diffY < -180.0f) { diffY += 360.0f; } - float f = (float)Math.min(w, h); - float f1 = Math.min((float)w / f, (float)h / f) * fovAdjust; + float f = (float) Math.min(w, h); + float f1 = Math.min((float) w / f, (float) h / f) * fovAdjust; int i = Mth.floor(f * f1); int j = Mth.floor(f * f1); int k = (w - i) / 2; @@ -87,10 +86,10 @@ public class CannonHudOverlay { w / 2 + 14, h / 2 - 20, -1, false); } } - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, "textures/screens/cannon/cannon_crosshair.png"), k, l, 0, 0.0F, i, j, i, j); - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, "textures/screens/cannon/indicator.png"), k + (float) Math.tan(Mth.clamp(Mth.DEG_TO_RAD * diffY, -1.5, 1.5)) * 5 * i / 1.4f * (90 - Math.abs(player.getXRot())) / 90, l + (float) Math.tan(Mth.clamp(Mth.DEG_TO_RAD * diffX, -1.5, 1.5)) * 5 * j / 1.4f, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc("textures/screens/cannon/cannon_crosshair.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc("textures/screens/cannon/indicator.png"), k + (float) Math.tan(Mth.clamp(Mth.DEG_TO_RAD * diffY, -1.5, 1.5)) * 5 * i / 1.4f * (90 - Math.abs(player.getXRot())) / 90, l + (float) Math.tan(Mth.clamp(Mth.DEG_TO_RAD * diffX, -1.5, 1.5)) * 5 * j / 1.4f, 0, 0.0F, i, j, i, j); } else { - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, "textures/screens/cannon/cannon_crosshair_notzoom.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc("textures/screens/cannon/cannon_crosshair_notzoom.png"), k, l, 0, 0.0F, i, j, i, j); } } RenderSystem.depthMask(true); diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/CrossHairOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/CrossHairOverlay.java index 8f0ab2ebc..2a427e420 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/CrossHairOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/CrossHairOverlay.java @@ -28,8 +28,8 @@ import static net.mcreator.superbwarfare.tools.RenderTool.preciseBlit; @Mod.EventBusSubscriber(value = Dist.CLIENT) public class CrossHairOverlay { - private static final ResourceLocation REX_HORIZONTAL = new ResourceLocation(ModUtils.MODID, "textures/screens/rex_horizontal.png"); - private static final ResourceLocation REX_VERTICAL = new ResourceLocation(ModUtils.MODID, "textures/screens/rex_vertical.png"); + private static final ResourceLocation REX_HORIZONTAL = ModUtils.loc("textures/screens/rex_horizontal.png"); + private static final ResourceLocation REX_VERTICAL = ModUtils.loc("textures/screens/rex_vertical.png"); public static int HIT_INDICATOR = 0; public static int HEAD_INDICATOR = 0; @@ -74,10 +74,10 @@ public class CrossHairOverlay { float finPosY = ((h - finLength) / 2) + moveY; if (shouldRenderCrossHair(player) || (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON && stack.is(ModItems.MINIGUN.get())) || (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && (ClientEventHandler.zoomTime > 0 || ClientEventHandler.pullPos > 0))) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/point.png"), w / 2f - 7.5f + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/point.png"), w / 2f - 7.5f + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); if (!player.isSprinting() || player.getPersistentData().getDouble("noRun") > 0) { if (stack.is(ModTags.Items.SHOTGUN)) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/shotgun_hud.png"), finPosX, finPosY, 0, 0.0F, finLength, finLength, finLength, finLength); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/shotgun_hud.png"), finPosX, finPosY, 0, 0.0F, finLength, finLength, finLength, finLength); } else { preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 13.5f - 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 2.5f + 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); @@ -89,10 +89,10 @@ public class CrossHairOverlay { if (stack.is(ModItems.BOCEK.get())) { if (stack.getOrCreateTag().getBoolean("HoloHidden")) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/point.png"), w / 2f - 7.5f + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/point.png"), w / 2f - 7.5f + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); if (!player.isSprinting() || player.getPersistentData().getDouble("noRun") > 0 || ClientEventHandler.pullPos > 0) { if (ClientEventHandler.zoomTime < 0.1) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/shotgun_hud.png"), finPosX, finPosY, 0, 0.0F, finLength, finLength, finLength, finLength); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/shotgun_hud.png"), finPosX, finPosY, 0, 0.0F, finLength, finLength, finLength, finLength); } else { preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 13.5f - 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); preciseBlit(guiGraphics, REX_HORIZONTAL, (float) (w / 2f - 2.5f + 2.8f * spread) + moveX, h / 2f - 7.5f + moveY, 0, 0, 16, 16, 16, 16); @@ -142,11 +142,11 @@ public class CrossHairOverlay { float rate = (40 - KILL_INDICATOR * 5) / 5.5f; if (HIT_INDICATOR > 0) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/hit_marker.png"), posX + moveX, posY + moveY, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/hit_marker.png"), posX + moveX, posY + moveY, 0, 0, 16, 16, 16, 16); } if (HEAD_INDICATOR > 0) { - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/headshot_mark.png"), posX + moveX, posY + moveY, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/headshot_mark.png"), posX + moveX, posY + moveY, 0, 0, 16, 16, 16, 16); } if (KILL_INDICATOR > 0) { @@ -155,10 +155,10 @@ public class CrossHairOverlay { float posX2 = w / 2f - 7.5f + 2 - rate + moveX; float posY2 = h / 2f - 7.5f + 2 - rate + moveY; - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/kill_mark1.png"), posX1, posY1, 0, 0, 16, 16, 16, 16); - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/kill_mark2.png"), posX2, posY1, 0, 0, 16, 16, 16, 16); - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/kill_mark3.png"), posX1, posY2, 0, 0, 16, 16, 16, 16); - preciseBlit(guiGraphics, new ResourceLocation(ModUtils.MODID, "textures/screens/kill_mark4.png"), posX2, posY2, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark1.png"), posX1, posY1, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark2.png"), posX2, posY1, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark3.png"), posX1, posY2, 0, 0, 16, 16, 16, 16); + preciseBlit(guiGraphics, ModUtils.loc("textures/screens/kill_mark4.png"), posX2, posY2, 0, 0, 16, 16, 16, 16); } } diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/DroneUIOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/DroneUIOverlay.java index 3a5b94540..ca30267c4 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/DroneUIOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/DroneUIOverlay.java @@ -9,7 +9,6 @@ import net.mcreator.superbwarfare.tools.TraceTool; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -45,7 +44,7 @@ public class DroneUIOverlay { RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); RenderSystem.setShaderColor(1, 1, 1, 1); if (stack.is(ModItems.MONITOR.get()) && stack.getOrCreateTag().getBoolean("Using") && stack.getOrCreateTag().getBoolean("Linked")) { - event.getGuiGraphics().blit(new ResourceLocation(ModUtils.MODID, "textures/screens/drone.png"), w / 2 - 16, h / 2 - 16, 0, 0, 32, 32, 32, 32); + event.getGuiGraphics().blit(ModUtils.loc("textures/screens/drone.png"), w / 2 - 16, h / 2 - 16, 0, 0, 32, 32, 32, 32); DroneEntity entity = player.level().getEntitiesOfClass(DroneEntity.class, player.getBoundingBox().inflate(512)) .stream().filter(e -> e.getStringUUID().equals(stack.getOrCreateTag().getString("LinkedDrone"))).findFirst().orElse(null); diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/JavelinHudOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/JavelinHudOverlay.java index 8f239adab..265c3e44d 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/JavelinHudOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/JavelinHudOverlay.java @@ -8,7 +8,6 @@ import net.mcreator.superbwarfare.init.ModItems; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.RenderType; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -43,21 +42,21 @@ public class JavelinHudOverlay { RenderSystem.setShaderColor(1, 1, 1, 1); float deltaFrame = Minecraft.getInstance().getDeltaFrameTime(); float moveX = (float) (-32 * ClientEventHandler.turnRot[1] - (player.isSprinting() ? 100 : 67) * ClientEventHandler.movePosX + 3 * ClientEventHandler.cameraRot[2]); - float moveY = (float) (-32 * ClientEventHandler.turnRot[0] + 100 * (float)ClientEventHandler.velocityY - (player.isSprinting() ? 100 : 67) * ClientEventHandler.movePosY - 12 * ClientEventHandler.firePos + 3 * ClientEventHandler.cameraRot[1]); + float moveY = (float) (-32 * ClientEventHandler.turnRot[0] + 100 * (float) ClientEventHandler.velocityY - (player.isSprinting() ? 100 : 67) * ClientEventHandler.movePosY - 12 * ClientEventHandler.firePos + 3 * ClientEventHandler.cameraRot[1]); scopeScale = (float) Mth.lerp(0.5F * deltaFrame, scopeScale, 1.35F + (0.2f * ClientEventHandler.firePos)); - float f = (float)Math.min(w, h); - float f1 = Math.min((float)w / f, (float)h / f) * scopeScale; + float f = (float) Math.min(w, h); + float f1 = Math.min((float) w / f, (float) h / f) * scopeScale; float i = Mth.floor(f * f1); float j = Mth.floor(f * f1); float k = ((w - i) / 2) + moveX; float l = ((h - j) / 2) + moveY; float i1 = k + i; float j1 = l + j; - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, "textures/screens/javelin/javelin_hud.png"), k, l, 0, 0.0F, i, j, i, j); - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, stack.getOrCreateTag().getBoolean("TopMode") ? "textures/screens/javelin/top.png" : "textures/screens/javelin/dir.png"), k, l, 0, 0.0F, i, j, i, j); - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, stack.getOrCreateTag().getInt("ammo") > 0 ? "textures/screens/javelin/missile_green.png" : "textures/screens/javelin/missile_red.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc("textures/screens/javelin/javelin_hud.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc(stack.getOrCreateTag().getBoolean("TopMode") ? "textures/screens/javelin/top.png" : "textures/screens/javelin/dir.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc(stack.getOrCreateTag().getInt("ammo") > 0 ? "textures/screens/javelin/missile_green.png" : "textures/screens/javelin/missile_red.png"), k, l, 0, 0.0F, i, j, i, j); if (stack.getOrCreateTag().getInt("SeekTime") > 1 && stack.getOrCreateTag().getInt("SeekTime") < 20) { - preciseBlit(event.getGuiGraphics(), new ResourceLocation(ModUtils.MODID, "textures/screens/javelin/seek.png"), k, l, 0, 0.0F, i, j, i, j); + preciseBlit(event.getGuiGraphics(), ModUtils.loc("textures/screens/javelin/seek.png"), k, l, 0, 0.0F, i, j, i, j); } event.getGuiGraphics().fill(RenderType.guiOverlay(), 0, (int) l, (int) k + 3, (int) j1, -90, -16777216); event.getGuiGraphics().fill(RenderType.guiOverlay(), (int) i1, (int) l, w, (int) j1, -90, -16777216); diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/KillMessageOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/KillMessageOverlay.java index 4ec383a3b..e6b91c775 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/KillMessageOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/KillMessageOverlay.java @@ -31,18 +31,18 @@ import static net.mcreator.superbwarfare.tools.RenderTool.preciseBlit; @Mod.EventBusSubscriber(value = Dist.CLIENT) public class KillMessageOverlay { - private static final ResourceLocation HEADSHOT = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/headshot.png"); + private static final ResourceLocation HEADSHOT = ModUtils.loc("textures/screens/damage_types/headshot.png"); - private static final ResourceLocation KNIFE = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/knife.png"); - private static final ResourceLocation EXPLOSION = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/explosion.png"); - private static final ResourceLocation CLAYMORE = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/claymore.png"); - private static final ResourceLocation GENERIC = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/generic.png"); - private static final ResourceLocation BEAST = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/beast.png"); - private static final ResourceLocation BLEEDING = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/bleeding.png"); - private static final ResourceLocation SHOCK = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/shock.png"); - private static final ResourceLocation BLOOD_CRYSTAL = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/blood_crystal.png"); + private static final ResourceLocation KNIFE = ModUtils.loc("textures/screens/damage_types/knife.png"); + private static final ResourceLocation EXPLOSION = ModUtils.loc("textures/screens/damage_types/explosion.png"); + private static final ResourceLocation CLAYMORE = ModUtils.loc("textures/screens/damage_types/claymore.png"); + private static final ResourceLocation GENERIC = ModUtils.loc("textures/screens/damage_types/generic.png"); + private static final ResourceLocation BEAST = ModUtils.loc("textures/screens/damage_types/beast.png"); + private static final ResourceLocation BLEEDING = ModUtils.loc("textures/screens/damage_types/bleeding.png"); + private static final ResourceLocation SHOCK = ModUtils.loc("textures/screens/damage_types/shock.png"); + private static final ResourceLocation BLOOD_CRYSTAL = ModUtils.loc("textures/screens/damage_types/blood_crystal.png"); - private static final ResourceLocation WORLD_PEACE_STAFF = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/compat/world_peace_staff.png"); + private static final ResourceLocation WORLD_PEACE_STAFF = ModUtils.loc("textures/gun_icon/compat/world_peace_staff.png"); @SubscribeEvent(priority = EventPriority.NORMAL) public static void onRenderGui(RenderGuiEvent.Pre event) { diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/M79UIOverlay.java b/src/main/java/net/mcreator/superbwarfare/client/screens/M79UIOverlay.java index 211c8b26f..6b4af0117 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/M79UIOverlay.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/M79UIOverlay.java @@ -8,7 +8,6 @@ import net.mcreator.superbwarfare.init.ModItems; import net.minecraft.client.CameraType; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GameRenderer; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderGuiEvent; @@ -32,7 +31,7 @@ public class M79UIOverlay { RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); RenderSystem.setShaderColor(1, 1, 1, 1); if (shouldRenderCrossHair(player)) { - event.getGuiGraphics().blit(new ResourceLocation(ModUtils.MODID, "textures/screens/rex.png"), w / 2 - 16, h / 2 - 16, 0, 0, 32, 32, 32, 32); + event.getGuiGraphics().blit(ModUtils.loc("textures/screens/rex.png"), w / 2 - 16, h / 2 - 16, 0, 0, 32, 32, 32, 32); } RenderSystem.depthMask(true); RenderSystem.defaultBlendFunc(); diff --git a/src/main/java/net/mcreator/superbwarfare/client/screens/ReforgingTableScreen.java b/src/main/java/net/mcreator/superbwarfare/client/screens/ReforgingTableScreen.java index 59ba661e4..e0d8be9f2 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/screens/ReforgingTableScreen.java +++ b/src/main/java/net/mcreator/superbwarfare/client/screens/ReforgingTableScreen.java @@ -19,7 +19,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class ReforgingTableScreen extends AbstractContainerScreen { - private static final ResourceLocation TEXTURE = new ResourceLocation(ModUtils.MODID, "textures/gui/reforging_table.png"); + private static final ResourceLocation TEXTURE = ModUtils.loc("textures/gui/reforging_table.png"); public ReforgingTableScreen(ReforgingTableMenu pMenu, Inventory pPlayerInventory, Component pTitle) { super(pMenu, pPlayerInventory, pTitle); diff --git a/src/main/java/net/mcreator/superbwarfare/datagen/ModItemModelProvider.java b/src/main/java/net/mcreator/superbwarfare/datagen/ModItemModelProvider.java index b05fd46cf..91aab8bab 100644 --- a/src/main/java/net/mcreator/superbwarfare/datagen/ModItemModelProvider.java +++ b/src/main/java/net/mcreator/superbwarfare/datagen/ModItemModelProvider.java @@ -138,12 +138,12 @@ public class ModItemModelProvider extends ItemModelProvider { private ItemModelBuilder simpleItem(RegistryObject item, String location) { return withExistingParent(item.getId().getPath(), new ResourceLocation("item/generated")) - .texture("layer0", new ResourceLocation(ModUtils.MODID, "item/" + location + item.getId().getPath())); + .texture("layer0", ModUtils.loc("item/" + location + item.getId().getPath())); } private ItemModelBuilder simpleItem(RegistryObject item, String location, String renderType) { return withExistingParent(item.getId().getPath(), new ResourceLocation("item/generated")) - .texture("layer0", new ResourceLocation(ModUtils.MODID, "item/" + location + item.getId().getPath())).renderType(renderType); + .texture("layer0", ModUtils.loc("item/" + location + item.getId().getPath())).renderType(renderType); } public void evenSimplerBlockItem(RegistryObject block) { @@ -153,7 +153,7 @@ public class ModItemModelProvider extends ItemModelProvider { private ItemModelBuilder blueprintItem(RegistryObject item) { return withExistingParent(item.getId().getPath(), new ResourceLocation("item/generated")) - .texture("layer0", new ResourceLocation(ModUtils.MODID, "item/gun_blueprint")); + .texture("layer0", ModUtils.loc("item/gun_blueprint")); } } diff --git a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java index cd0aacd51..d2586ce0d 100644 --- a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java @@ -18,7 +18,6 @@ import net.minecraft.client.CameraType; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.player.LocalPlayer; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; @@ -282,7 +281,7 @@ public class ClientEventHandler { if (drone != null && stack.getOrCreateTag().getBoolean("Using")) { if (Minecraft.getInstance().gameRenderer.currentEffect() == null) { - Minecraft.getInstance().gameRenderer.loadEffect(new ResourceLocation(ModUtils.MODID, "shaders/post/scan_pincushion.json")); + Minecraft.getInstance().gameRenderer.loadEffect(ModUtils.loc("shaders/post/scan_pincushion.json")); } } }