From 4cf62cd1880ac04b108b2b739d25f5a2714cf8fb Mon Sep 17 00:00:00 2001 From: Globox1997 Date: Sat, 20 Jul 2024 14:39:10 +0200 Subject: [PATCH] fixed couple things --- CHANGELOG.md | 6 ++++-- gradle.properties | 2 +- src/main/java/net/dragonloot/config/DragonLootConfig.java | 2 +- .../java/net/dragonloot/entity/DragonTridentEntity.java | 8 +++++++- .../java/net/dragonloot/item/DragonToolMaterials.java | 2 +- src/main/resources/assets/dragonloot/lang/en_us.json | 2 +- src/main/resources/data/minecraft/tags/item/axes.json | 6 ++++++ .../resources/data/minecraft/tags/item/chest_armor.json | 6 ++++++ .../data/minecraft/tags/item/enchantable/bow.json | 6 ++++++ .../data/minecraft/tags/item/enchantable/crossbow.json | 6 ++++++ .../data/minecraft/tags/item/enchantable/trident.json | 6 ++++++ .../resources/data/minecraft/tags/item/foot_armor.json | 6 ++++++ .../resources/data/minecraft/tags/item/head_armor.json | 6 ++++++ src/main/resources/data/minecraft/tags/item/hoes.json | 6 ++++++ .../resources/data/minecraft/tags/item/leg_armor.json | 6 ++++++ src/main/resources/data/minecraft/tags/item/pickaxes.json | 6 ++++++ src/main/resources/data/minecraft/tags/item/shovels.json | 6 ++++++ src/main/resources/data/minecraft/tags/item/swords.json | 6 ++++++ 18 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/data/minecraft/tags/item/axes.json create mode 100644 src/main/resources/data/minecraft/tags/item/chest_armor.json create mode 100644 src/main/resources/data/minecraft/tags/item/enchantable/bow.json create mode 100644 src/main/resources/data/minecraft/tags/item/enchantable/crossbow.json create mode 100644 src/main/resources/data/minecraft/tags/item/enchantable/trident.json create mode 100644 src/main/resources/data/minecraft/tags/item/foot_armor.json create mode 100644 src/main/resources/data/minecraft/tags/item/head_armor.json create mode 100644 src/main/resources/data/minecraft/tags/item/hoes.json create mode 100644 src/main/resources/data/minecraft/tags/item/leg_armor.json create mode 100644 src/main/resources/data/minecraft/tags/item/pickaxes.json create mode 100644 src/main/resources/data/minecraft/tags/item/shovels.json create mode 100644 src/main/resources/data/minecraft/tags/item/swords.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 4339063..e6644e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### Added: - ### Fixed: -- +- Fixed dragon tool durability +- Fixed trident crash +- Fixed dragon items enchanting ### Changed: -- Updated to mc 1.21 \ No newline at end of file +- \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 559ffc2..8d83ce2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.15.11 # Mod Properties - mod_version = 1.1.4 + mod_version = 1.1.5 maven_group = net.dragonloot archives_base_name = dragonloot diff --git a/src/main/java/net/dragonloot/config/DragonLootConfig.java b/src/main/java/net/dragonloot/config/DragonLootConfig.java index 1f2d220..bd192a3 100644 --- a/src/main/java/net/dragonloot/config/DragonLootConfig.java +++ b/src/main/java/net/dragonloot/config/DragonLootConfig.java @@ -34,7 +34,7 @@ public class DragonLootConfig implements ConfigData { @ConfigEntry.Gui.RequiresRestart public int dragon_armor_durability_multiplier = 37; @ConfigEntry.Gui.RequiresRestart - public int dragon_item_durability_multiplier = 37; + public int dragon_item_durability = 1961; @ConfigEntry.Gui.RequiresRestart public float dragon_item_base_damage = 5F; @ConfigEntry.Gui.RequiresRestart diff --git a/src/main/java/net/dragonloot/entity/DragonTridentEntity.java b/src/main/java/net/dragonloot/entity/DragonTridentEntity.java index a92d367..cbacef4 100644 --- a/src/main/java/net/dragonloot/entity/DragonTridentEntity.java +++ b/src/main/java/net/dragonloot/entity/DragonTridentEntity.java @@ -42,12 +42,14 @@ public DragonTridentEntity(World world, LivingEntity owner, ItemStack stack) { super(EntityInit.DRAGON_TRIDENT_ENTITY, owner, world, stack, null); this.dataTracker.set(LOYALTY, this.getLoyalty(stack)); this.dataTracker.set(ENCHANTED, stack.hasGlint()); + this.tridentStack = stack; } public DragonTridentEntity(World world, double x, double y, double z, ItemStack stack) { super(EntityInit.DRAGON_TRIDENT_ENTITY, x, y, z, world, stack, stack); this.dataTracker.set(LOYALTY, this.getLoyalty(stack)); this.dataTracker.set(ENCHANTED, stack.hasGlint()); + this.tridentStack = stack; } @Override @@ -104,12 +106,16 @@ private boolean isOwnerAlive() { @Override protected ItemStack asItemStack() { + if (this.tridentStack == null || this.tridentStack.isEmpty()) { + System.out.println("TEST"); + this.tridentStack = new ItemStack(ItemInit.DRAGON_TRIDENT); + } return this.tridentStack.copy(); } @Environment(EnvType.CLIENT) public boolean isEnchanted() { - return (Boolean) this.dataTracker.get(ENCHANTED); + return this.dataTracker.get(ENCHANTED); } @Override diff --git a/src/main/java/net/dragonloot/item/DragonToolMaterials.java b/src/main/java/net/dragonloot/item/DragonToolMaterials.java index ebd86fc..ab3b2fd 100644 --- a/src/main/java/net/dragonloot/item/DragonToolMaterials.java +++ b/src/main/java/net/dragonloot/item/DragonToolMaterials.java @@ -10,7 +10,7 @@ public class DragonToolMaterials implements ToolMaterial { - public static final ToolMaterial DRAGON = new DragonToolMaterials(BlockTags.INCORRECT_FOR_WOODEN_TOOL, ConfigInit.CONFIG.dragon_item_durability_multiplier, ConfigInit.CONFIG.dragon_item_mining_speed_multiplier, ConfigInit.CONFIG.dragon_item_base_damage, ConfigInit.CONFIG.dragon_tool_enchantability, Ingredient.ofItems(ItemInit.DRAGON_SCALE), "dragon"); + public static final ToolMaterial DRAGON = new DragonToolMaterials(BlockTags.INCORRECT_FOR_NETHERITE_TOOL, ConfigInit.CONFIG.dragon_item_durability, ConfigInit.CONFIG.dragon_item_mining_speed_multiplier, ConfigInit.CONFIG.dragon_item_base_damage, ConfigInit.CONFIG.dragon_tool_enchantability, Ingredient.ofItems(ItemInit.DRAGON_SCALE), "dragon"); private final TagKey inverseTag; private final int itemDurability; diff --git a/src/main/resources/assets/dragonloot/lang/en_us.json b/src/main/resources/assets/dragonloot/lang/en_us.json index 8761881..891d107 100644 --- a/src/main/resources/assets/dragonloot/lang/en_us.json +++ b/src/main/resources/assets/dragonloot/lang/en_us.json @@ -31,7 +31,7 @@ "text.autoconfig.dragonloot.option.dragon_armor_protection_leggings": "Dragon Armor Leggings Protection", "text.autoconfig.dragonloot.option.dragon_armor_protection_boots": "Dragon Armor Boots Protection", "text.autoconfig.dragonloot.option.dragon_armor_durability_multiplier": "Dragon Armor Durability Multiplier", - "text.autoconfig.dragonloot.option.dragon_item_durability_multiplier": "Dragon Item Durability Multiplier", + "text.autoconfig.dragonloot.option.dragon_item_durability": "Dragon Item Durability", "text.autoconfig.dragonloot.option.dragon_item_base_damage": "Dragon Item Base Damage", "text.autoconfig.dragonloot.option.dragon_anvil_no_cap": "Dragon Anvil No Cap", "text.autoconfig.dragonloot.option.dragon_armor_toughness": "Dragon Armor Toughness", diff --git a/src/main/resources/data/minecraft/tags/item/axes.json b/src/main/resources/data/minecraft/tags/item/axes.json new file mode 100644 index 0000000..f122e8f --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/axes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_axe" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/chest_armor.json b/src/main/resources/data/minecraft/tags/item/chest_armor.json new file mode 100644 index 0000000..f180b6f --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/chest_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_chestplate" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/enchantable/bow.json b/src/main/resources/data/minecraft/tags/item/enchantable/bow.json new file mode 100644 index 0000000..109be20 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/enchantable/bow.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_bow" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/enchantable/crossbow.json b/src/main/resources/data/minecraft/tags/item/enchantable/crossbow.json new file mode 100644 index 0000000..82d97d8 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/enchantable/crossbow.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_crossbow" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/enchantable/trident.json b/src/main/resources/data/minecraft/tags/item/enchantable/trident.json new file mode 100644 index 0000000..889764f --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/enchantable/trident.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_trident" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/foot_armor.json b/src/main/resources/data/minecraft/tags/item/foot_armor.json new file mode 100644 index 0000000..a36644b --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/foot_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_boots" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/head_armor.json b/src/main/resources/data/minecraft/tags/item/head_armor.json new file mode 100644 index 0000000..29b02a9 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/head_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_helmet" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/hoes.json b/src/main/resources/data/minecraft/tags/item/hoes.json new file mode 100644 index 0000000..084d214 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/hoes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_hoe" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/leg_armor.json b/src/main/resources/data/minecraft/tags/item/leg_armor.json new file mode 100644 index 0000000..6142e56 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/leg_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_leggings" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/pickaxes.json b/src/main/resources/data/minecraft/tags/item/pickaxes.json new file mode 100644 index 0000000..30737da --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/pickaxes.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_pickaxe" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/shovels.json b/src/main/resources/data/minecraft/tags/item/shovels.json new file mode 100644 index 0000000..3ce24cc --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/shovels.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_shovel" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/item/swords.json b/src/main/resources/data/minecraft/tags/item/swords.json new file mode 100644 index 0000000..e586795 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/item/swords.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "dragonloot:dragon_sword" + ] +} \ No newline at end of file