From 4f0b2b83710dfadc5ae4640c2e0dc3fe18a4ae18 Mon Sep 17 00:00:00 2001 From: Syl Date: Wed, 6 May 2020 17:50:50 -0500 Subject: [PATCH 1/4] Update to latest 1.12.2 mappings and increment version number --- build.gradle | 6 +++--- src/main/java/boni/dummy/ItemDummy.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index a7a8036..52b4cbd 100644 --- a/build.gradle +++ b/build.gradle @@ -14,14 +14,14 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.12-1.14" +version = "1.12-1.14.1" group= "boni" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "MmmMmmMmmMmm" minecraft { - version = "1.12.2-14.23.0.2512" + version = "1.12.2-14.23.5.2847" runDir = "run" - mappings = "snapshot_20171010" + mappings = "stable_39" } dependencies { diff --git a/src/main/java/boni/dummy/ItemDummy.java b/src/main/java/boni/dummy/ItemDummy.java index 42216ba..67e45fb 100644 --- a/src/main/java/boni/dummy/ItemDummy.java +++ b/src/main/java/boni/dummy/ItemDummy.java @@ -13,7 +13,7 @@ public class ItemDummy extends Item { public ItemDummy() { - this.setUnlocalizedName("dummy"); + this.setTranslationKey("dummy"); this.setRegistryName("dummy"); this.setCreativeTab(CreativeTabs.COMBAT); } From 0a371057869dd00613380338f960bc6479618782 Mon Sep 17 00:00:00 2001 From: Syl Date: Wed, 6 May 2020 17:53:44 -0500 Subject: [PATCH 2/4] Use actual damage numbers rather than halved numbers Previously, the numbers represented a heart. So 1 heart = 1 damage. However, Minecraft's health actually works as 1 health = 1 half heart. This change makes it so that every damage number is accurate to Miencraft's health system. So, 1 damage = 1 half heart. --- src/main/java/boni/dummy/client/RenderFloatingNumber.java | 2 +- src/main/java/boni/dummy/network/DamageMessage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/boni/dummy/client/RenderFloatingNumber.java b/src/main/java/boni/dummy/client/RenderFloatingNumber.java index 523abf9..5d0b632 100644 --- a/src/main/java/boni/dummy/client/RenderFloatingNumber.java +++ b/src/main/java/boni/dummy/client/RenderFloatingNumber.java @@ -56,7 +56,7 @@ public void doRender(EntityFloatingNumber entity, double x, double y, double z, GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); // draw it - String s = df.format(entity.damage / 2f); + String s = df.format(entity.damage); if(dps) { s = "DPS: " + s; } diff --git a/src/main/java/boni/dummy/network/DamageMessage.java b/src/main/java/boni/dummy/network/DamageMessage.java index 1216b46..b2ccfd7 100644 --- a/src/main/java/boni/dummy/network/DamageMessage.java +++ b/src/main/java/boni/dummy/network/DamageMessage.java @@ -55,7 +55,7 @@ public void run() { if(entity != null && entity instanceof EntityDummy) { EntityDummy dummy = (EntityDummy) entity; dummy.shake = message.shakeAmount; - dummy.setCustomNameTag(String.valueOf(message.damage / 2f)); + dummy.setCustomNameTag(String.valueOf(message.damage)); } if(message.nrID > 0) { entity = Minecraft.getMinecraft().world.getEntityByID(message.nrID); From f7a7a30cb70393dd20e645df1520e97ffc07a822 Mon Sep 17 00:00:00 2001 From: Syl Date: Wed, 6 May 2020 19:54:59 -0500 Subject: [PATCH 3/4] Update language files to fix The One Probe/WAILA Display --- src/main/resources/assets/testdummy/lang/en_US.lang | 3 ++- src/main/resources/assets/testdummy/lang/zh_CN.lang | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/assets/testdummy/lang/en_US.lang b/src/main/resources/assets/testdummy/lang/en_US.lang index 06f8af4..ce5b606 100644 --- a/src/main/resources/assets/testdummy/lang/en_US.lang +++ b/src/main/resources/assets/testdummy/lang/en_US.lang @@ -1,2 +1,3 @@ item.dummy.name=Test Dummy -tile.dummy.name=Test Dummy \ No newline at end of file +tile.dummy.name=Test Dummy +entity.Dummy.name=Test Dummy \ No newline at end of file diff --git a/src/main/resources/assets/testdummy/lang/zh_CN.lang b/src/main/resources/assets/testdummy/lang/zh_CN.lang index 3beec97..4e9a442 100644 --- a/src/main/resources/assets/testdummy/lang/zh_CN.lang +++ b/src/main/resources/assets/testdummy/lang/zh_CN.lang @@ -1,2 +1,3 @@ item.dummy.name=试验假人 tile.dummy.name=试验假人 +entity.Dummy.name=试验假人 From c21a0e063740f2a100cc58890f12170f8e6b1800 Mon Sep 17 00:00:00 2001 From: Syl Date: Thu, 7 May 2020 01:42:36 -0500 Subject: [PATCH 4/4] Add decimal formatting to name --- src/main/java/boni/dummy/network/DamageMessage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/boni/dummy/network/DamageMessage.java b/src/main/java/boni/dummy/network/DamageMessage.java index b2ccfd7..6839519 100644 --- a/src/main/java/boni/dummy/network/DamageMessage.java +++ b/src/main/java/boni/dummy/network/DamageMessage.java @@ -7,6 +7,8 @@ import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import java.text.DecimalFormat; + import boni.dummy.EntityDummy; import boni.dummy.EntityFloatingNumber; import io.netty.buffer.ByteBuf; @@ -46,6 +48,8 @@ public void toBytes(ByteBuf buf) { public static class MessageHandlerClient implements IMessageHandler { + private static DecimalFormat df = new DecimalFormat("#.##"); + @Override public DamageMessage onMessage(final DamageMessage message, MessageContext ctx) { FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(new Runnable() { @@ -55,7 +59,7 @@ public void run() { if(entity != null && entity instanceof EntityDummy) { EntityDummy dummy = (EntityDummy) entity; dummy.shake = message.shakeAmount; - dummy.setCustomNameTag(String.valueOf(message.damage)); + dummy.setCustomNameTag(String.valueOf(df.format(message.damage))); } if(message.nrID > 0) { entity = Minecraft.getMinecraft().world.getEntityByID(message.nrID);