From b716bdd6e6da397301b84fb4a7fc6fca145b690e Mon Sep 17 00:00:00 2001 From: DaPorkchop_ Date: Sat, 20 Feb 2021 17:48:10 +0100 Subject: [PATCH] update TerraConstants.VERSION based on mcmod.info --- .../terraplusplus/TerraConfig.java | 8 ++--- .../terraplusplus/TerraConstants.java | 10 +++---- .../buildtheearth/terraplusplus/TerraMod.java | 29 +++++++------------ .../terraplusplus/control/EarthGui.java | 22 +++++++------- .../terraplusplus/control/TerraTeleport.java | 12 +++----- .../fragments/terra/TerraConvertFragment.java | 4 +-- .../terra/TerraDistortionFragment.java | 8 ++--- .../fragments/terra/TerraInfoFragment.java | 4 +-- .../fragments/terra/TerraWhereFragment.java | 10 +++---- .../fragments/terra/TerraWorldFragment.java | 6 ++-- .../provider/GenerationEventDenier.java | 4 +-- .../terraplusplus/util/CardinalDirection.java | 2 +- .../terraplusplus/util/ChatUtil.java | 6 ++-- .../terraplusplus/util/http/HostManager.java | 4 +-- 14 files changed, 58 insertions(+), 71 deletions(-) diff --git a/src/main/java/net/buildtheearth/terraplusplus/TerraConfig.java b/src/main/java/net/buildtheearth/terraplusplus/TerraConfig.java index 15fe3528..cecb217a 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/TerraConfig.java +++ b/src/main/java/net/buildtheearth/terraplusplus/TerraConfig.java @@ -9,8 +9,8 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -@Mod.EventBusSubscriber(modid = TerraMod.MODID) -@Config(modid = TerraMod.MODID) +@Mod.EventBusSubscriber(modid = TerraConstants.MODID) +@Config(modid = TerraConstants.MODID) public class TerraConfig { @Name("reduced_console_messages") @Comment({ "Removes all of TerraPlusPlus' messages which contain various links in the server console", @@ -36,8 +36,8 @@ public class TerraConfig { @SubscribeEvent public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { - if (TerraMod.MODID.equals(event.getModID())) { - ConfigManager.sync(TerraMod.MODID, Config.Type.INSTANCE); + if (TerraConstants.MODID.equals(event.getModID())) { + ConfigManager.sync(TerraConstants.MODID, Config.Type.INSTANCE); Http.configChanged(); } } diff --git a/src/main/java/net/buildtheearth/terraplusplus/TerraConstants.java b/src/main/java/net/buildtheearth/terraplusplus/TerraConstants.java index c58d19ee..e56e9ac2 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/TerraConstants.java +++ b/src/main/java/net/buildtheearth/terraplusplus/TerraConstants.java @@ -9,12 +9,12 @@ import net.minecraft.block.state.IBlockState; public class TerraConstants { - public static final String CHAT_PREFIX = "&2&lT++ &8&l> "; - public static final String MOD_ID = "terraplusplus"; - public static final String VERSION = "1.0"; + public static final String MODID = "terraplusplus"; + public static String VERSION = "(development snapshot)"; - public static final String defaultCommandNode = MOD_ID + ".command."; - public static final String controlCommandNode = MOD_ID + ".commands."; + public static final String CHAT_PREFIX = "&2&lT++ &8&l> "; + public static final String defaultCommandNode = MODID + ".command."; + public static final String controlCommandNode = MODID + ".commands."; public static final String othersCommandNode = controlCommandNode + "others"; public static final Gson GSON = new GsonBuilder() diff --git a/src/main/java/net/buildtheearth/terraplusplus/TerraMod.java b/src/main/java/net/buildtheearth/terraplusplus/TerraMod.java index d7451e8c..ee8d4f2c 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/TerraMod.java +++ b/src/main/java/net/buildtheearth/terraplusplus/TerraMod.java @@ -2,14 +2,14 @@ import net.buildtheearth.terraplusplus.control.TerraCommand; import net.buildtheearth.terraplusplus.control.TerraTeleport; -import net.buildtheearth.terraplusplus.provider.EarthWorldProvider; import net.buildtheearth.terraplusplus.provider.GenerationEventDenier; import net.buildtheearth.terraplusplus.provider.WaterDenier; -import net.minecraft.world.DimensionType; -import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.ModContainer; +import net.minecraftforge.fml.common.event.FMLConstructionEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @@ -22,24 +22,19 @@ import org.apache.logging.log4j.simple.SimpleLogger; import org.apache.logging.log4j.util.PropertiesUtil; -@Mod(modid = TerraMod.MODID, +@Mod(modid = TerraConstants.MODID, dependencies = "required-after:cubicchunks; required-after:cubicgen", acceptableRemoteVersions = "*", useMetadata = true) public class TerraMod { - public static final String MODID = TerraConstants.MOD_ID; - public static final String VERSION = "0.1"; - public static final String USERAGENT = TerraMod.MODID + '/' + TerraMod.VERSION; - public static final boolean CUSTOM_PROVIDER = false; //could potentially interfere with other mods and is relatively untested, leaving off for now - public static Logger LOGGER = new SimpleLogger("[terra++ bootstrap]", Level.INFO, true, false, true, false, "[yyyy/MM/dd HH:mm:ss:SSS]", null, new PropertiesUtil("log4j2.simplelog.properties"), System.out); - //set custom provider - private static void setupProvider() { - DimensionType type = DimensionType.register("earth", "_earth", 0, EarthWorldProvider.class, true); - DimensionManager.init(); - DimensionManager.unregisterDimension(0); - DimensionManager.registerDimension(0, type); + @EventHandler + public void construction(FMLConstructionEvent event) { + ModContainer terra = Loader.instance().getIndexedModList().get(TerraConstants.MODID); + if (!"${version}".equals(terra.getVersion())) { + TerraConstants.VERSION = terra.getVersion(); + } } @EventHandler @@ -52,10 +47,6 @@ public void preInit(FMLPreInitializationEvent event) { if (Side.CLIENT == event.getSide()) { BTEWorldType.create(); } - - if (CUSTOM_PROVIDER) { - setupProvider(); - } } @EventHandler diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/EarthGui.java b/src/main/java/net/buildtheearth/terraplusplus/control/EarthGui.java index 938e20cb..524b0aa8 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/EarthGui.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/EarthGui.java @@ -1,7 +1,7 @@ package net.buildtheearth.terraplusplus.control; import io.github.opencubicchunks.cubicchunks.cubicgen.customcubic.CustomCubicWorldType; -import net.buildtheearth.terraplusplus.TerraMod; +import net.buildtheearth.terraplusplus.TerraConstants; import net.buildtheearth.terraplusplus.config.GlobalParseRegistries; import net.buildtheearth.terraplusplus.generator.EarthGeneratorSettings; import net.buildtheearth.terraplusplus.projection.GeographicProjection; @@ -202,7 +202,7 @@ protected GuiTextField addTextField(int x, int y, int width, int height) { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.format(TerraMod.MODID + ".gui.header"), this.width >> 1, VERTICAL_PADDING >> 1, 0xFFFFFFFF); + this.drawCenteredString(this.fontRenderer, I18n.format(TerraConstants.MODID + ".gui.header"), this.width >> 1, VERTICAL_PADDING >> 1, 0xFFFFFFFF); //render map texture GlStateManager.bindTexture(this.texture.getGlTextureId()); @@ -285,7 +285,7 @@ protected static class ProjectionEntry implements Entry { protected int height = 30; public ProjectionEntry(EarthGeneratorSettings settings, EarthGui gui, int x, int y, int width) { - gui.addButton(new GuiButton(0, x + (width >> 1), y, width >> 1, 20, I18n.format(TerraMod.MODID + ".gui.transformation.add")) { + gui.addButton(new GuiButton(0, x + (width >> 1), y, width >> 1, 20, I18n.format(TerraConstants.MODID + ".gui.transformation.add")) { @Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { @@ -315,7 +315,7 @@ public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { @Override public void render(EarthGui gui, int x, int y, int width) { - gui.fontRenderer.drawString(I18n.format(TerraMod.MODID + ".gui.projection"), x, y + (20 - 8) / 2, 0xFFFFFFFF, true); + gui.fontRenderer.drawString(I18n.format(TerraConstants.MODID + ".gui.projection"), x, y + (20 - 8) / 2, 0xFFFFFFFF, true); y += 30; @@ -341,7 +341,7 @@ protected enum Transformation { offset { @Override protected TransformEntry newSubEntry(ProjectionEntry entry, EarthGui gui, int x, int y, int width) { - return new ParameterizedTransformEntry(this, entry, gui, x, y, width, TerraMod.MODID + ".gui.transformation.offset", "dx", "dy") { + return new ParameterizedTransformEntry(this, entry, gui, x, y, width, TerraConstants.MODID + ".gui.transformation.offset", "dx", "dy") { @Override public void initFrom(ProjectionTransform in) { if (in instanceof OffsetProjectionTransform) { @@ -364,7 +364,7 @@ protected void appendValue(StringBuilder out, int i) { scale { @Override protected TransformEntry newSubEntry(ProjectionEntry entry, EarthGui gui, int x, int y, int width) { - return new ParameterizedTransformEntry(this, entry, gui, x, y, width, TerraMod.MODID + ".gui.transformation.scale", "x", "y") { + return new ParameterizedTransformEntry(this, entry, gui, x, y, width, TerraConstants.MODID + ".gui.transformation.scale", "x", "y") { @Override public void initFrom(ProjectionTransform in) { if (in instanceof ScaleProjectionTransform) { @@ -447,7 +447,7 @@ public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { } }); - gui.addButton(new GuiButton(0, x + 60, y, width - 60, 20, I18n.format(TerraMod.MODID + ".gui.transformation." + transformation.name())) { + gui.addButton(new GuiButton(0, x + 60, y, width - 60, 20, I18n.format(TerraConstants.MODID + ".gui.transformation." + transformation.name())) { @Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { @@ -545,7 +545,7 @@ public RootEntry(GeographicProjection projection, EarthGui gui, int x, int y, in String projectionName = GlobalParseRegistries.PROJECTIONS.inverse().get(projection.getClass()); this.initialIndex = this.index = PArrays.indexOf(PROJECTION_NAMES, projectionName); - gui.addButton(new GuiButton(0, x, y, width, 20, I18n.format(this.fieldName = TerraMod.MODID + ".gui.projection." + projectionName)) { + gui.addButton(new GuiButton(0, x, y, width, 20, I18n.format(this.fieldName = TerraConstants.MODID + ".gui.projection." + projectionName)) { @Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { @@ -622,7 +622,7 @@ public ToggleEntry(EarthGui gui, int x, int y, int width, boolean value, String this.touch = touch; this.value = value; - gui.addButton(new GuiButton(0, x, y, width, 20, I18n.format(TerraMod.MODID + ".gui." + name) + ": " + I18n.format("options." + (value ? "on" : "off"))) { + gui.addButton(new GuiButton(0, x, y, width, 20, I18n.format(TerraConstants.MODID + ".gui." + name) + ": " + I18n.format("options." + (value ? "on" : "off"))) { @Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if (super.mousePressed(mc, mouseX, mouseY)) { @@ -655,7 +655,7 @@ protected static class CWGEntry implements Entry { protected String text; public CWGEntry(EarthGeneratorSettings settings, EarthGui gui, int x, int y, int width) { - int text = gui.fontRenderer.getStringWidth(I18n.format(TerraMod.MODID + ".gui.cwg")) + 5; + int text = gui.fontRenderer.getStringWidth(I18n.format(TerraConstants.MODID + ".gui.cwg")) + 5; x += text; width -= text; @@ -698,7 +698,7 @@ public int height() { @Override public void render(EarthGui gui, int x, int y, int width) { - gui.fontRenderer.drawString(I18n.format(TerraMod.MODID + ".gui.cwg"), x, y + (20 - 8) / 2, 0xFFFFFFFF, true); + gui.fontRenderer.drawString(I18n.format(TerraConstants.MODID + ".gui.cwg"), x, y + (20 - 8) / 2, 0xFFFFFFFF, true); } @Override diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/TerraTeleport.java b/src/main/java/net/buildtheearth/terraplusplus/control/TerraTeleport.java index 82fc8216..cf73aa07 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/TerraTeleport.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/TerraTeleport.java @@ -3,9 +3,7 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collections; -import java.util.ConcurrentModificationException; import java.util.List; -import java.util.Locale; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; @@ -23,7 +21,6 @@ import net.buildtheearth.terraplusplus.util.geo.LatLng; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; @@ -31,7 +28,6 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.server.permission.PermissionAPI; public class TerraTeleport extends Command { @@ -66,13 +62,13 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args IChunkProvider cp = world.getChunkProvider(); if (!(cp instanceof CubeProviderServer)) { - throw new CommandException(TerraConstants.MOD_ID + ".error.notcc"); + throw new CommandException(TerraConstants.MODID + ".error.notcc"); } ICubeGenerator gen = ((CubeProviderServer) cp).getCubeGenerator(); if (!(gen instanceof EarthGenerator)) { - throw new CommandException(TerraConstants.MOD_ID + ".error.notterra"); + throw new CommandException(TerraConstants.MODID + ".error.notterra"); } EarthGenerator terrain = (EarthGenerator) gen; @@ -135,7 +131,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args try { proj = terrain.projection.fromGeo(defaultCoords.getLng(), defaultCoords.getLat()); } catch (Exception e) { - sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.numbers"))); + sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.numbers"))); return; } @@ -147,7 +143,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args .getAsync(defaultCoords.getLng(), defaultCoords.getLat()) .thenApply(a -> a + 1.0d); } catch (OutOfProjectionBoundsException e) { //out of bounds, notify user - sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.numbers"))); + sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.numbers"))); return; } } else { diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraConvertFragment.java b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraConvertFragment.java index e34db792..82f3b5b7 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraConvertFragment.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraConvertFragment.java @@ -47,7 +47,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args x = Double.parseDouble(args[0]); y = Double.parseDouble(args[1]); } catch (Exception e) { - sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.numbers"))); + sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.numbers"))); return; } @@ -80,7 +80,7 @@ public String[] getName() { @Override public String getPurpose() { - return TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.convert.purpose").getUnformattedComponentText(); + return TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.convert.purpose").getUnformattedComponentText(); } @Override diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraDistortionFragment.java b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraDistortionFragment.java index d74a737b..4807adcb 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraDistortionFragment.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraDistortionFragment.java @@ -45,11 +45,11 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args } if(c == null || Double.isNaN(c[0])) { - sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.where.notproj"))); + sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.where.notproj"))); return; } sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.GRAY, "Distortion:")); - sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.format(TerraConstants.MOD_ID + ".commands.terra.tissot", Math.sqrt(Math.abs(c[0])), c[1] * 180.0 / Math.PI))); + sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.format(TerraConstants.MODID + ".commands.terra.tissot", Math.sqrt(Math.abs(c[0])), c[1] * 180.0 / Math.PI))); } @Override @@ -59,7 +59,7 @@ public String[] getName() { @Override public String getPurpose() { - return TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.distortion.purpose").getUnformattedComponentText(); + return TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.distortion.purpose").getUnformattedComponentText(); } @Override @@ -69,6 +69,6 @@ public String[] getArguments() { @Override public String getPermission() { - return TerraConstants.MOD_ID + ".commands.terra"; + return TerraConstants.MODID + ".commands.terra"; } } diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraInfoFragment.java b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraInfoFragment.java index 9fde1cc8..6cd97017 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraInfoFragment.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraInfoFragment.java @@ -24,7 +24,7 @@ public String[] getName() { @Override public String getPurpose() { - return TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.info.purpose").getUnformattedComponentText(); + return TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.info.purpose").getUnformattedComponentText(); } @Override @@ -34,6 +34,6 @@ public String[] getArguments() { @Override public String getPermission() { - return TerraConstants.MOD_ID + ".commands.terra"; + return TerraConstants.MODID + ".commands.terra"; } } diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWhereFragment.java b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWhereFragment.java index afd17501..247da993 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWhereFragment.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWhereFragment.java @@ -53,7 +53,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args if (args.length > 0) { if(hasPermission(sender, TerraConstants.othersCommandNode)) e = sender.getEntityWorld().getPlayerEntityByName(args[0]); if (e == null) { - sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.unknownplayer"))); + sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.unknownplayer"))); return; } @@ -77,11 +77,11 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args } sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.GRAY, "Location of ", TextFormatting.BLUE, senderName)); if (result == null || Double.isNaN(result[0])) { - sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.where.notproj"))); + sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.where.notproj"))); return; } if (!Float.isFinite(azimuth)) { - sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.where.notproj"))); + sender.sendMessage(ChatUtil.combine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.where.notproj"))); return; } @@ -103,7 +103,7 @@ public String[] getName() { @Override public String getPurpose() { - return TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.where.purpose").getUnformattedComponentText(); + return TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.where.purpose").getUnformattedComponentText(); } @Override @@ -113,6 +113,6 @@ public String[] getArguments() { @Override public String getPermission() { - return TerraConstants.MOD_ID + ".commands.terra"; + return TerraConstants.MODID + ".commands.terra"; } } diff --git a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWorldFragment.java b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWorldFragment.java index e890edcd..6d7d0d96 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWorldFragment.java +++ b/src/main/java/net/buildtheearth/terraplusplus/control/fragments/terra/TerraWorldFragment.java @@ -19,7 +19,7 @@ public class TerraWorldFragment extends CommandFragment { @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) { - sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.world.header"))); + sender.sendMessage(ChatUtil.titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.world.header"))); World world = sender.getEntityWorld(); IChunkProvider cp = world.getChunkProvider(); @@ -53,7 +53,7 @@ public String[] getName() { @Override public String getPurpose() { - return TranslateUtil.translate(TerraConstants.MOD_ID + ".fragment.terra.world.purpose").getUnformattedComponentText(); + return TranslateUtil.translate(TerraConstants.MODID + ".fragment.terra.world.purpose").getUnformattedComponentText(); } @Override @@ -63,7 +63,7 @@ public String[] getArguments() { @Override public String getPermission() { - return TerraConstants.MOD_ID + ".commands.terra"; + return TerraConstants.MODID + ".commands.terra"; } private ITextComponent boolComponent(String name, boolean value) { diff --git a/src/main/java/net/buildtheearth/terraplusplus/provider/GenerationEventDenier.java b/src/main/java/net/buildtheearth/terraplusplus/provider/GenerationEventDenier.java index 8089dcbb..e5d4dde0 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/provider/GenerationEventDenier.java +++ b/src/main/java/net/buildtheearth/terraplusplus/provider/GenerationEventDenier.java @@ -2,7 +2,7 @@ import io.github.opencubicchunks.cubicchunks.api.worldgen.populator.event.DecorateCubeBiomeEvent; import io.github.opencubicchunks.cubicchunks.api.worldgen.populator.event.PopulateCubeEvent; -import net.buildtheearth.terraplusplus.TerraMod; +import net.buildtheearth.terraplusplus.TerraConstants; import net.buildtheearth.terraplusplus.generator.EarthBiomeProvider; import net.buildtheearth.terraplusplus.generator.EarthGenerator; import lombok.experimental.UtilityClass; @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; //deny default tree and snow event because we have some of those already -@Mod.EventBusSubscriber(modid = TerraMod.MODID) +@Mod.EventBusSubscriber(modid = TerraConstants.MODID) @UtilityClass public class GenerationEventDenier { @SubscribeEvent diff --git a/src/main/java/net/buildtheearth/terraplusplus/util/CardinalDirection.java b/src/main/java/net/buildtheearth/terraplusplus/util/CardinalDirection.java index d2b480ed..4910838a 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/util/CardinalDirection.java +++ b/src/main/java/net/buildtheearth/terraplusplus/util/CardinalDirection.java @@ -19,7 +19,7 @@ public enum CardinalDirection { this.min = min; this.max = max; this.realName = realName; - this.translationKey = TerraConstants.MOD_ID + ".cardinal_directions." + this.name().toLowerCase(); + this.translationKey = TerraConstants.MODID + ".cardinal_directions." + this.name().toLowerCase(); } /** diff --git a/src/main/java/net/buildtheearth/terraplusplus/util/ChatUtil.java b/src/main/java/net/buildtheearth/terraplusplus/util/ChatUtil.java index e0c5c3cb..d1d5f3fb 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/util/ChatUtil.java +++ b/src/main/java/net/buildtheearth/terraplusplus/util/ChatUtil.java @@ -54,11 +54,11 @@ public static ITextComponent combine(boolean title, Object... objects) { } public static ITextComponent getNotCC() { - return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.notcc")); + return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.notcc")); } public static ITextComponent getNotTerra() { - return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.noterra")); + return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.noterra")); } public static ITextComponent getNoPermission() { @@ -66,6 +66,6 @@ public static ITextComponent getNoPermission() { } public static ITextComponent getPlayerOnly() { - return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MOD_ID + ".error.playeronly")); + return titleAndCombine(TextFormatting.RED, TranslateUtil.translate(TerraConstants.MODID + ".error.playeronly")); } } diff --git a/src/main/java/net/buildtheearth/terraplusplus/util/http/HostManager.java b/src/main/java/net/buildtheearth/terraplusplus/util/http/HostManager.java index fb6811a4..cc073bd8 100644 --- a/src/main/java/net/buildtheearth/terraplusplus/util/http/HostManager.java +++ b/src/main/java/net/buildtheearth/terraplusplus/util/http/HostManager.java @@ -1,6 +1,6 @@ package net.buildtheearth.terraplusplus.util.http; -import net.buildtheearth.terraplusplus.TerraMod; +import net.buildtheearth.terraplusplus.TerraConstants; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; @@ -222,7 +222,7 @@ public HttpRequest toNetty() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, this.path); request.headers() .set(HttpHeaderNames.HOST, HostManager.this.authority) - .set(HttpHeaderNames.USER_AGENT, TerraMod.USERAGENT); + .set(HttpHeaderNames.USER_AGENT, TerraConstants.MODID + '/' + TerraConstants.VERSION); HttpUtil.setKeepAlive(request, true); return request; }