]> git.seodisparate.com - TurnBasedMinecraftMod/commitdiff
Version 1.22.0: to Forge 1.19.3-44.1.1 1.22.0
authorStephen Seo <seo.disparate@gmail.com>
Fri, 31 Mar 2023 05:22:58 +0000 (14:22 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 31 Mar 2023 05:22:58 +0000 (14:22 +0900)
14 files changed:
Changelog.md
README.md
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/client/ItemSelectionButton.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/client/TBMButtonPress.java [new file with mode: 0644]
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/AttackEventHandler.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/Battle.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/BattleManager.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/TurnBasedMinecraftMod.java
src/main/java/com/burnedkirby/TurnBasedMinecraft/common/Utility.java
src/main/resources/META-INF/mods.toml
src/main/resources/mcmod.info

index 356bcd5b78bae8f6f647bc8c386ec485a64180ec..c65c378c8887fe8a19c210385be6182f82f5ec02 100644 (file)
@@ -1,5 +1,9 @@
 # Upcoming changes
 
+# Version 1.22.0
+
+Update to Forge 1.19.3-44.1.1.
+
 # Version 1.21.4
 
 More refactoring of check-if-in-battle lookup code.
index 6425146808121f5bcac194c5a816dd3b68de0389..984acaea651ce09cdbc8adf60ca837d09f0cf9c5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,7 +58,7 @@ configured for them.)
 # Building
 
 Simply invoke `./gradlew build` in the mod directory and after some time the
-finished jar will be saved at "build/libs/TurnBasedMinecraft-1.21.4.jar"
+finished jar will be saved at "build/libs/TurnBasedMinecraft-1.22.0.jar"
 
 # Other notes
 
index 20135615d22c63b7c074de4fb3f898272de94f5e..7a9984e4bc0984589767cafa463042384400f67c 100644 (file)
@@ -14,7 +14,7 @@ apply plugin: 'net.minecraftforge.gradle'
 //apply plugin: 'eclipse'
 //apply plugin: 'maven-publish'
 
-version = "1.21.4"
+version = "1.22.0"
 group = "com.burnedkirby.TurnBasedMinecraft"
 archivesBaseName = "TurnBasedMinecraft"
 
@@ -27,7 +27,7 @@ minecraft {
     // stable_#            Stables are built at the discretion of the MCP team.
     // Use non-default mappings at your own risk. they may not always work.
     // Simply re-run your setup task after changing the mappings to update your workspace.
-    mappings channel: 'official', version: '1.19.2'
+    mappings channel: 'official', version: '1.19.3'
     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
 
     // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -151,7 +151,7 @@ dependencies {
     // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
     // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
-    minecraft 'net.minecraftforge:forge:1.19.2-43.1.1'
+    minecraft 'net.minecraftforge:forge:1.19.3-44.1.1'
 
     // Real mod deobf dependency examples - these get remapped to your current mappings
     // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
index deb8a6c1fba6cc0c9b32ae7234fb9eecdc4608b6..4be062a223030c5939645e0ad57280f5a83a6c8d 100644 (file)
@@ -7,6 +7,7 @@ import com.burnedkirby.TurnBasedMinecraft.common.TurnBasedMinecraftMod;
 import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketBattleDecision;
 import com.mojang.blaze3d.vertex.PoseStack;
 import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.components.AbstractButton;
 import net.minecraft.client.gui.components.Button;
 import net.minecraft.client.gui.screens.Screen;
 import net.minecraft.network.chat.Component;
@@ -127,18 +128,18 @@ public class BattleGui extends Screen {
                switch (state) {
                case MAIN_MENU:
                        info = "What will you do?";
-                       addRenderableWidget(new Button(width * 3 / 7 - 25, 40, 50, 20, Component.literal("Attack"), (button) -> {
+                       addRenderableWidget(Button.builder(Component.literal("Attack"), (button) -> {
                                buttonActionEvent(button, ButtonAction.ATTACK);
-                       }));
-                       addRenderableWidget(new Button(width * 4 / 7 - 25, 40, 50, 20, Component.literal("Defend"), (button) -> {
+                       }).bounds(width * 3 / 7 - 25, 40, 50, 20).build());
+                       addRenderableWidget(Button.builder(Component.literal("Defend"), (button) -> {
                                buttonActionEvent(button, ButtonAction.DEFEND);
-                       }));
-                       addRenderableWidget(new Button(width * 3 / 7 - 25, 60, 50, 20, Component.literal("Item"), (button) -> {
+                       }).bounds(width * 4 / 7 - 25, 40, 50, 20).build());
+                       addRenderableWidget(Button.builder(Component.literal("Item"), (button) -> {
                                buttonActionEvent(button, ButtonAction.ITEM);
-                       }));
-                       addRenderableWidget(new Button(width * 4 / 7 - 25, 60, 50, 20, Component.literal("Flee"), (button) -> {
+                       }).bounds(width * 3 / 7 - 25, 60, 50, 20).build());
+                       addRenderableWidget(Button.builder(Component.literal("Flee"), (button) -> {
                                buttonActionEvent(button, ButtonAction.FLEE);
-                       }));
+                       }).bounds(width * 4 / 7 - 25, 60, 50, 20).build());
                        break;
                case ATTACK_TARGET:
                        info = "Who will you attack?";
@@ -178,21 +179,21 @@ public class BattleGui extends Screen {
                        } catch (ConcurrentModificationException e) {
                                // ignored
                        }
-                       addRenderableWidget(new Button(width / 2 - 30, height - 120, 60, 20, Component.literal("Cancel"), (button) -> {
+                       addRenderableWidget(Button.builder(Component.literal("Cancel"), (button) -> {
                                buttonActionEvent(button, ButtonAction.CANCEL);
-                       }));
+                       }).bounds(width / 2 - 30, height - 120, 60, 20).build());
                        break;
                case ITEM_ACTION:
                        info = "What will you do with an item?";
-                       addRenderableWidget(new Button(width * 1 / 4 - 40, height - 120, 80, 20, Component.literal("Switch Held"), (button) -> {
+                       addRenderableWidget(Button.builder(Component.literal("Switch Held"), (button) -> {
                                buttonActionEvent(button, ButtonAction.SWITCH_HELD_ITEM);
-                       }));
-                       addRenderableWidget(new Button(width * 2 / 4 - 40, height - 120, 80, 20, Component.literal("Use"), (button) -> {
+                       }).bounds(width / 4 - 40, height - 120, 80, 20).build());
+                       addRenderableWidget(Button.builder(Component.literal("Use"), (button) -> {
                                buttonActionEvent(button, ButtonAction.DECIDE_USE_ITEM);
-                       }));
-                       addRenderableWidget(new Button(width * 3 / 4 - 40, height - 120, 80, 20, Component.literal("Cancel"), (button) -> {
+                       }).bounds(width * 2 / 4 - 40, height - 120, 80, 20).build());
+                       addRenderableWidget(Button.builder(Component.literal("Cancel"), (button) -> {
                                buttonActionEvent(button, ButtonAction.CANCEL);
-                       }));
+                       }).bounds(width * 3 / 4 - 40, height - 120, 80, 20).build());
                        break;
                case WAITING:
                        info = "Waiting...";
@@ -204,9 +205,9 @@ public class BattleGui extends Screen {
                                        buttonActionEvent(button, ButtonAction.DO_ITEM_SWITCH);
                                }));
                        }
-                       addRenderableWidget(new Button(width / 2 - 40, height - 120, 80, 20, Component.literal("Cancel"), (button) -> {
+                       addRenderableWidget(Button.builder(Component.literal("Cancel"), (button) -> {
                                buttonActionEvent(button, ButtonAction.CANCEL);
-                       }));
+                       }).bounds(width / 2 - 40, height - 120, 80, 20).build());
                        break;
                case USE_ITEM:
                        info = "Which item will you use?";
@@ -215,9 +216,9 @@ public class BattleGui extends Screen {
                                        buttonActionEvent(button, ButtonAction.DO_USE_ITEM);
                                }));
                        }
-                       addRenderableWidget(new Button(width / 2 - 40, height - 120, 80, 20, Component.literal("Cancel"), (button) -> {
+                       addRenderableWidget(Button.builder(Component.literal("Cancel"), (button) -> {
                                buttonActionEvent(button, ButtonAction.CANCEL);
-                       }));
+                       }).bounds(width / 2 - 40, height - 120, 80, 20).build());
                        break;
                }
        }
@@ -267,7 +268,7 @@ public class BattleGui extends Screen {
                drawString(poseStack, info, width / 2 - stringWidth / 2, 20, 0xFFFFFFFF);
        }
 
-       protected void buttonActionEvent(Button button, ButtonAction action) {
+       protected void buttonActionEvent(AbstractButton button, ButtonAction action) {
                switch (action) {
                case ATTACK:
                        setState(MenuState.ATTACK_TARGET);
index d35091624f05b5b21e549de88ce3291563596606..30a419c34f39edc8a0e129bf9f19b389024c0b2e 100644 (file)
@@ -1,24 +1,31 @@
 package com.burnedkirby.TurnBasedMinecraft.client;
 
+import com.burnedkirby.TurnBasedMinecraft.common.CommonProxy;
+import com.burnedkirby.TurnBasedMinecraft.common.TurnBasedMinecraftMod;
 import com.mojang.blaze3d.vertex.PoseStack;
 import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.components.Button;
+import net.minecraft.client.gui.components.AbstractButton;
+import net.minecraft.client.gui.narration.NarratedElementType;
+import net.minecraft.client.gui.narration.NarrationElementOutput;
 import net.minecraft.network.chat.Component;
 import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.LivingEntity;
 
-public class EntitySelectionButton extends Button {
+public class EntitySelectionButton extends AbstractButton {
+    TBMButtonPress onPress;
     private int entityID;
     private boolean isSideA;
 
-    public EntitySelectionButton(int x, int y, int widthIn, int heightIn, String buttonText, int entityID, boolean isSideA, Button.OnPress onPress) {
-        super(x, y, widthIn, heightIn, Component.literal(buttonText), onPress);
+    public EntitySelectionButton(int x, int y, int widthIn, int heightIn, String buttonText, int entityID, boolean isSideA, TBMButtonPress onPress) {
+        super(x, y, widthIn, heightIn, Component.literal(buttonText));
+        this.onPress = onPress;
         this.entityID = entityID;
         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);
+    public EntitySelectionButton(int x, int y, int widthIn, int heightIn, Component buttonTextComponent, int entityID, boolean isSideA, TBMButtonPress onPress) {
+        super(x, y, widthIn, heightIn, buttonTextComponent);
+        this.onPress = onPress;
         this.entityID = entityID;
         this.isSideA = isSideA;
     }
@@ -83,11 +90,13 @@ public class EntitySelectionButton extends Button {
         }
     }
 
-    private int getX() {
-        return x;
+    @Override
+    protected void updateWidgetNarration(NarrationElementOutput p_259858_) {
+        p_259858_.add(NarratedElementType.HINT, TurnBasedMinecraftMod.proxy.getEntity(entityID, Minecraft.getInstance().level.dimension()).getName());
     }
 
-    private int getY() {
-        return y;
+    @Override
+    public void onPress() {
+        onPress.onPress(this);
     }
 }
index d9b17e1b0630afb6820151ce99baa54e744e3e27..10937b53fb5c35fd31427bb8fb08b148215e78f4 100644 (file)
@@ -1,14 +1,19 @@
 package com.burnedkirby.TurnBasedMinecraft.client;
 
 import com.mojang.blaze3d.vertex.PoseStack;
-import net.minecraft.client.gui.components.Button;
+import net.minecraft.client.gui.components.AbstractButton;
+import net.minecraft.client.gui.narration.NarratedElementType;
+import net.minecraft.client.gui.narration.NarrationElementOutput;
 import net.minecraft.network.chat.Component;
 
-public class ItemSelectionButton extends Button {
+public class ItemSelectionButton extends AbstractButton {
+
+    TBMButtonPress onPress;
     private int itemStackID;
 
-    public ItemSelectionButton(int x, int y, int widthIn, int heightIn, String buttonText, int itemStackID, Button.OnPress onPress) {
-        super(x, y, widthIn, heightIn, Component.literal(buttonText), onPress);
+    public ItemSelectionButton(int x, int y, int widthIn, int heightIn, String buttonText, int itemStackID, TBMButtonPress onPress) {
+        super(x, y, widthIn, heightIn, Component.literal(buttonText));
+        this.onPress = onPress;
         this.itemStackID = itemStackID;
     }
 
@@ -28,11 +33,13 @@ public class ItemSelectionButton extends Button {
         }
     }
 
-    private int getX() {
-        return x;
+    @Override
+    protected void updateWidgetNarration(NarrationElementOutput p_259858_) {
+        p_259858_.add(NarratedElementType.HINT, "Item " + this.itemStackID);
     }
 
-    private int getY() {
-        return y;
+    @Override
+    public void onPress() {
+        onPress.onPress(this);
     }
 }
\ No newline at end of file
diff --git a/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/TBMButtonPress.java b/src/main/java/com/burnedkirby/TurnBasedMinecraft/client/TBMButtonPress.java
new file mode 100644 (file)
index 0000000..7c4cf2d
--- /dev/null
@@ -0,0 +1,7 @@
+package com.burnedkirby.TurnBasedMinecraft.client;
+
+import net.minecraft.client.gui.components.AbstractButton;
+
+public interface TBMButtonPress {
+    void onPress(AbstractButton button);
+}
index 59de6e092a0732842b387fa4117e22dce2218c78..016941fdd268a8cd2e1fedbeadaf0251efc20a6b 100644 (file)
@@ -9,7 +9,7 @@ import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketGeneralMessage
 import net.minecraft.world.entity.monster.Creeper;
 import net.minecraft.server.level.ServerPlayer;
 import net.minecraftforge.event.entity.living.LivingAttackEvent;
-import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
+import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
 import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.network.PacketDistributor;
 
@@ -146,23 +146,23 @@ public class AttackEventHandler
     }
     
     @SubscribeEvent
-    public void entityTargeted(LivingSetAttackTargetEvent event)
+    public void entityTargeted(LivingChangeTargetEvent event)
     {
         Config config = TurnBasedMinecraftMod.proxy.getConfig();
         BattleManager battleManager = TurnBasedMinecraftMod.proxy.getBattleManager();
         if(event.getEntity().level.isClientSide
                 || config.isOldBattleBehaviorEnabled()
                 || (event.getEntity() != null && battleManager.isRecentlyLeftBattle(event.getEntity().getId()))
-                || (event.getTarget() != null && battleManager.isRecentlyLeftBattle(event.getTarget().getId()))
-                || (event.getEntity() != null && event.getTarget() != null && Utility.distanceBetweenEntities(event.getEntity(), event.getTarget()) > (double)config.getAggroStartBattleDistance()))
+                || (event.getNewTarget() != null && battleManager.isRecentlyLeftBattle(event.getNewTarget().getId()))
+                || (event.getEntity() != null && event.getNewTarget() != null && Utility.distanceBetweenEntities(event.getEntity(), event.getNewTarget()) > (double)config.getAggroStartBattleDistance()))
         {
             return;
         }
         else if(event.getEntity() != null
-                && event.getTarget() != null
+                && event.getNewTarget() != null
                 && !config.getBattleIgnoringPlayers().contains(event.getEntity().getId())
-                && !config.getBattleIgnoringPlayers().contains(event.getTarget().getId())
-                && event.getEntity().level.dimension().equals(event.getTarget().level.dimension()))
+                && !config.getBattleIgnoringPlayers().contains(event.getNewTarget().getId())
+                && event.getEntity().level.dimension().equals(event.getNewTarget().level.dimension()))
         {
             TurnBasedMinecraftMod.proxy.getBattleManager().checkTargeted(event);
         }
index cde34afe60435e609d89016260d6c19ec05d9a3b..bea439dcbacd0574495faf8335a1487e8719d34e 100644 (file)
@@ -1071,7 +1071,7 @@ public class Battle {
                                 ((Player) nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level, (LivingEntity) nextEntity));
                             } else {
                                 // then check vanilla foods
-                                if (targetItem.getItemCategory() == CreativeModeTab.TAB_FOOD && targetItem.isEdible()) {
+                                if (CreativeModeTabs.FOOD_AND_DRINKS.contains(targetItemStack) && targetItem.isEdible()) {
                                     debugLog += " food";
                                     sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_FOOD.getValue(), targetItemStack.getDisplayName().getString());
                                     final Entity nextEntity = next.entity;
index 0b5f3c050d377cdfc7f799d78150ef449df4b752..76fd95bb3662ed21d027872911b25cd882f6c6ac 100644 (file)
@@ -9,7 +9,7 @@ import net.minecraft.world.entity.player.Player;
 import net.minecraft.world.level.Level;
 import net.minecraftforge.common.MinecraftForge;
 import net.minecraftforge.event.entity.living.LivingAttackEvent;
-import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
+import net.minecraftforge.event.entity.living.LivingChangeTargetEvent;
 import net.minecraftforge.network.PacketDistributor;
 import org.apache.logging.log4j.Logger;
 
@@ -179,17 +179,17 @@ public class BattleManager
         return true;
     }
     
-    public void checkTargeted(LivingSetAttackTargetEvent event)
+    public void checkTargeted(LivingChangeTargetEvent event)
     {
         // Check if "player_only_battles" is enabled and if both entities are players.
         if (TurnBasedMinecraftMod.proxy.getConfig().isPlayerOnlyBattlesEnabled() &&
-            (!(event.getEntity() instanceof Player) || !(event.getTarget() instanceof Player))) {
+            (!(event.getEntity() instanceof Player) || !(event.getNewTarget() instanceof Player))) {
             return;
         }
 
         String targetedCustomName;
         try {
-            targetedCustomName = event.getTarget().getCustomName().getString();
+            targetedCustomName = event.getNewTarget().getCustomName().getString();
         } catch (NullPointerException e) {
             targetedCustomName = null;
         }
@@ -207,7 +207,7 @@ public class BattleManager
         }
 
         EntityInfo targetedInfo;
-        if(event.getTarget() instanceof Player)
+        if(event.getNewTarget() instanceof Player)
         {
             targetedInfo = null;
         }
@@ -216,10 +216,10 @@ public class BattleManager
             targetedInfo = TurnBasedMinecraftMod.proxy.getConfig().getCustomEntityInfoReference(targetedCustomName);
             if(targetedInfo == null)
             {
-                targetedInfo = TurnBasedMinecraftMod.proxy.getConfig().getMatchingEntityInfo(event.getTarget());
+                targetedInfo = TurnBasedMinecraftMod.proxy.getConfig().getMatchingEntityInfo(event.getNewTarget());
             }
         }
-        if((event.getTarget() instanceof Player && ((Player)event.getTarget()).isCreative())
+        if((event.getNewTarget() instanceof Player && ((Player)event.getNewTarget()).isCreative())
                 || attackerInfo == null
                 || attackerInfo.ignoreBattle
                 || TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType(attackerInfo.category)
@@ -235,8 +235,8 @@ public class BattleManager
         if(attackerBattle != null && !attackerBattle.hasCombatant(event.getEntity().getId())) {
             attackerBattle = null;
         }
-        Battle defenderBattle = battleMap.get(entityToBattleMap.get(new EntityIDDimPair(event.getTarget())));
-        if(defenderBattle != null && !defenderBattle.hasCombatant(event.getTarget().getId())) {
+        Battle defenderBattle = battleMap.get(entityToBattleMap.get(new EntityIDDimPair(event.getNewTarget())));
+        if(defenderBattle != null && !defenderBattle.hasCombatant(event.getNewTarget().getId())) {
             defenderBattle = null;
         }
 
@@ -244,13 +244,13 @@ public class BattleManager
             return;
         } else if(attackerBattle == null && defenderBattle == null) {
             // neither in battle
-            if(event.getEntity() instanceof Player || event.getTarget() instanceof Player)
+            if(event.getEntity() instanceof Player || event.getNewTarget() instanceof Player)
             {
                 // at least one is a player, create battle
                 Collection<Entity> sideA = new ArrayList<Entity>(1);
                 Collection<Entity> sideB = new ArrayList<Entity>(1);
                 sideA.add(event.getEntity());
-                sideB.add(event.getTarget());
+                sideB.add(event.getNewTarget());
                 createBattle(sideA, sideB, event.getEntity().level.dimension());
                 logger.debug("neither in battle, at least one is player, creating new battle");
             }
@@ -261,16 +261,16 @@ public class BattleManager
                     // battle max reached, cannot add to battle
                     return;
                 } else if (attackerBattle.hasCombatantInSideA(event.getEntity().getId())) {
-                    attackerBattle.addCombatantToSideB(event.getTarget());
+                    attackerBattle.addCombatantToSideB(event.getNewTarget());
                 } else {
-                    attackerBattle.addCombatantToSideA(event.getTarget());
+                    attackerBattle.addCombatantToSideA(event.getNewTarget());
                 }
-                entityToBattleMap.put(new EntityIDDimPair(event.getTarget()), attackerBattle.getId());
+                entityToBattleMap.put(new EntityIDDimPair(event.getNewTarget()), attackerBattle.getId());
             } else {
                 if (defenderBattle.getSize() >= TurnBasedMinecraftMod.proxy.getConfig().getMaxInBattle()) {
                     // battle max reached, cannot add to battle
                     return;
-                } else if (defenderBattle.hasCombatantInSideA(event.getTarget().getId())) {
+                } else if (defenderBattle.hasCombatantInSideA(event.getNewTarget().getId())) {
                     defenderBattle.addCombatantToSideB(event.getEntity());
                 } else {
                     defenderBattle.addCombatantToSideA(event.getEntity());
index b7924a6f9aaa3e0017fe9ea68594c047b19c1a62..e6f5ca2d13da5b1094548f911fede12b89cd2948 100644 (file)
@@ -39,7 +39,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.21.4";
+    public static final String VERSION = "1.22.0";
     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 4e835573a87d71fe2cfae93a9b7323894cdfe237..b2ccd6ea4f976a87601dafd54bd2924354cd3817 100644 (file)
@@ -1,6 +1,6 @@
 package com.burnedkirby.TurnBasedMinecraft.common;
 
-import net.minecraft.core.Registry;
+import net.minecraft.core.registries.Registries;
 import net.minecraft.resources.ResourceKey;
 import net.minecraft.resources.ResourceLocation;
 import net.minecraft.world.entity.Entity;
@@ -60,6 +60,6 @@ public class Utility
 
     public static ResourceKey<Level> deserializeDimension(String dimString) {
         ResourceLocation dimRes = new ResourceLocation(dimString);
-        return ResourceKey.create(Registry.DIMENSION_REGISTRY, dimRes);
+        return ResourceKey.create(Registries.DIMENSION, dimRes);
     }
 }
index b8bae1e538bf9ad0e61483c774cdd5e2059e917d..7a8e2d843629a501f97321f77e68f99027e7f2f7 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.21.4" #mandatory
+version="1.22.0" #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 f0920b1c9b02036a37b3e8a3b70c3d42c7e1a273..20c3250675ddea9639f43ef103e2b185db35ed68 100644 (file)
@@ -3,7 +3,7 @@
   "modid": "com_burnedkirby_turnbasedminecraft",
   "name": "Turn Based Minecraft",
   "description": "Changes battles to be turn-based.",
-  "version": "1.21.4",
+  "version": "1.22.0",
   "mcversion": "1.18.2",
   "url": "",
   "updateUrl": "",