diff --git a/gradle.properties b/gradle.properties index d165415..3b3d459 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,11 +3,11 @@ org.gradle.jvmargs = -Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version = 1.16.1 + minecraft_version = 1.16.4 curseforge_id = 365308 - simple_minecraft_version = 1.16.1 - yarn_build = 1 - fabric_loader_version = 0.8.8+build.202 + simple_minecraft_version = 1.16.4 + yarn_build = 7 + fabric_loader_version = 0.10.8 # Mod Properties mod_version = 1.2.9 @@ -16,7 +16,7 @@ org.gradle.jvmargs = -Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_api_version = 0.13.1+build.370-1.16 - cloth_config_version = 4.5.6 - auto_config_version = 3.2.0-unstable - mod_menu_version = 1.12.2+build.16 + fabric_api_version = 0.28.1+1.16 + cloth_config_version = 4.8.3 + auto_config_version = 3.3.1 + mod_menu_version = 1.14.13+build.19 diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/client/gui/CastingTableScreen.java b/src/main/java/com/thebrokenrail/sorcerycraft/client/gui/CastingTableScreen.java index 13e0995..2991c34 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/client/gui/CastingTableScreen.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/client/gui/CastingTableScreen.java @@ -8,14 +8,12 @@ import com.thebrokenrail.sorcerycraft.spell.api.Spell; import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.text.LiteralText; -import net.minecraft.text.StringRenderable; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; @@ -202,7 +200,7 @@ public class CastingTableScreen extends HandledScreen } @Environment(EnvType.CLIENT) - private class WidgetButtonPage extends ButtonWidget { + public class WidgetButtonPage extends ButtonWidget { final int index; public WidgetButtonPage(int i, int j, int k, PressAction pressAction) { @@ -229,10 +227,5 @@ public class CastingTableScreen extends HandledScreen } } } - - @Override - public void drawCenteredText(MatrixStack matrices, TextRenderer textRenderer, StringRenderable stringRenderable, int x, int y, int color) { - drawStringWithShadow(matrices, textRenderer, stringRenderable.getString(), this.x + 5, y, color); - } } } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellArgumentType.java b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellArgumentType.java index 8a18c7b..8b9c8cd 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellArgumentType.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellArgumentType.java @@ -14,7 +14,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder; import com.thebrokenrail.sorcerycraft.SorceryCraft; import com.thebrokenrail.sorcerycraft.spell.api.Spell; import com.thebrokenrail.sorcerycraft.spell.api.registry.SpellRegistry; -import net.minecraft.server.command.CommandSource; +import net.minecraft.command.CommandSource; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java index f8c5e8c..348cf73 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java @@ -8,7 +8,7 @@ import com.thebrokenrail.sorcerycraft.spell.api.Spell; import com.thebrokenrail.sorcerycraft.spell.api.registry.SpellRegistry; import com.thebrokenrail.sorcerycraft.spell.util.SpellHelper; import com.thebrokenrail.sorcerycraft.spell.util.SpellPlayerEntity; -import net.minecraft.command.arguments.EntityArgumentType; +import net.minecraft.command.argument.EntityArgumentType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.server.command.CommandManager; diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/gui/CastingTableScreenHandler.java b/src/main/java/com/thebrokenrail/sorcerycraft/gui/CastingTableScreenHandler.java index bddb8e5..1cb36ea 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/gui/CastingTableScreenHandler.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/gui/CastingTableScreenHandler.java @@ -53,7 +53,7 @@ public class CastingTableScreenHandler extends ScreenHandler { } @Override - public int getMaxStackAmount() { + public int getMaxItemCount() { return 1; } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinAbstractButtonWidget.java b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinAbstractButtonWidget.java new file mode 100644 index 0000000..983aba0 --- /dev/null +++ b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinAbstractButtonWidget.java @@ -0,0 +1,24 @@ +package com.thebrokenrail.sorcerycraft.mixin; + +import com.thebrokenrail.sorcerycraft.client.gui.CastingTableScreen; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawableHelper; +import net.minecraft.client.gui.widget.AbstractButtonWidget; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.text.Text; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@SuppressWarnings("ConstantConditions") +@Mixin(AbstractButtonWidget.class) +public class MixinAbstractButtonWidget { + @Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/AbstractButtonWidget;drawCenteredText(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/Text;III)V"), method = "renderButton") + public void drawCenteredText(MatrixStack matrices, TextRenderer textRenderer, Text text, int centerX, int y, int color) { + if ((Object) this instanceof CastingTableScreen.WidgetButtonPage) { + DrawableHelper.drawStringWithShadow(matrices, textRenderer, text.getString(), ((CastingTableScreen.WidgetButtonPage) (Object) this).x + 5, y, color); + } else { + DrawableHelper.drawCenteredText(matrices, textRenderer, text, centerX, y, color); + } + } +} diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/spell/LightningSpell.java b/src/main/java/com/thebrokenrail/sorcerycraft/spell/LightningSpell.java index 346b5b6..4bb4056 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/spell/LightningSpell.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/spell/LightningSpell.java @@ -34,7 +34,7 @@ public class LightningSpell extends Spell { assert lightningEntity != null; lightningEntity.updatePosition(pos.x, pos.y, pos.z); if (attacker instanceof ServerPlayerEntity) { - lightningEntity.setChanneller((ServerPlayerEntity) attacker); + lightningEntity.setChanneler((ServerPlayerEntity) attacker); } serverWorld.spawnEntity(lightningEntity); } diff --git a/src/main/resources/sorcerycraft.mixins.json b/src/main/resources/sorcerycraft.mixins.json index e9493d0..d7eb65d 100644 --- a/src/main/resources/sorcerycraft.mixins.json +++ b/src/main/resources/sorcerycraft.mixins.json @@ -3,8 +3,9 @@ "package": "com.thebrokenrail.sorcerycraft.mixin", "compatibilityLevel": "JAVA_8", "client": [ + "MixinClientPlayerEntity", "MixinClientPlayNetworkHandler", - "MixinClientPlayerEntity" + "MixinAbstractButtonWidget" ], "mixins": [ "CriteriaRegistryHook",