From 969f043e0ed41777463814d677961c265877c86e Mon Sep 17 00:00:00 2001 From: Nicholas Smit Date: Thu, 19 Oct 2023 14:12:28 -0400 Subject: [PATCH 1/3] Various bugfixes and tweaks Fix 3rd person models for custom bows not using the proper parent model. Also fixes custom bows not changing player FOV when drawing. Add custom materials to beacon base block and payment item tags. Adjust generation weights of Tiltros biomes. Fix Lava Revenants getting stuck in water. Update translation keys for enchantment numbers up to 100. Add protection-like enchantments to the Skygazer max level configuration at level 5. Add ores tag for Sulfur. --- gradle.properties | 4 +- .../assets/immersiveweapons/lang/en_us.json | 75 +++++++++++++++++++ .../models/item/aurora_bow_pulling_0.json | 2 +- .../models/item/aurora_bow_pulling_1.json | 2 +- .../models/item/aurora_bow_pulling_2.json | 2 +- .../item/dragons_breath_bow_pulling_0.json | 2 +- .../item/dragons_breath_bow_pulling_1.json | 2 +- .../item/dragons_breath_bow_pulling_2.json | 2 +- .../models/item/ice_bow_pulling_0.json | 2 +- .../models/item/ice_bow_pulling_1.json | 2 +- .../models/item/ice_bow_pulling_2.json | 2 +- .../data/forge/tags/blocks/ores.json | 3 +- .../data/forge/tags/blocks/ores/sulfur.json | 7 ++ .../resources/data/forge/tags/items/ores.json | 3 +- .../data/forge/tags/items/ores/sulfur.json | 7 ++ .../worldgen/biome/deadmans_desert.json | 2 +- .../worldgen/biome/starlight_plains.json | 2 +- .../tags/blocks/beacon_base_blocks.json | 9 +++ .../tags/items/beacon_payment_items.json | 10 +++ .../immersiveweapons/config/CommonConfig.java | 5 ++ .../data/biomes/BiomesGenerator.java | 4 +- .../data/lang/LanguageGenerator.java | 4 +- .../data/models/ItemModelGenerator.java | 11 ++- .../data/tags/BlockTagsGenerator.java | 61 +++++++++++---- .../data/tags/ItemTagsGenerator.java | 38 +++++++--- .../groups/forge/ForgeBlockTagGroups.java | 2 + .../tags/groups/forge/ForgeItemTagGroups.java | 2 + .../lava_revenant/LavaRevenantEntity.java | 7 +- .../event/ClientForgeEventSubscriber.java | 24 ++++++ .../immersiveweapons/dimension/tiltros.json | 14 ++-- 30 files changed, 252 insertions(+), 60 deletions(-) create mode 100644 src/generated/resources/data/forge/tags/blocks/ores/sulfur.json create mode 100644 src/generated/resources/data/forge/tags/items/ores/sulfur.json create mode 100644 src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json create mode 100644 src/generated/resources/data/minecraft/tags/items/beacon_payment_items.json diff --git a/gradle.properties b/gradle.properties index bceb931b7..f13401b90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx6G org.gradle.daemon=true org.gradle.caching=true org.gradle.parallel=true -mod_version=1.20.1-1.27.0 +mod_version=1.20.1-1.27.1 mod_group_id=tech.anonymoushacker1279.immersiveweapons mappings_channel=parchment mappings_version=2023.09.03-1.20.1 @@ -12,7 +12,7 @@ neoforge_version=47.1.79 neoforge_version_range=[47.1.3,) loader_version_range=[47,) terrablender_version=1.20-3.0.0.163 -iwcb_version=1.20.1-1.6.0 +iwcb_version=1.20.1-1.7.0 jei_version=15.2.0.27 wthit_version=8.4.0 badpackets_version=0.4.1 diff --git a/src/generated/resources/assets/immersiveweapons/lang/en_us.json b/src/generated/resources/assets/immersiveweapons/lang/en_us.json index 7bc91ba54..c5076d481 100644 --- a/src/generated/resources/assets/immersiveweapons/lang/en_us.json +++ b/src/generated/resources/assets/immersiveweapons/lang/en_us.json @@ -507,6 +507,7 @@ "enchantment.immersiveweapons.scorch_shot": "Scorch Shot", "enchantment.immersiveweapons.sharpened_head": "Sharpened Head", "enchantment.immersiveweapons.velocity": "Velocity", + "enchantment.level.100": "C", "enchantment.level.11": "XI", "enchantment.level.12": "XII", "enchantment.level.13": "XIII", @@ -522,6 +523,80 @@ "enchantment.level.23": "XXIII", "enchantment.level.24": "XXIV", "enchantment.level.25": "XXV", + "enchantment.level.26": "XXVI", + "enchantment.level.27": "XXVII", + "enchantment.level.28": "XXVIII", + "enchantment.level.29": "XXIX", + "enchantment.level.30": "XXX", + "enchantment.level.31": "XXXI", + "enchantment.level.32": "XXXII", + "enchantment.level.33": "XXXIII", + "enchantment.level.34": "XXXIV", + "enchantment.level.35": "XXXV", + "enchantment.level.36": "XXXVI", + "enchantment.level.37": "XXXVII", + "enchantment.level.38": "XXXVIII", + "enchantment.level.39": "XXXIX", + "enchantment.level.40": "XL", + "enchantment.level.41": "XLI", + "enchantment.level.42": "XLII", + "enchantment.level.43": "XLIII", + "enchantment.level.44": "XLIV", + "enchantment.level.45": "XLV", + "enchantment.level.46": "XLVI", + "enchantment.level.47": "XLVII", + "enchantment.level.48": "XLVIII", + "enchantment.level.49": "XLIX", + "enchantment.level.50": "L", + "enchantment.level.51": "LI", + "enchantment.level.52": "LII", + "enchantment.level.53": "LIII", + "enchantment.level.54": "LIV", + "enchantment.level.55": "LV", + "enchantment.level.56": "LVI", + "enchantment.level.57": "LVII", + "enchantment.level.58": "LVIII", + "enchantment.level.59": "LIX", + "enchantment.level.60": "LX", + "enchantment.level.61": "LXI", + "enchantment.level.62": "LXII", + "enchantment.level.63": "LXIII", + "enchantment.level.64": "LXIV", + "enchantment.level.65": "LXV", + "enchantment.level.66": "LXVI", + "enchantment.level.67": "LXVII", + "enchantment.level.68": "LXVIII", + "enchantment.level.69": "LXIX", + "enchantment.level.70": "LXX", + "enchantment.level.71": "LXXI", + "enchantment.level.72": "LXXII", + "enchantment.level.73": "LXXIII", + "enchantment.level.74": "LXXIV", + "enchantment.level.75": "LXXV", + "enchantment.level.76": "LXXVI", + "enchantment.level.77": "LXXVII", + "enchantment.level.78": "LXXVIII", + "enchantment.level.79": "LXXIX", + "enchantment.level.80": "LXXX", + "enchantment.level.81": "LXXXI", + "enchantment.level.82": "LXXXII", + "enchantment.level.83": "LXXXIII", + "enchantment.level.84": "LXXXIV", + "enchantment.level.85": "LXXXV", + "enchantment.level.86": "LXXXVI", + "enchantment.level.87": "LXXXVII", + "enchantment.level.88": "LXXXVIII", + "enchantment.level.89": "LXXXIX", + "enchantment.level.90": "XC", + "enchantment.level.91": "XCI", + "enchantment.level.92": "XCII", + "enchantment.level.93": "XCIII", + "enchantment.level.94": "XCIV", + "enchantment.level.95": "XCV", + "enchantment.level.96": "XCVI", + "enchantment.level.97": "XCVII", + "enchantment.level.98": "XCVIII", + "enchantment.level.99": "XCIX", "entity.immersiveweapons.astral_arrow": "Astral Arrow", "entity.immersiveweapons.astral_musket_ball": "Astral Musket Ball", "entity.immersiveweapons.burned_oak_boat": "Burned Oak Boat", diff --git a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_0.json b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_0.json index 0070d6064..059149b30 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_0.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_0.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/aurora_bow", "textures": { "layer0": "immersiveweapons:item/aurora_bow_pulling_0" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_1.json b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_1.json index d3cdc3396..856145249 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_1.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_1.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/aurora_bow", "textures": { "layer0": "immersiveweapons:item/aurora_bow_pulling_1" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_2.json b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_2.json index 8a957dd1b..eaa925d23 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_2.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/aurora_bow_pulling_2.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/aurora_bow", "textures": { "layer0": "immersiveweapons:item/aurora_bow_pulling_2" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_0.json b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_0.json index 4226bdf0f..34e47faed 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_0.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_0.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/dragons_breath_bow", "textures": { "layer0": "immersiveweapons:item/dragons_breath_bow_pulling_0" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_1.json b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_1.json index 3837bc4a2..3c75d4659 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_1.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_1.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/dragons_breath_bow", "textures": { "layer0": "immersiveweapons:item/dragons_breath_bow_pulling_1" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_2.json b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_2.json index f661ec6c9..14aa4174c 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_2.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/dragons_breath_bow_pulling_2.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/dragons_breath_bow", "textures": { "layer0": "immersiveweapons:item/dragons_breath_bow_pulling_2" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_0.json b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_0.json index 71748a216..8e7371c74 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_0.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_0.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/ice_bow", "textures": { "layer0": "immersiveweapons:item/ice_bow_pulling_0" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_1.json b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_1.json index b2c6fde44..6a86ffb4b 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_1.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_1.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/ice_bow", "textures": { "layer0": "immersiveweapons:item/ice_bow_pulling_1" } diff --git a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_2.json b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_2.json index 3d0543945..c62a17a86 100644 --- a/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_2.json +++ b/src/generated/resources/assets/immersiveweapons/models/item/ice_bow_pulling_2.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:item/generated", + "parent": "immersiveweapons:item/ice_bow", "textures": { "layer0": "immersiveweapons:item/ice_bow_pulling_2" } diff --git a/src/generated/resources/data/forge/tags/blocks/ores.json b/src/generated/resources/data/forge/tags/blocks/ores.json index ef93bccd2..e2d4ca4d0 100644 --- a/src/generated/resources/data/forge/tags/blocks/ores.json +++ b/src/generated/resources/data/forge/tags/blocks/ores.json @@ -1,5 +1,6 @@ { "values": [ - "#forge:ores/cobalt" + "#forge:ores/cobalt", + "#forge:ores/sulfur" ] } \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/blocks/ores/sulfur.json b/src/generated/resources/data/forge/tags/blocks/ores/sulfur.json new file mode 100644 index 000000000..7f9e1bd73 --- /dev/null +++ b/src/generated/resources/data/forge/tags/blocks/ores/sulfur.json @@ -0,0 +1,7 @@ +{ + "values": [ + "immersiveweapons:sulfur_ore", + "immersiveweapons:deepslate_sulfur_ore", + "immersiveweapons:nether_sulfur_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/ores.json b/src/generated/resources/data/forge/tags/items/ores.json index ef93bccd2..e2d4ca4d0 100644 --- a/src/generated/resources/data/forge/tags/items/ores.json +++ b/src/generated/resources/data/forge/tags/items/ores.json @@ -1,5 +1,6 @@ { "values": [ - "#forge:ores/cobalt" + "#forge:ores/cobalt", + "#forge:ores/sulfur" ] } \ No newline at end of file diff --git a/src/generated/resources/data/forge/tags/items/ores/sulfur.json b/src/generated/resources/data/forge/tags/items/ores/sulfur.json new file mode 100644 index 000000000..7f9e1bd73 --- /dev/null +++ b/src/generated/resources/data/forge/tags/items/ores/sulfur.json @@ -0,0 +1,7 @@ +{ + "values": [ + "immersiveweapons:sulfur_ore", + "immersiveweapons:deepslate_sulfur_ore", + "immersiveweapons:nether_sulfur_ore" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/worldgen/biome/deadmans_desert.json b/src/generated/resources/data/immersiveweapons/worldgen/biome/deadmans_desert.json index e73cf86b5..815a80231 100644 --- a/src/generated/resources/data/immersiveweapons/worldgen/biome/deadmans_desert.json +++ b/src/generated/resources/data/immersiveweapons/worldgen/biome/deadmans_desert.json @@ -125,5 +125,5 @@ "water_ambient": [], "water_creature": [] }, - "temperature": 1.8 + "temperature": 0.2 } \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/worldgen/biome/starlight_plains.json b/src/generated/resources/data/immersiveweapons/worldgen/biome/starlight_plains.json index ef48846c5..a13ca2f3c 100644 --- a/src/generated/resources/data/immersiveweapons/worldgen/biome/starlight_plains.json +++ b/src/generated/resources/data/immersiveweapons/worldgen/biome/starlight_plains.json @@ -113,5 +113,5 @@ "water_ambient": [], "water_creature": [] }, - "temperature": 0.8 + "temperature": 0.6 } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json b/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json new file mode 100644 index 000000000..bdab226fa --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/blocks/beacon_base_blocks.json @@ -0,0 +1,9 @@ +{ + "values": [ + "immersiveweapons:cobalt_block", + "immersiveweapons:molten_block", + "immersiveweapons:tesla_block", + "immersiveweapons:astral_block", + "immersiveweapons:starstorm_block" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/items/beacon_payment_items.json b/src/generated/resources/data/minecraft/tags/items/beacon_payment_items.json new file mode 100644 index 000000000..27f55f507 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/items/beacon_payment_items.json @@ -0,0 +1,10 @@ +{ + "values": [ + "immersiveweapons:cobalt_ingot", + "immersiveweapons:molten_ingot", + "immersiveweapons:tesla_ingot", + "immersiveweapons:ventus_shard", + "immersiveweapons:astral_ingot", + "immersiveweapons:starstorm_ingot" + ] +} \ No newline at end of file diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/config/CommonConfig.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/config/CommonConfig.java index a62f1f993..ad8f43e81 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/config/CommonConfig.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/config/CommonConfig.java @@ -217,6 +217,11 @@ private static Map getEnchantCapsMap() { enchantCaps.put("minecraft:infinity", 1); enchantCaps.put("minecraft:channeling", 1); enchantCaps.put("minecraft:multishot", 1); + enchantCaps.put("minecraft:protection", 5); + enchantCaps.put("minecraft:blast_protection", 5); + enchantCaps.put("minecraft:fire_protection", 5); + enchantCaps.put("minecraft:projectile_protection", 5); + enchantCaps.put("minecraft:feather_falling", 5); enchantCaps.put("immersiveweapons:extended_reach", 1); enchantCaps.put("immersiveweapons:endless_musket_pouch", 1); enchantCaps.put("immersiveweapons:scorch_shot", 3); diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/biomes/BiomesGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/biomes/BiomesGenerator.java index 7bff7d414..ae7905b73 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/biomes/BiomesGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/biomes/BiomesGenerator.java @@ -66,7 +66,7 @@ public static Biome tiltrosWastesBiome(HolderGetter placedFeature public static Biome starlightPlainsBiome(HolderGetter placedFeatures, HolderGetter> worldCarvers) { return new Biome.BiomeBuilder() - .temperature(0.8f) + .temperature(0.6f) .downfall(0.0f) .hasPrecipitation(false) .temperatureAdjustment(TemperatureModifier.NONE) @@ -87,7 +87,7 @@ public static Biome starlightPlainsBiome(HolderGetter placedFeatu public static Biome deadmansDesertBiome(HolderGetter placedFeatures, HolderGetter> worldCarvers) { return new Biome.BiomeBuilder() - .temperature(1.8f) + .temperature(0.2f) .downfall(0.0f) .hasPrecipitation(false) .temperatureAdjustment(TemperatureModifier.NONE) diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java index bf7eaca0b..2347228ef 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java @@ -1004,8 +1004,8 @@ private void addMisc() { add("immersiveweapons.boss.celestial_tower.waves", "Wave %s of %s"); add("itemGroup.immersiveweapons.creative_tab", "Immersive Weapons"); - // Vanilla only has enchantment numbers up to 10, so add up to 25 for QoL if the player has high level enchants - for (int i = 11; i <= 25; i++) { + // Vanilla only has enchantment numbers up to 10, so add up to 100 for QoL if the player has high level enchants + for (int i = 11; i <= 100; i++) { // Convert the number to a roman numeral add("enchantment.level." + i, GeneralUtilities.convertToRoman(i)); } diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/models/ItemModelGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/models/ItemModelGenerator.java index 7e5735380..a1f21889a 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/models/ItemModelGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/models/ItemModelGenerator.java @@ -273,6 +273,9 @@ private void armorItem(ArmorItem item, @Nullable ResourceLocation overlay) { * @param item the Item to generate a model for */ private void bowItem(Item item) { + + ResourceLocation baseLayer = new ResourceLocation(ImmersiveWeapons.MOD_ID, "item/" + item); + // Main model getBuilder(item.toString()) .parent(new ModelFile.UncheckedModelFile("item/generated")) @@ -298,7 +301,7 @@ private void bowItem(Item item) { .scale(0.68f) .end() .end() - .texture("layer0", new ResourceLocation(ImmersiveWeapons.MOD_ID, "item/" + item)) + .texture("layer0", baseLayer) .override().predicate(new ResourceLocation(ImmersiveWeapons.MOD_ID, "pulling"), 1) .model(new ModelFile.UncheckedModelFile(ImmersiveWeapons.MOD_ID + ":item/" + item + "_pulling_0")) .end() @@ -313,13 +316,13 @@ private void bowItem(Item item) { // Pulling models getBuilder(item + "_pulling_0") - .parent(new ModelFile.UncheckedModelFile("item/generated")) + .parent(new ModelFile.UncheckedModelFile(baseLayer)) .texture("layer0", new ResourceLocation(ImmersiveWeapons.MOD_ID, "item/" + item + "_pulling_0")); getBuilder(item + "_pulling_1") - .parent(new ModelFile.UncheckedModelFile("item/generated")) + .parent(new ModelFile.UncheckedModelFile(baseLayer)) .texture("layer0", new ResourceLocation(ImmersiveWeapons.MOD_ID, "item/" + item + "_pulling_1")); getBuilder(item + "_pulling_2") - .parent(new ModelFile.UncheckedModelFile("item/generated")) + .parent(new ModelFile.UncheckedModelFile(baseLayer)) .texture("layer0", new ResourceLocation(ImmersiveWeapons.MOD_ID, "item/" + item + "_pulling_2")); } diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java index 20bd1e86c..0e672c419 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java @@ -38,6 +38,7 @@ protected void addTags(Provider provider) { /** * Add tags under the Forge namespace */ + @SuppressWarnings("unchecked") private void addForgeTags() { // Bulletproof glass tag for (Block block : BlockTagLists.BULLETPROOF_GLASS) { @@ -53,9 +54,16 @@ private void addForgeTags() { } // Ore tags - tag(ForgeBlockTagGroups.COBALT_ORES).add(BlockRegistry.COBALT_ORE.get()) - .add(BlockRegistry.DEEPSLATE_COBALT_ORE.get()); - tag(Blocks.ORES).addTag(ForgeBlockTagGroups.COBALT_ORES); + tag(ForgeBlockTagGroups.COBALT_ORES).add( + BlockRegistry.COBALT_ORE.get(), + BlockRegistry.DEEPSLATE_COBALT_ORE.get()); + tag(ForgeBlockTagGroups.SULFUR_ORES).add( + BlockRegistry.SULFUR_ORE.get(), + BlockRegistry.DEEPSLATE_SULFUR_ORE.get(), + BlockRegistry.NETHER_SULFUR_ORE.get()); + tag(Blocks.ORES).addTags( + ForgeBlockTagGroups.COBALT_ORES, + ForgeBlockTagGroups.SULFUR_ORES); } /** @@ -82,20 +90,24 @@ private void addMinecraftTags() { tag(BlockTags.FENCES).add(BlockRegistry.BARBED_WIRE_FENCE.get()); // Burnable logs tag - tag(BlockTags.LOGS_THAT_BURN).addTags(IWBlockTagGroups.BURNED_OAK_LOGS, + tag(BlockTags.LOGS_THAT_BURN).addTags( + IWBlockTagGroups.BURNED_OAK_LOGS, IWBlockTagGroups.STARDUST_LOGS); // Planks tag - tag(BlockTags.PLANKS).add(BlockRegistry.BURNED_OAK_PLANKS.get(), + tag(BlockTags.PLANKS).add( + BlockRegistry.BURNED_OAK_PLANKS.get(), BlockRegistry.STARDUST_PLANKS.get()); // Slabs tag - tag(BlockTags.SLABS).add(BlockRegistry.CLOUD_MARBLE_BRICK_SLAB.get(), + tag(BlockTags.SLABS).add( + BlockRegistry.CLOUD_MARBLE_BRICK_SLAB.get(), BlockRegistry.BLOOD_SANDSTONE_SLAB.get(), BlockRegistry.SMOOTH_BLOOD_SANDSTONE_SLAB.get()); // Stairs tag - tag(BlockTags.STAIRS).add(BlockRegistry.CLOUD_MARBLE_BRICK_STAIRS.get(), + tag(BlockTags.STAIRS).add( + BlockRegistry.CLOUD_MARBLE_BRICK_STAIRS.get(), BlockRegistry.BLOOD_SANDSTONE_STAIRS.get(), BlockRegistry.SMOOTH_BLOOD_SANDSTONE_STAIRS.get()); @@ -106,35 +118,43 @@ private void addMinecraftTags() { tag(BlockTags.WALL_SIGNS).add(BlockRegistry.BURNED_OAK_SIGN.get()); // Wooden buttons tag - tag(BlockTags.WOODEN_BUTTONS).add(BlockRegistry.BURNED_OAK_BUTTON.get(), + tag(BlockTags.WOODEN_BUTTONS).add( + BlockRegistry.BURNED_OAK_BUTTON.get(), BlockRegistry.STARDUST_BUTTON.get()); // Wooden doors tag - tag(BlockTags.WOODEN_DOORS).add(BlockRegistry.BURNED_OAK_DOOR.get(), + tag(BlockTags.WOODEN_DOORS).add( + BlockRegistry.BURNED_OAK_DOOR.get(), BlockRegistry.STARDUST_DOOR.get()); // Wooden fences tag - tag(BlockTags.WOODEN_FENCES).add(BlockRegistry.BURNED_OAK_FENCE.get(), + tag(BlockTags.WOODEN_FENCES).add( + BlockRegistry.BURNED_OAK_FENCE.get(), BlockRegistry.STARDUST_FENCE.get()); // Wooden pressure plates tag - tag(BlockTags.WOODEN_PRESSURE_PLATES).add(BlockRegistry.BURNED_OAK_PRESSURE_PLATE.get(), + tag(BlockTags.WOODEN_PRESSURE_PLATES).add( + BlockRegistry.BURNED_OAK_PRESSURE_PLATE.get(), BlockRegistry.STARDUST_PRESSURE_PLATE.get()); // Wooden slabs tag - tag(BlockTags.WOODEN_SLABS).add(BlockRegistry.BURNED_OAK_SLAB.get(), + tag(BlockTags.WOODEN_SLABS).add( + BlockRegistry.BURNED_OAK_SLAB.get(), BlockRegistry.STARDUST_SLAB.get()); // Wooden stairs tag - tag(BlockTags.WOODEN_STAIRS).add(BlockRegistry.BURNED_OAK_STAIRS.get(), + tag(BlockTags.WOODEN_STAIRS).add( + BlockRegistry.BURNED_OAK_STAIRS.get(), BlockRegistry.STARDUST_STAIRS.get()); // Wooden trapdoors tag - tag(BlockTags.WOODEN_TRAPDOORS).add(BlockRegistry.BURNED_OAK_TRAPDOOR.get(), + tag(BlockTags.WOODEN_TRAPDOORS).add( + BlockRegistry.BURNED_OAK_TRAPDOOR.get(), BlockRegistry.STARDUST_TRAPDOOR.get()); // Small flowers tag - tag(BlockTags.SMALL_FLOWERS).add(BlockRegistry.AZUL_STAINED_ORCHID.get(), + tag(BlockTags.SMALL_FLOWERS).add( + BlockRegistry.AZUL_STAINED_ORCHID.get(), BlockRegistry.MOONGLOW.get()); // Leaves tag @@ -147,8 +167,17 @@ private void addMinecraftTags() { tag(BlockTags.SAPLINGS).add(BlockRegistry.STARDUST_SAPLING.get()); // Walls tag - tag(BlockTags.WALLS).add(BlockRegistry.CLOUD_MARBLE_BRICK_WALL.get(), + tag(BlockTags.WALLS).add( + BlockRegistry.CLOUD_MARBLE_BRICK_WALL.get(), BlockRegistry.BLOOD_SANDSTONE_WALL.get()); + + // Beacon base tag + tag(BlockTags.BEACON_BASE_BLOCKS) + .add(BlockRegistry.COBALT_BLOCK.get()) + .add(BlockRegistry.MOLTEN_BLOCK.get()) + .add(BlockRegistry.TESLA_BLOCK.get()) + .add(BlockRegistry.ASTRAL_BLOCK.get()) + .add(BlockRegistry.STARSTORM_BLOCK.get()); } /** diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java index 0e7cfad58..cd90d2028 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java @@ -50,13 +50,17 @@ private void addForgeTags() { // Copy item tags from block tags copy(Blocks.STAINED_GLASS, Tags.Items.STAINED_GLASS); copy(ForgeBlockTagGroups.COBALT_ORES, ForgeItemTagGroups.COBALT_ORES); + copy(ForgeBlockTagGroups.SULFUR_ORES, ForgeItemTagGroups.SULFUR_ORES); copy(Blocks.ORES, Tags.Items.ORES); // Ingot tags tag(ForgeItemTagGroups.COBALT_INGOTS).add(ItemRegistry.COBALT_INGOT.get()); tag(Tags.Items.INGOTS_COPPER).add(Items.COPPER_INGOT); - tag(ForgeItemTagGroups.METAL_INGOTS).addTags(ForgeItemTagGroups.COBALT_INGOTS, Tags.Items.INGOTS_COPPER, - Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_GOLD); + tag(ForgeItemTagGroups.METAL_INGOTS).addTags( + ForgeItemTagGroups.COBALT_INGOTS, + Tags.Items.INGOTS_COPPER, + Tags.Items.INGOTS_IRON, + Tags.Items.INGOTS_GOLD); tag(Tags.Items.INGOTS).addTag(ForgeItemTagGroups.METAL_INGOTS); tag(Tags.Items.INGOTS).addTag(IWItemTagGroups.MOLTEN_INGOTS); tag(Tags.Items.INGOTS).addTag(IWItemTagGroups.ELECTRIC_INGOTS); @@ -67,8 +71,11 @@ private void addForgeTags() { // Nugget tags tag(ForgeItemTagGroups.COBALT_NUGGETS).add(ItemRegistry.COBALT_NUGGET.get()); tag(ForgeItemTagGroups.COPPER_NUGGETS).add(ItemRegistry.COPPER_NUGGET.get()); - tag(ForgeItemTagGroups.METAL_NUGGETS).addTags(ForgeItemTagGroups.COBALT_NUGGETS, ForgeItemTagGroups.COPPER_NUGGETS, - Tags.Items.NUGGETS_IRON, Tags.Items.NUGGETS_GOLD); + tag(ForgeItemTagGroups.METAL_NUGGETS).addTags( + ForgeItemTagGroups.COBALT_NUGGETS, + ForgeItemTagGroups.COPPER_NUGGETS, + Tags.Items.NUGGETS_IRON, + Tags.Items.NUGGETS_GOLD); tag(Tags.Items.NUGGETS).addTag(ForgeItemTagGroups.METAL_NUGGETS); tag(Tags.Items.NUGGETS).addTag(IWItemTagGroups.TESLA_NUGGETS); tag(Tags.Items.NUGGETS).addTag(IWItemTagGroups.ASTRAL_NUGGETS); @@ -99,13 +106,14 @@ private void addForgeTags() { } } - tag(Tags.Items.TOOLS_BOWS) - .add(ItemRegistry.ICE_BOW.get()) - .add(ItemRegistry.DRAGONS_BREATH_BOW.get()) - .add(ItemRegistry.AURORA_BOW.get()); + tag(Tags.Items.TOOLS_BOWS).add( + ItemRegistry.ICE_BOW.get(), + ItemRegistry.DRAGONS_BREATH_BOW.get(), + ItemRegistry.AURORA_BOW.get()); // Head tags - tag(Tags.Items.HEADS).add(BlockItemRegistry.MINUTEMAN_HEAD_ITEM.get(), + tag(Tags.Items.HEADS).add( + BlockItemRegistry.MINUTEMAN_HEAD_ITEM.get(), BlockItemRegistry.FIELD_MEDIC_HEAD_ITEM.get(), BlockItemRegistry.DYING_SOLDIER_HEAD_ITEM.get(), BlockItemRegistry.WANDERING_WARRIOR_HEAD_ITEM.get(), @@ -206,7 +214,8 @@ private void addMinecraftTags() { tag(ItemTags.CHEST_BOATS).add(ItemRegistry.STARDUST_CHEST_BOAT.get()); // Non-flammable wood tag - tag(ItemTags.NON_FLAMMABLE_WOOD).add(BlockItemRegistry.WARPED_TABLE_ITEM.get(), + tag(ItemTags.NON_FLAMMABLE_WOOD).add( + BlockItemRegistry.WARPED_TABLE_ITEM.get(), BlockItemRegistry.CRIMSON_TABLE_ITEM.get()); // Trimmable armor tag @@ -215,5 +224,14 @@ private void addMinecraftTags() { tag(ItemTags.TRIMMABLE_ARMOR).add(armor); } } + + // Beacon payment tag + tag(ItemTags.BEACON_PAYMENT_ITEMS).add( + ItemRegistry.COBALT_INGOT.get(), + ItemRegistry.MOLTEN_INGOT.get(), + ItemRegistry.TESLA_INGOT.get(), + ItemRegistry.VENTUS_SHARD.get(), + ItemRegistry.ASTRAL_INGOT.get(), + ItemRegistry.STARSTORM_INGOT.get()); } } \ No newline at end of file diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java index 775b99c93..ec209c475 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java @@ -13,4 +13,6 @@ public class ForgeBlockTagGroups { "stained_glass")); public static final TagKey COBALT_ORES = BlockTags.create(new ResourceLocation("forge", "ores/cobalt")); + public static final TagKey SULFUR_ORES = BlockTags.create(new ResourceLocation("forge", + "ores/sulfur")); } \ No newline at end of file diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java index 6f3333a0f..1a44393b5 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java @@ -9,6 +9,8 @@ public class ForgeItemTagGroups { public static final TagKey COBALT_ORES = ItemTags.create(new ResourceLocation("forge", "ores/cobalt")); + public static final TagKey SULFUR_ORES = ItemTags.create(new ResourceLocation("forge", + "ores/sulfur")); public static final TagKey COBALT_INGOTS = ItemTags.create(new ResourceLocation("forge", "ingots/cobalt")); public static final TagKey METAL_INGOTS = ItemTags.create(new ResourceLocation("forge", diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java index 7ea88bb4c..84cc38ee0 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java @@ -84,7 +84,7 @@ public LavaRevenantEntity(EntityType entityType, L public static AttributeSupplier.Builder registerAttributes() { return Monster.createMonsterAttributes() .add(Attributes.FLYING_SPEED, 0.70D) - .add(Attributes.ARMOR, 35.0D); + .add(Attributes.ARMOR, 20.0D); } @Override @@ -330,11 +330,10 @@ private boolean checkWalls(AABB pArea) { BlockPos pos = new BlockPos(i, lMinY, lMinZ); BlockState state = level().getBlockState(pos); if (!state.isAir()) { - if (ForgeHooks.canEntityDestroy(level(), pos, this) - && state.getDestroySpeed(level(), pos) <= 1.5f) { + if (ForgeHooks.canEntityDestroy(level(), pos, this) && state.getDestroySpeed(level(), pos) <= 1.5f) { blockRemoved = level().removeBlock(pos, false) || blockRemoved; - } else { + } else if (!state.liquid()) { stuck = true; } } diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/event/ClientForgeEventSubscriber.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/event/ClientForgeEventSubscriber.java index 0540d2ed0..3eef352e6 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/event/ClientForgeEventSubscriber.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/event/ClientForgeEventSubscriber.java @@ -8,6 +8,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; @@ -124,6 +125,29 @@ public static void computeFovEvent(ComputeFov event) { if (GunData.changingPlayerFOV != -1 && minecraft.options.getCameraType().isFirstPerson()) { event.setFOV(GunData.changingPlayerFOV); } + + // Handle FOV change of custom bows + if (minecraft.player != null) { + Item itemInHand = minecraft.player.getItemInHand(minecraft.player.getUsedItemHand()).getItem(); + if ((itemInHand == ItemRegistry.ICE_BOW.get() + || itemInHand == ItemRegistry.DRAGONS_BREATH_BOW.get() + || itemInHand == ItemRegistry.AURORA_BOW.get()) + && minecraft.player.isUsingItem()) { + + double fov = event.getFOV(); + int useTicks = minecraft.player.getTicksUsingItem(); + float fovModifier = (float) useTicks / 20.0F; + + if (fovModifier > 1.0F) { + fovModifier = 1.0F; + } else { + fovModifier *= fovModifier; + } + + fov *= 1.0F - fovModifier * 0.15F; + event.setFOV(fov); + } + } } diff --git a/src/main/resources/data/immersiveweapons/dimension/tiltros.json b/src/main/resources/data/immersiveweapons/dimension/tiltros.json index 94ddf514c..d84612417 100644 --- a/src/main/resources/data/immersiveweapons/dimension/tiltros.json +++ b/src/main/resources/data/immersiveweapons/dimension/tiltros.json @@ -9,11 +9,11 @@ { "biome": "immersiveweapons:tiltros_wastes", "parameters": { - "temperature": 0.1, - "humidity": 0.2, + "temperature": 0.6, + "humidity": 0.25, "continentalness": 1.0, "erosion": 0.85, - "weirdness": 0.5, + "weirdness": 0.1, "depth": 0.3, "offset": 0.0 } @@ -21,11 +21,11 @@ { "biome": "immersiveweapons:starlight_plains", "parameters": { - "temperature": 0.1, + "temperature": 0.6, "humidity": 0.3, "continentalness": 1.0, "erosion": 0.7, - "weirdness": 0.3, + "weirdness": 0.1, "depth": 0.3, "offset": 0.0 } @@ -33,11 +33,11 @@ { "biome": "immersiveweapons:deadmans_desert", "parameters": { - "temperature": 0.001, + "temperature": 0.2, "humidity": 0.1, "continentalness": 1.0, "erosion": 0.75, - "weirdness": 0.1, + "weirdness": 0.3, "depth": 0.3, "offset": 0.0 } From e8c77f2422c99a91466ff58eb611ccfdaf352f9d Mon Sep 17 00:00:00 2001 From: Nicholas Smit Date: Sat, 21 Oct 2023 13:35:57 -0400 Subject: [PATCH 2/3] More bugfixes Fix Evil Eyes not dropping XP. Add blood sand to the smelts_to_glass block and item tags. Add missing flare tooltip. Fix barbed wire fence dealing no damage. Fix spotlights leaving light blocks behind when the block they are attached to is destroyed. --- .../assets/immersiveweapons/lang/en_us.json | 1 + .../tags/blocks/smelts_to_glass.json | 5 ++ .../minecraft/tags/items/smelts_to_glass.json | 5 ++ .../block/SpotlightBlock.java | 64 ++----------------- .../block/barbed_wire/BarbedWireUtils.java | 20 ++++-- .../data/CustomDataGenerator.java | 6 +- .../data/lang/LanguageGenerator.java | 1 + .../data/tags/BlockTagsGenerator.java | 3 + .../data/tags/ItemTagsGenerator.java | 1 + .../entity/monster/EvilEyeEntity.java | 2 +- 10 files changed, 42 insertions(+), 66 deletions(-) create mode 100644 src/generated/resources/data/minecraft/tags/blocks/smelts_to_glass.json create mode 100644 src/generated/resources/data/minecraft/tags/items/smelts_to_glass.json diff --git a/src/generated/resources/assets/immersiveweapons/lang/en_us.json b/src/generated/resources/assets/immersiveweapons/lang/en_us.json index c5076d481..5a9ff4c0d 100644 --- a/src/generated/resources/assets/immersiveweapons/lang/en_us.json +++ b/src/generated/resources/assets/immersiveweapons/lang/en_us.json @@ -1131,6 +1131,7 @@ "tooltip.immersiveweapons.emerald_ring": "Provides the Hero of the Village effect", "tooltip.immersiveweapons.explosive_cannonball": "Similar to the cannonball but explodes on impact.", "tooltip.immersiveweapons.first_aid_kit": "An effective method of healing, combining the effects of bandages and painkillers", + "tooltip.immersiveweapons.flare": "Brightly illuminates the area around it.", "tooltip.immersiveweapons.flare_gun": "Launch bright flares into the sky", "tooltip.immersiveweapons.flintlock_pistol": "A basic flintlock firearm that excels in medium-range combat.", "tooltip.immersiveweapons.gauntlet": "Beat the life out of your opponents.", diff --git a/src/generated/resources/data/minecraft/tags/blocks/smelts_to_glass.json b/src/generated/resources/data/minecraft/tags/blocks/smelts_to_glass.json new file mode 100644 index 000000000..462cef718 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/blocks/smelts_to_glass.json @@ -0,0 +1,5 @@ +{ + "values": [ + "immersiveweapons:blood_sand" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/items/smelts_to_glass.json b/src/generated/resources/data/minecraft/tags/items/smelts_to_glass.json new file mode 100644 index 000000000..462cef718 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/items/smelts_to_glass.json @@ -0,0 +1,5 @@ +{ + "values": [ + "immersiveweapons:blood_sand" + ] +} \ No newline at end of file diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/SpotlightBlock.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/SpotlightBlock.java index 7b5c89634..f6b83fb9a 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/SpotlightBlock.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/SpotlightBlock.java @@ -23,35 +23,17 @@ public class SpotlightBlock extends HorizontalDirectionalBlock implements Simple private static final BlockState airState = Blocks.AIR.defaultBlockState(); private static final BlockState lightState = Blocks.LIGHT.defaultBlockState(); - /** - * Constructor for SpotlightBlock. - * - * @param properties the Properties of the block - */ public SpotlightBlock(Properties properties) { super(properties); registerDefaultState(stateDefinition.any().setValue(WATERLOGGED, false).setValue(FACING, Direction.NORTH) .setValue(LIT, false)); } - /** - * Create the BlockState definition. - * - * @param builder the StateContainer.Builder of the block - */ @Override public void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(WATERLOGGED, FACING, LIT); } - /** - * Determines if the block can exist in a given state. - * - * @param state the BlockState of the block - * @param reader the LevelReader for the block - * @param pos the BlocKPos the block is at - * @return boolean - */ @Override public boolean canSurvive(BlockState state, LevelReader reader, BlockPos pos) { Direction direction = state.getValue(FACING); @@ -60,17 +42,6 @@ public boolean canSurvive(BlockState state, LevelReader reader, BlockPos pos) { return stateOpposite.isFaceSturdy(reader, positionOpposite, direction); } - /** - * Updates the block when required. - * - * @param stateIn the BlockState of the block - * @param facing the Direction the block is facing - * @param facingState the BlockState of the facing block - * @param levelAccessor the LevelAccessor the block is in - * @param currentPos the BlockPos the block is at - * @param facingPos the BlocKPos the facing block is at - * @return BlockState - */ @Override public BlockState updateShape(BlockState stateIn, Direction facing, BlockState facingState, LevelAccessor levelAccessor, BlockPos currentPos, BlockPos facingPos) { @@ -86,28 +57,11 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { .setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER); } - /** - * Set FluidState properties. - * Allows the block to exhibit waterlogged behavior. - * - * @param state the BlockState of the block - * @return FluidState - */ @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - /** - * Runs when neighboring blocks change state. - * - * @param state the BlockState of the block - * @param level the Level the block is in - * @param pos the BlockPos the block is at - * @param blockIn the Block that is changing - * @param fromPos the BlockPos of the changing block - * @param isMoving determines if the block is moving - */ @Override public void neighborChanged(BlockState state, Level level, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) { @@ -125,15 +79,6 @@ public void neighborChanged(BlockState state, Level level, BlockPos pos, Block b } } - /** - * Runs when neighboring blocks change state. - * - * @param state the BlockState of the block - * @param level the Level the block is in - * @param pos the BlockPos the block is at - * @param oldState the BlockState the block previously had - * @param isMoving determines if the block is moving - */ @Override public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) { if (!oldState.is(state.getBlock())) { @@ -173,9 +118,12 @@ private void stateToggled(BlockPos pos, Level level, BlockState state, boolean l } @Override - public void destroy(LevelAccessor pLevel, BlockPos pPos, BlockState pState) { - super.destroy(pLevel, pPos, pState); - stateToggled(pPos, (Level) pLevel, pState, true); + public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) { + super.onRemove(state, level, pos, newState, isMoving); + + if (newState == airState) { + stateToggled(pos, level, state, true); + } } /** diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/barbed_wire/BarbedWireUtils.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/barbed_wire/BarbedWireUtils.java index aa6f7cb39..197246976 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/barbed_wire/BarbedWireUtils.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/block/barbed_wire/BarbedWireUtils.java @@ -25,11 +25,23 @@ default void handleEntityContact(BlockState state, Level level, BlockPos pos, En return; } - if (level.getBlockEntity(pos) instanceof DamageableBlockEntity damageable && level.getGameTime() % 10 == 0) { - if (!level.isClientSide) { - entity.hurt(IWDamageSources.BARBED_WIRE, damageable.calculateDamage(2.0f, 0.25f)); + boolean shouldHurt = false; + float damage = 2.0f; + + if (level.getBlockEntity(pos) instanceof DamageableBlockEntity damageable) { + if (level.getGameTime() % 10 == 0) { + shouldHurt = true; + damageable.takeDamage(state, level, pos, BarbedWireBlock.DAMAGE_STAGE); + damage = damageable.calculateDamage(2.0f, 0.25f); + } + } else { + if (level.getGameTime() % 10 == 0) { + shouldHurt = true; } - damageable.takeDamage(state, level, pos, BarbedWireBlock.DAMAGE_STAGE); + } + + if (shouldHurt && !level.isClientSide) { + entity.hurt(IWDamageSources.BARBED_WIRE, damage); } } } diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java index 0efdf77f4..2c5693b22 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java @@ -42,9 +42,9 @@ public static void gatherData(GatherDataEvent event) { ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); // Client data - generator.addProvider(event.includeClient(), new BlockStateGenerator(output, event.getExistingFileHelper())); - generator.addProvider(event.includeClient(), new ItemModelGenerator(output, event.getExistingFileHelper())); - generator.addProvider(event.includeClient(), new SoundGenerator(output, ImmersiveWeapons.MOD_ID, event.getExistingFileHelper())); + generator.addProvider(event.includeClient(), new BlockStateGenerator(output, existingFileHelper)); + generator.addProvider(event.includeClient(), new ItemModelGenerator(output, existingFileHelper)); + generator.addProvider(event.includeClient(), new SoundGenerator(output, ImmersiveWeapons.MOD_ID, existingFileHelper)); generator.addProvider(event.includeClient(), new LanguageGenerator(output)); // Server data diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java index 2347228ef..123f454e5 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/lang/LanguageGenerator.java @@ -353,6 +353,7 @@ private void addTooltips() { addTooltip("starstorm_musket_ball", "A musket ball made from Starstorm. Strongest caliber in terms of raw damage."); addTooltip("cannonball", "A heavy metal ball that can be fired from a hand cannon."); addTooltip("explosive_cannonball", "Similar to the cannonball but explodes on impact."); + addTooltip("flare", "Brightly illuminates the area around it."); // Projectile metadata addTooltip("bullet.meta.base_damage", "Base Damage: %s"); addTooltip("bullet.meta.gravity_modifier", "Gravity Modifier: %s"); diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java index 0e672c419..ae2a83b3f 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java @@ -178,6 +178,9 @@ private void addMinecraftTags() { .add(BlockRegistry.TESLA_BLOCK.get()) .add(BlockRegistry.ASTRAL_BLOCK.get()) .add(BlockRegistry.STARSTORM_BLOCK.get()); + + // Smelts-to-glass tag + tag(BlockTags.SMELTS_TO_GLASS).add(BlockRegistry.BLOOD_SAND.get()); } /** diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java index cd90d2028..2866b2c60 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/data/tags/ItemTagsGenerator.java @@ -198,6 +198,7 @@ private void addMinecraftTags() { copy(BlockTags.SAND, ItemTags.SAND); copy(BlockTags.SAPLINGS, ItemTags.SAPLINGS); copy(BlockTags.WALLS, ItemTags.WALLS); + copy(BlockTags.SMELTS_TO_GLASS, ItemTags.SMELTS_TO_GLASS); // Sign tags tag(ItemTags.SIGNS).add(BlockItemRegistry.BURNED_OAK_SIGN_ITEM.get()); diff --git a/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/EvilEyeEntity.java b/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/EvilEyeEntity.java index 5b63b9fe5..9f8c60e52 100644 --- a/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/EvilEyeEntity.java +++ b/src/main/java/tech/anonymoushacker1279/immersiveweapons/entity/monster/EvilEyeEntity.java @@ -215,9 +215,9 @@ protected void registerGoals() { public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstance pDifficulty, MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) { - xpReward = 3 * getSize(); setSize(getRandom().nextIntBetweenInclusive(1, 3)); setHealth(getMaxHealth()); + xpReward = summonedByStaff() ? 0 : 3 * getSize(); return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag); } From 8dc0fd9d884887051b909f88dfcaaf2cc56ea8cd Mon Sep 17 00:00:00 2001 From: Nicholas Smit Date: Sat, 21 Oct 2023 18:02:44 -0400 Subject: [PATCH 3/3] Prepare for release Bump versions and prepare for release. --- RELEASE_NOTES.md | 52 ++++++++++++------------------------------------ update.json | 5 +++-- 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e50f5b16e..c5499573f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,45 +1,19 @@ -This major update reworks ammunition crafting and tweaks firearms. As usual, there is a handful of other new features. +This minor update includes a batch of bugfixes and improvements. ### Feature Changes / Additions -- Rework ammunition crafting - - Added a new Ammunition Table, which is used to craft musket balls - - Materials are added into the table (ingots, nuggets, shards, etc.), and the table will calculate the amount of - ammunition that can be crafted from the inputs - - The table provides a "Density" modifier, which allows ammunition to be weighted at the cost of more materials - - Higher density ammunition will deal more damage, but will not travel as far -- Implement powder system - - Firearms now require a form of powder to be used. Either gunpowder, blackpowder, or sulfur dust can be used - - Potassium Nitrate ore has been added, the drops of which can be used to craft gunpowder or blackpowder - - The quality of powders, from best to worst, is gunpowder, blackpowder, and sulfur dust - - Powder quality affects the following: - - Fire velocity - - Firearm damage taken - - Smoke produced - - Chance to consume powder -- Firearms are now affected by the environment - - When underwater, there is a 90% misfire chance and bullet velocity is reduced by 50% - - When raining, bullet velocity is reduced by 30% - - When in powdered snow, bullet velocity is reduced by 20% - - These effects can be partially mitigated by equipping the Powder Horn accessory -- Increased generation rate of sulfur ore in the overworld -- Added a shift tooltip to bullet-like items, exposing some of the hidden stats -- Added three new bows - - Ice Bow - arrows slow targets on impact - - Dragon's Breath Bow - arrows explode on impact - - Aurora Bow - arrows experience 4x less gravity -- Added knockback resistance to Super Hans +- Adjusted generation weights of biomes in Tiltros, to make Tiltros Wastes less rare +- Add protection-like enchantments to the Skygazer max level configuration (at level 5) +- Add ores tag for sulfur +- Add blood sand to the `smelts_to_glass` block and item tags +- Update translation keys for enchantment numbers up to 100 ### Bugfixes -- Fix Minutemen spawned from statues not having weapons -- Add missing endgame ingots to the `ingots.json` tag -- Update death message translations to address some missing cases and fix some existing ones not displaying as expected -- Fix quick stacking out of Tesla Synthesizer slots -- Fix item stacks getting empty tags out of - nowhere ([Fixes #105](https://github.com/AnonymousHacker1279/ImmersiveWeapons/issues/105)) -- Fix Velocity enchantment not being applicable to crossbows - -### Other Improvements - -- Massive cleanups to projectile-related classes, significantly reducing code duplication across similar projectiles \ No newline at end of file +- Fix 3rd person models for custom bows not using the proper parent model +- Fix custom bows not changing player FOV when drawing +- Fix Lava Revenants getting stuck when flying into water +- Fix Evil Eyes not dropping XP +- Add missing flare tooltip +- Fix barbed wire fences dealing no damage +- Fix spotlights leaving behind light blocks when the block they are attached to is broken \ No newline at end of file diff --git a/update.json b/update.json index c1c858922..80cd27b00 100644 --- a/update.json +++ b/update.json @@ -1,8 +1,8 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/immersive-weapons", "promos": { - "1.20.1-latest": "1.20.1-1.27.0", - "1.20.1-recommended": "1.20.1-1.27.0", + "1.20.1-latest": "1.20.1-1.27.1", + "1.20.1-recommended": "1.20.1-1.27.1", "1.19.4-latest": "1.19.4-1.23.2", "1.19.4-recommended": "1.19.4-1.23.2", "1.19.3-latest": "1.19.3-1.21.0", @@ -23,6 +23,7 @@ "1.16.4-recommended": "1.16.5-1.1.1" }, "1.20.1": { + "1.20.1-1.27.1": "Bugfixes and improvements - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.27.1", "1.20.1-1.27.0": "Features, improvements, bugfixes - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.27.0", "1.20.1-1.26.2": "Bugfixes and improvements - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.26.2", "1.20.1-1.26.1": "Bugfixes and improvements - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.26.1",