]> git.seodisparate.com - TurnBasedMinecraftMod/commitdiff
TBM 1.18.2: show team color in attack menu button 1.18.2
authorStephen Seo <seo.disparate@gmail.com>
Wed, 8 Jun 2022 02:59:34 +0000 (11:59 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 8 Jun 2022 02:59:34 +0000 (11:59 +0900)
If a Player is in a team that has a specific team color, that Player's name will
be displayed with that color in the list of targets when selecting a target to
attack in the Battle GUI.

build.gradle
src/main/java/com/burnedkirby/TurnBasedMinecraft/client/BattleGui.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/client/EntitySelectionButton.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/TurnBasedMinecraftMod.java
src/main/resources/META-INF/mods.toml
src/main/resources/mcmod.info

index 0cf856e9a9772ab535c3a6a85be3255b2ba7f6e0..f0ed234af4b8129ef6b78a68d3b5bf8f060f4d34 100644 (file)
@@ -14,7 +14,7 @@ apply plugin: 'net.minecraftforge.gradle'
 //apply plugin: 'eclipse'
 //apply plugin: 'maven-publish'
 
-version = "1.18.1"
+version = "1.18.2"
 group = "com.burnedkirby.TurnBasedMinecraft"
 archivesBaseName = "TurnBasedMinecraft"
 
index 22d1c87df44488364cddf6754c91ae64e355cb05..66fe08efe5ff50bb72e996f27af3a0b49e64873d 100644 (file)
@@ -143,7 +143,7 @@ public class BattleGui extends Screen {
                                for (Map.Entry<Integer, Combatant> e : TurnBasedMinecraftMod.proxy.getLocalBattle()
                                                .getSideAEntrySet()) {
                                        if (e.getValue().entity != null) {
-                                               addRenderableWidget(new EntitySelectionButton(width / 4 - 60, y, 120, 20, e.getValue().entity.getName().getString(), e.getKey(), true, (button) -> {
+                                               addRenderableWidget(new EntitySelectionButton(width / 4 - 60, y, 120, 20, e.getValue().entity.getDisplayName(), e.getKey(), true, (button) -> {
                                                        buttonActionEvent(button, ButtonAction.ATTACK_TARGET);
                                                }));
                                        } else {
@@ -161,7 +161,7 @@ public class BattleGui extends Screen {
                                for (Map.Entry<Integer, Combatant> e : TurnBasedMinecraftMod.proxy.getLocalBattle()
                                                .getSideBEntrySet()) {
                                        if (e.getValue().entity != null) {
-                                               addRenderableWidget(new EntitySelectionButton(width * 3 / 4 - 60, y, 120, 20, e.getValue().entity.getName().getString(), e.getKey(), false, (button) -> {
+                                               addRenderableWidget(new EntitySelectionButton(width * 3 / 4 - 60, y, 120, 20, e.getValue().entity.getDisplayName(), e.getKey(), false, (button) -> {
                                                        buttonActionEvent(button, ButtonAction.ATTACK_TARGET);
                                                }));
                                        } else {
index 59cd7296446bf65b7402c310d22e49811f4b7546..bb424a5482e47fa77e2062dcda70acd07801467a 100644 (file)
@@ -3,6 +3,7 @@ package com.burnedkirby.TurnBasedMinecraft.client;
 import com.mojang.blaze3d.vertex.PoseStack;
 import net.minecraft.client.Minecraft;
 import net.minecraft.client.gui.components.Button;
+import net.minecraft.network.chat.Component;
 import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.network.chat.TextComponent;
@@ -17,6 +18,12 @@ public class EntitySelectionButton extends Button {
         this.isSideA = isSideA;
     }
 
+    public EntitySelectionButton(int x, int y, int widthIn, int heightIn, Component buttonTextComponent, int entityID, boolean isSideA, Button.OnPress onPress) {
+        super(x, y, widthIn, heightIn, buttonTextComponent, onPress);
+        this.entityID = entityID;
+        this.isSideA = isSideA;
+    }
+
     public int getID() {
         return entityID;
     }
index 0627ecdb50e86b44c9015e1bd4f619338eb1901d..e5ca288ef13aed1da72203ee2cb8f0a249f7f5ce 100644 (file)
@@ -35,7 +35,7 @@ import org.apache.logging.log4j.Logger;
 public class TurnBasedMinecraftMod {
     public static final String MODID = "com_burnedkirby_turnbasedminecraft";
     public static final String NAME = "Turn Based Minecraft Mod";
-    public static final String VERSION = "1.18.1";
+    public static final String VERSION = "1.18.2";
     public static final String CONFIG_FILENAME = "TBM_Config.toml";
     public static final String DEFAULT_CONFIG_FILENAME = "TBM_Config_DEFAULT.toml";
     public static final String CONFIG_DIRECTORY = "config/TurnBasedMinecraft/";
index 211bdd63f2cceaf5cd403e219e7d4959d36c84b0..bee0cb9a8b6aeb9306e87c1ab6a875e247157ebb 100644 (file)
@@ -15,7 +15,7 @@ license="MIT"
 # The modid of the mod
 modId="com_burnedkirby_turnbasedminecraft" #mandatory
 # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
-version="1.18.1" #mandatory
+version="1.18.2" #mandatory
  # A display name for the mod
 displayName="TurnBasedMinecraftMod" #mandatory
 # A URL to query for updates for this mod. See the JSON update specification <here>
index da37474efc8c9d0e97602996773735e3dfa17bf1..82d7aed81f7c8a43e3563364168885ba77795caf 100644 (file)
@@ -3,7 +3,7 @@
   "modid": "com_burnedkirby_turnbasedminecraft",
   "name": "Turn Based Minecraft",
   "description": "Changes battles to be turn-based.",
-  "version": "1.18.1",
+  "version": "1.18.2",
   "mcversion": "1.18.2",
   "url": "",
   "updateUrl": "",