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); } 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..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 / 2f)); + dummy.setCustomNameTag(String.valueOf(df.format(message.damage))); } if(message.nrID > 0) { entity = Minecraft.getMinecraft().world.getEntityByID(message.nrID); 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=试验假人