diff --git a/CHANGELOG.md b/CHANGELOG.md index 948a9d9..28a13b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +**1.0.6** +* Namespace PlayerEntity Mixin + **1.0.5** * Clean up code diff --git a/build.gradle b/build.gradle index 5ccd6dc..01d3753 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ compileJava { targetCompatibility = JavaVersion.VERSION_1_8 } +archivesBaseName = project.archives_base_name version = project.mod_version as Object group = project.maven_group as Object diff --git a/gradle.properties b/gradle.properties index e754adf..62fde9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs = -Xmx1G loader_version = 0.7.8+build.184 # Mod Properties - mod_version = 1.0.5 + mod_version = 1.0.6 maven_group = com.thebrokenrail archives_base_name = sorcerycraft diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableContainer.java b/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableContainer.java index f62ebf5..9e4a21f 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableContainer.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/block/CastingTableContainer.java @@ -47,7 +47,7 @@ public class CastingTableContainer extends Container { spells = SpellRegistry.getSpells(); } else { SpellPlayerEntity spellPlayer = (SpellPlayerEntity) playerInventory.player; - Map spellsMap = spellPlayer.getSpells(); + Map spellsMap = spellPlayer.getSorceryCraftSpells(); List spellsArray = new ArrayList<>(); Spell[] allSpells = SpellRegistry.getSpells(); diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java index 0028cac..0c5320d 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/command/SpellCommand.java @@ -25,7 +25,7 @@ public class SpellCommand { PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player"); ctx.getSource().sendFeedback(new TranslatableText("command." + SorceryCraft.NAMESPACE + ".spell.listing_spells", player.getDisplayName()), false); SpellPlayerEntity spellPlayer = (SpellPlayerEntity) player; - Map spells = spellPlayer.getSpells(); + Map spells = spellPlayer.getSorceryCraftSpells(); for (Map.Entry entry : spells.entrySet()) { ctx.getSource().sendFeedback(SpellTag.getTranslatedSpell(entry.getKey(), entry.getValue()).formatted(Formatting.YELLOW), false); } @@ -38,7 +38,7 @@ public class SpellCommand { .executes(ctx -> { PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player"); SpellPlayerEntity spellPlayer = (SpellPlayerEntity) player; - spellPlayer.setSpells(new HashMap<>()); + spellPlayer.setSorceryCraftSpells(new HashMap<>()); ctx.getSource().sendFeedback(new TranslatableText("command." + SorceryCraft.NAMESPACE + ".spell.cleared_spells", player.getDisplayName()), true); return 1; }) diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/item/SpellItem.java b/src/main/java/com/thebrokenrail/sorcerycraft/item/SpellItem.java index 6c9a43c..85e875d 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/item/SpellItem.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/item/SpellItem.java @@ -94,7 +94,7 @@ public class SpellItem extends Item { PlayerEntity player = (PlayerEntity) entity; SpellPlayerEntity spellPlayer = (SpellPlayerEntity) player; - Map playerSpells = spellPlayer.getSpells(); + Map playerSpells = spellPlayer.getSorceryCraftSpells(); Map itemSpells = SpellTag.getSpells(player.inventory.getInvStack(slot)); boolean changed = false; @@ -119,7 +119,7 @@ public class SpellItem extends Item { if (changed) { SorceryCraft.playSpellSound(player); - spellPlayer.setSpells(playerSpells); + spellPlayer.setSorceryCraftSpells(playerSpells); } } } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinPlayerEntity.java b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinPlayerEntity.java index b5e03b4..0c94bc0 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinPlayerEntity.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinPlayerEntity.java @@ -16,25 +16,25 @@ import java.util.Map; @SuppressWarnings("unused") @Mixin(PlayerEntity.class) public class MixinPlayerEntity implements SpellPlayerEntity { - private Map spells = new HashMap<>(); + private Map sorceryCraftSpells = new HashMap<>(); @Inject(at = @At("HEAD"), method = "readCustomDataFromTag") public void readCustomDataFromTag(CompoundTag tag, CallbackInfo info) { - spells = SpellTag.getSpells(tag); + sorceryCraftSpells = SpellTag.getSpells(tag); } @Inject(at = @At("HEAD"), method = "writeCustomDataToTag") public void writeCustomDataToTag(CompoundTag tag, CallbackInfo info) { - tag.put(SpellTag.SPELL_TAG, SpellTag.createSpellsTag(spells)); + tag.put(SpellTag.SPELL_TAG, SpellTag.createSpellsTag(sorceryCraftSpells)); } @Override - public void setSpells(Map spells) { - this.spells = spells; + public void setSorceryCraftSpells(Map spells) { + this.sorceryCraftSpells = spells; } @Override - public Map getSpells() { - return spells; + public Map getSorceryCraftSpells() { + return sorceryCraftSpells; } } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinServerPlayerEntity.java b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinServerPlayerEntity.java index c665fe0..b3cc962 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinServerPlayerEntity.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/mixin/MixinServerPlayerEntity.java @@ -18,13 +18,13 @@ public abstract class MixinServerPlayerEntity implements SpellPlayerEntity { SpellPlayerEntity oldSpellPlayer = (SpellPlayerEntity) oldPlayer; SpellPlayerEntity newSpellPlayer = this; - newSpellPlayer.setSpells(oldSpellPlayer.getSpells()); + newSpellPlayer.setSorceryCraftSpells(oldSpellPlayer.getSorceryCraftSpells()); } @Inject(at = @At("HEAD"), method = "playerTick") public void playerTick(CallbackInfo ignored) { CompoundTag tag = new CompoundTag(); - tag.put(SpellTag.SPELL_TAG, SpellTag.createSpellsTag(getSpells())); + tag.put(SpellTag.SPELL_TAG, SpellTag.createSpellsTag(getSorceryCraftSpells())); //noinspection ConstantConditions UpdateKnownSpellsS2CPacket.send((ServerPlayerEntity) (Object) this, tag); } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/packet/UpdateKnownSpellsS2CPacket.java b/src/main/java/com/thebrokenrail/sorcerycraft/packet/UpdateKnownSpellsS2CPacket.java index b92c088..f3213ce 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/packet/UpdateKnownSpellsS2CPacket.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/packet/UpdateKnownSpellsS2CPacket.java @@ -16,7 +16,7 @@ public class UpdateKnownSpellsS2CPacket { CompoundTag tag = bytes.readCompoundTag(); if (context.getPlayer() != null) { SpellPlayerEntity spellPlayer = (SpellPlayerEntity) context.getPlayer(); - spellPlayer.setSpells(SpellTag.getSpells(tag)); + spellPlayer.setSorceryCraftSpells(SpellTag.getSpells(tag)); } } diff --git a/src/main/java/com/thebrokenrail/sorcerycraft/spell/SpellPlayerEntity.java b/src/main/java/com/thebrokenrail/sorcerycraft/spell/SpellPlayerEntity.java index 00e6d61..c8d9b38 100644 --- a/src/main/java/com/thebrokenrail/sorcerycraft/spell/SpellPlayerEntity.java +++ b/src/main/java/com/thebrokenrail/sorcerycraft/spell/SpellPlayerEntity.java @@ -5,7 +5,7 @@ import net.minecraft.util.Identifier; import java.util.Map; public interface SpellPlayerEntity { - void setSpells(Map spells); + void setSorceryCraftSpells(Map spells); - Map getSpells(); + Map getSorceryCraftSpells(); }