From fac46ce4388a9c64021ad8dc146b0df46189fdfb Mon Sep 17 00:00:00 2001 From: LocusAzzurro Date: Sat, 15 Jul 2023 15:27:26 +0200 Subject: [PATCH] :arrow_up: 1.19.4 port --- gradle.properties | 14 +- .../103d9f3f36b01595f1aa5172191e60eff02e6924 | 3 + .../3ad3c4526bc19707067928568367be95fefa33f1 | 1 + .../636274dd245a3d898f68344c2253b73cd985170e | 1 + .../75b6aaf6155f06a86b4bbdd88db80e772c960ed5 | 7 + .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 1 + src/generated/resources/.cache/cache | 15 --- .../fe29277b4ba34f8d18bfab3b93fec645bdce4cdb | 10 ++ .../damage_type/spear.json | 5 + .../damage_type/time_rift.json | 5 + .../tags/items/colored_feathers.json | 1 - .../tags/items/crop_grains.json | 1 - .../tags/items/crop_strings.json | 1 - .../tags/items/fallen_relics.json | 1 - .../tags/items/herbs.json | 4 - .../tags/items/restored_fallen_relics.json | 1 - .../tags/items/synapse_armor.json | 1 - .../tags/items/world_essences.json | 1 - .../tags/items/world_ingots.json | 1 - .../tags/blocks/mineable/pickaxe.json | 1 - .../tags/blocks/mineable/shovel.json | 1 - .../tags/blocks/needs_iron_tool.json | 1 - .../tags/blocks/needs_stone_tool.json | 1 - .../data/minecraft/tags/blocks/wool.json | 1 - .../{carpets.json => wool_carpets.json} | 1 - .../icaruswings/blocks/ElysianGrass.java | 3 +- .../icaruswings/blocks/GreekFireBlock.java | 14 +- .../blocks/GreekFireFluidType.java | 2 +- .../icaruswings/damage/DamageTimeRift.java | 19 --- .../icaruswings/data/ModArmorMaterial.java | 15 ++- .../icaruswings/data/ModDamageSources.java | 34 ++++- .../icaruswings/data/ModData.java | 11 ++ .../icaruswings/data/ModGroup.java | 20 --- .../datagen/BaseLootTableProvider.java | 124 ------------------ .../datagen/BlockLootTableProvider.java | 25 ++++ .../datagen/BlockStatesGenerator.java | 5 +- .../datagen/BlockTagsGenerator.java | 14 +- .../datagen/DamageTagsGenerator.java | 26 ++++ .../icaruswings/datagen/DataGenerators.java | 32 ++++- .../datagen/ItemModelsGenerator.java | 5 +- .../datagen/ItemTagsGenerator.java | 14 +- .../datagen/LootTableProvider.java | 15 +++ .../datagen/LootTablesGenerator.java | 17 --- .../icaruswings/datagen/RecipesGenerator.java | 22 +--- .../effect/EffectInevitability.java | 2 +- .../effect/EffectSensoryMasking.java | 9 +- .../ench/EnchantmentBlessingOfTheSky.java | 4 +- .../ench/EnchantmentCollisionProtection.java | 22 ++-- .../entity/ArtemisMissileEntity.java | 15 +-- .../icaruswings/entity/GoldenRamEntity.java | 3 +- .../icaruswings/entity/KayrosBlastEntity.java | 7 +- .../icaruswings/entity/SpearEntity.java | 10 +- .../icaruswings/entity/TimeBombEntity.java | 13 +- .../entity/TimeRiftParticleEntity.java | 5 +- .../event/ModClientRenderEventHandler.java | 15 ++- .../event/ModCommonEventHandler.java | 17 ++- .../items/AbstractTransportCard.java | 3 +- .../icaruswings/items/AbstractWings.java | 7 +- .../icaruswings/items/AirJar.java | 5 +- .../icaruswings/items/Anemone.java | 3 +- .../icaruswings/items/ArtemisLauncher.java | 3 +- .../icaruswings/items/ArtemisMissile.java | 3 +- .../icaruswings/items/Beeswax.java | 3 +- .../icaruswings/items/BeeswaxArmor.java | 22 +--- .../icaruswings/items/ColoredFeather.java | 3 +- .../icaruswings/items/DaedalusDecryptor.java | 3 +- .../icaruswings/items/Demeter.java | 5 +- .../icaruswings/items/FallenRelic.java | 3 +- .../icaruswings/items/FeatherArmor.java | 7 +- .../icaruswings/items/FeatherBunch.java | 3 +- .../locusazzurro/icaruswings/items/Flax.java | 3 +- .../icaruswings/items/FlaxSeeds.java | 3 +- .../icaruswings/items/GemCurrency.java | 3 +- .../icaruswings/items/GlassJar.java | 3 +- .../icaruswings/items/GoldenFeather.java | 3 +- .../icaruswings/items/GoldenFleece.java | 3 +- .../icaruswings/items/GoldenFleeceArmor.java | 10 +- .../icaruswings/items/GoldenRamSpawnEgg.java | 3 +- .../icaruswings/items/GoldenString.java | 3 +- .../icaruswings/items/GrainsMeal.java | 3 +- .../icaruswings/items/GreekFireBucket.java | 3 +- .../icaruswings/items/HerbBunch.java | 3 +- .../icaruswings/items/HerbalAccessory.java | 5 +- .../items/InterdictionFieldTransportCard.java | 21 +-- .../locusazzurro/icaruswings/items/Linen.java | 3 +- .../icaruswings/items/LinenCloth.java | 5 +- .../icaruswings/items/LinenString.java | 3 +- .../icaruswings/items/MagicMembrane.java | 3 +- .../icaruswings/items/MagicalAnemone.java | 3 +- .../items/MaskingFieldTransportCard.java | 7 +- .../locusazzurro/icaruswings/items/Mead.java | 3 +- .../icaruswings/items/MelonItem.java | 3 +- .../icaruswings/items/PhilosopherStone.java | 3 +- .../icaruswings/items/QuantumFuel.java | 3 +- .../icaruswings/items/RefinedBeeswaxBar.java | 3 +- .../icaruswings/items/SkyMusicDisc.java | 3 +- .../icaruswings/items/SpearItem.java | 5 +- .../icaruswings/items/SteelPickaxe.java | 3 +- .../icaruswings/items/SynapseAlloySword.java | 3 +- .../icaruswings/items/SynapseArmor.java | 11 +- .../icaruswings/items/SynapseRepairKit.java | 3 +- .../items/SynapseWingsRecharger.java | 3 +- .../items/TeleportTransportCard.java | 19 ++- .../icaruswings/items/TimeRiftCharge.java | 3 +- .../icaruswings/items/TimeRiftGenerator.java | 3 +- .../icaruswings/items/WheatGrains.java | 20 ++- .../icaruswings/items/WheatString.java | 3 +- .../icaruswings/items/WindWand.java | 3 +- .../icaruswings/items/WorldEssence.java | 3 +- .../icaruswings/items/WorldIngot.java | 3 +- .../icaruswings/items/WorldIngotMaterial.java | 3 +- .../registry/DamageTypeRegistry.java | 20 +++ .../icaruswings/registry/ItemRegistry.java | 54 ++++---- .../icaruswings/registry/SoundRegistry.java | 78 +++++------ .../render/models/SpearBakedModel.java | 13 +- .../renderers/ArtemisMissileRenderer.java | 7 +- .../SpearItemStackTileEntityRenderer.java | 3 +- .../render/renderers/SpearRenderer.java | 7 +- .../icaruswings/utils/MathUtils.java | 29 ++-- .../locusazzurro_icaruswings/lang/en_us.json | 8 +- .../locusazzurro_icaruswings/lang/zh_cn.json | 8 +- .../tags/damage_type/bypasses_armor.json | 6 + 122 files changed, 542 insertions(+), 582 deletions(-) create mode 100644 src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 create mode 100644 src/generated/resources/.cache/3ad3c4526bc19707067928568367be95fefa33f1 create mode 100644 src/generated/resources/.cache/636274dd245a3d898f68344c2253b73cd985170e create mode 100644 src/generated/resources/.cache/75b6aaf6155f06a86b4bbdd88db80e772c960ed5 create mode 100644 src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e delete mode 100644 src/generated/resources/.cache/cache create mode 100644 src/generated/resources/.cache/fe29277b4ba34f8d18bfab3b93fec645bdce4cdb create mode 100644 src/generated/resources/data/locusazzurro_icaruswings/damage_type/spear.json create mode 100644 src/generated/resources/data/locusazzurro_icaruswings/damage_type/time_rift.json rename src/generated/resources/data/minecraft/tags/blocks/{carpets.json => wool_carpets.json} (78%) delete mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/damage/DamageTimeRift.java delete mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModGroup.java delete mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BaseLootTableProvider.java create mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockLootTableProvider.java create mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DamageTagsGenerator.java create mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTableProvider.java delete mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTablesGenerator.java create mode 100644 src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/DamageTypeRegistry.java create mode 100644 src/main/resources/data/locusazzurro_icaruswings/tags/damage_type/bypasses_armor.json diff --git a/gradle.properties b/gradle.properties index 0462e9c9..61a7d2c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # Mod -version=1.19.2-0.5.0 +version=1.19.4-0.5.1 mod_group=org.mineplugin.locusazzurro.icaruswings mod_id=locusazzurro_icaruswings mod_name=Icarus Wings @@ -13,11 +13,11 @@ mod_credits=Contributors on GitHub and all who supported development. mod_icon=icarus_wings.png # Dependencies -minecraft_version=1.19.2 -minecraft_version_range=[1.19.2] -forge_version=43.2.0 -forge_version_range=[43,) -loader_version_range=[43,) +minecraft_version=1.19.4 +minecraft_version_range=[1.19.4] +forge_version=45.1.0 +forge_version_range=[45,) +loader_version_range=[45,) mappings_channel=official -mappings_version=1.19.2 +mappings_version=1.19.4 mixin_version=0.8.4 \ No newline at end of file diff --git a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 new file mode 100644 index 00000000..ed84a1dd --- /dev/null +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -0,0 +1,3 @@ +// 1.19.4 2023-07-15T14:23:06.4598326 Registries +763791e06f5c4ed4d0050991e7e3c0c6ea8b233b data/locusazzurro_icaruswings/damage_type/spear.json +91d8a4c4673f585a6c9e320542ca3d96c355297f data/locusazzurro_icaruswings/damage_type/time_rift.json diff --git a/src/generated/resources/.cache/3ad3c4526bc19707067928568367be95fefa33f1 b/src/generated/resources/.cache/3ad3c4526bc19707067928568367be95fefa33f1 new file mode 100644 index 00000000..f994124c --- /dev/null +++ b/src/generated/resources/.cache/3ad3c4526bc19707067928568367be95fefa33f1 @@ -0,0 +1 @@ +// 1.19.4 2023-07-15T14:23:06.453831 Item Models: locusazzurro_icaruswings diff --git a/src/generated/resources/.cache/636274dd245a3d898f68344c2253b73cd985170e b/src/generated/resources/.cache/636274dd245a3d898f68344c2253b73cd985170e new file mode 100644 index 00000000..4a8a28d1 --- /dev/null +++ b/src/generated/resources/.cache/636274dd245a3d898f68344c2253b73cd985170e @@ -0,0 +1 @@ +// 1.19.4 2023-07-15T14:23:06.4558333 Block States: locusazzurro_icaruswings diff --git a/src/generated/resources/.cache/75b6aaf6155f06a86b4bbdd88db80e772c960ed5 b/src/generated/resources/.cache/75b6aaf6155f06a86b4bbdd88db80e772c960ed5 new file mode 100644 index 00000000..5fc22f3d --- /dev/null +++ b/src/generated/resources/.cache/75b6aaf6155f06a86b4bbdd88db80e772c960ed5 @@ -0,0 +1,7 @@ +// 1.19.4 2023-07-15T14:23:06.4608334 Icarus WingsBlock Tags +979e25ed888a5b20cda2e2dc21e351998f39b80e data/minecraft/tags/blocks/mineable/pickaxe.json +ff9f99cbd343a66dce509bf27bebcc63722eb35d data/minecraft/tags/blocks/mineable/shovel.json +56bb632cd5fdd7cbeda8e09be29e0b908a983f9a data/minecraft/tags/blocks/needs_iron_tool.json +967c11dbf3deb9d153a4175268222efc8b5f94fe data/minecraft/tags/blocks/needs_stone_tool.json +f8a20788de08f2ee43580cbaae130bc1047d6734 data/minecraft/tags/blocks/wool.json +0dbfd1ccd4c1029ebbd512b4eca46286318dcc5f data/minecraft/tags/blocks/wool_carpets.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e new file mode 100644 index 00000000..b2db7088 --- /dev/null +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -0,0 +1 @@ +// 1.19.4 2023-07-15T14:23:06.4558333 Recipes diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache deleted file mode 100644 index a3f2b50f..00000000 --- a/src/generated/resources/.cache/cache +++ /dev/null @@ -1,15 +0,0 @@ -dec6805bd84ef56d22751a3c93b17fad53b7b2d3 data/locusazzurro_icaruswings/tags/items/colored_feathers.json -4e93380b8758f06ce3f4e968ff2c01320a73f35b data/locusazzurro_icaruswings/tags/items/crop_grains.json -4bb81e83b83c935b2c1b3d56855647bb9561a059 data/locusazzurro_icaruswings/tags/items/crop_strings.json -7a45634acc1b40e3ec358437c956b9cec08da319 data/locusazzurro_icaruswings/tags/items/fallen_relics.json -61f4a81de57056bf632de586636852a424f884a1 data/locusazzurro_icaruswings/tags/items/herbs.json -3a4778edf52575c14664ebac5c5194cb0994add5 data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json -1157694eb327e0e4bbd028d3301e8c6139d7fe56 data/locusazzurro_icaruswings/tags/items/synapse_armor.json -564183efd35a5c9e0404e687f8c6e8d4fc76ea62 data/locusazzurro_icaruswings/tags/items/world_essences.json -12e1534f86819b7f0d86e10f9225f4851c37a77c data/locusazzurro_icaruswings/tags/items/world_ingots.json -b45d97961efdd11d96922b5d28aa4a301182b939 data/minecraft/tags/blocks/carpets.json -ccf7d4c643f82a57cee10c5867be2f5ea9c27795 data/minecraft/tags/blocks/mineable/pickaxe.json -de3e2d925114e60e1aa33374d5d486813068fc28 data/minecraft/tags/blocks/mineable/shovel.json -4cb80df53727707e8990472698efccb673d2ae81 data/minecraft/tags/blocks/needs_iron_tool.json -eb7264fb42c2fa194f558413bb098241728e8c5a data/minecraft/tags/blocks/needs_stone_tool.json -70b92a528397b68b612541041c71f9c0ba5d3dda data/minecraft/tags/blocks/wool.json diff --git a/src/generated/resources/.cache/fe29277b4ba34f8d18bfab3b93fec645bdce4cdb b/src/generated/resources/.cache/fe29277b4ba34f8d18bfab3b93fec645bdce4cdb new file mode 100644 index 00000000..495be659 --- /dev/null +++ b/src/generated/resources/.cache/fe29277b4ba34f8d18bfab3b93fec645bdce4cdb @@ -0,0 +1,10 @@ +// 1.19.4 2023-07-15T14:23:06.454832 Icarus WingsItem Tags +b7e91efe4995c4b86573a2bd926e4182eee7cdec data/locusazzurro_icaruswings/tags/items/colored_feathers.json +d66b65c515fdb20ffc9c22a41ecd1bc17b61d0f6 data/locusazzurro_icaruswings/tags/items/crop_grains.json +1f8ac3247f3d11f23b38d6da6f4916a06e72aa05 data/locusazzurro_icaruswings/tags/items/crop_strings.json +3a890ef8d740b0103c0e54a67c55349a6e1f966b data/locusazzurro_icaruswings/tags/items/fallen_relics.json +31b4f1eaa4dd3828a846f05b4b2ec79cf961cb3d data/locusazzurro_icaruswings/tags/items/herbs.json +7e5a857845e9eedfba30a8556abe866ecce677d6 data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json +32f3b055773092e08427b0ce90302c627390d345 data/locusazzurro_icaruswings/tags/items/synapse_armor.json +e588fd94a320df5a6b4e19ca18827ce2374f7656 data/locusazzurro_icaruswings/tags/items/world_essences.json +a83382822f5079fc344889eeba2d88894566d277 data/locusazzurro_icaruswings/tags/items/world_ingots.json diff --git a/src/generated/resources/data/locusazzurro_icaruswings/damage_type/spear.json b/src/generated/resources/data/locusazzurro_icaruswings/damage_type/spear.json new file mode 100644 index 00000000..dd65ea35 --- /dev/null +++ b/src/generated/resources/data/locusazzurro_icaruswings/damage_type/spear.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "spear", + "scaling": "when_caused_by_living_non_player" +} \ No newline at end of file diff --git a/src/generated/resources/data/locusazzurro_icaruswings/damage_type/time_rift.json b/src/generated/resources/data/locusazzurro_icaruswings/damage_type/time_rift.json new file mode 100644 index 00000000..e40ffee5 --- /dev/null +++ b/src/generated/resources/data/locusazzurro_icaruswings/damage_type/time_rift.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "time_rift", + "scaling": "when_caused_by_living_non_player" +} \ No newline at end of file diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/colored_feathers.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/colored_feathers.json index 636c3873..2be38693 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/colored_feathers.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/colored_feathers.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:red_feather", "locusazzurro_icaruswings:blue_feather", diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_grains.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_grains.json index 5ab4cd85..02811555 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_grains.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_grains.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:wheat_grains", "locusazzurro_icaruswings:flax_seeds" diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_strings.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_strings.json index e4399bf7..f4082c80 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_strings.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/crop_strings.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:wheat_string", "locusazzurro_icaruswings:linen_string" diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/fallen_relics.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/fallen_relics.json index 7a81b456..17007644 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/fallen_relics.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/fallen_relics.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:fallen_relic_core", "locusazzurro_icaruswings:fallen_relic_offensive", diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/herbs.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/herbs.json index 7cd617b6..b0a59fb3 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/herbs.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/herbs.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "#minecraft:small_flowers", "#minecraft:tall_flowers", @@ -7,8 +6,5 @@ "minecraft:fern", "minecraft:sea_pickle", "minecraft:sweet_berries" - ], - "remove": [ - "minecraft:wither_rose" ] } \ No newline at end of file diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json index a77ac026..cac09263 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/restored_fallen_relics.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:restored_fallen_relic_core", "locusazzurro_icaruswings:restored_fallen_relic_offensive", diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/synapse_armor.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/synapse_armor.json index 21d88e7e..f35b9673 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/synapse_armor.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/synapse_armor.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:synapse_helmet", "locusazzurro_icaruswings:synapse_chestplate", diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_essences.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_essences.json index 043f49f5..63da4612 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_essences.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_essences.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:zephir_essence", "locusazzurro_icaruswings:nether_essence", diff --git a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_ingots.json b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_ingots.json index b2ef6315..a95ed5b7 100644 --- a/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_ingots.json +++ b/src/generated/resources/data/locusazzurro_icaruswings/tags/items/world_ingots.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:steel_ingot", "locusazzurro_icaruswings:magma_ingot", diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 73bb16aa..b5f220ce 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:refined_beeswax_block", "locusazzurro_icaruswings:refined_beeswax_pillar", diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/shovel.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/shovel.json index 74ade7e9..919d85ee 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/shovel.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/shovel.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:elysian_soil", "locusazzurro_icaruswings:elysian_grass_block" diff --git a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json index 9aa944cf..7f165f01 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json +++ b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:mead_pot" ] diff --git a/src/generated/resources/data/minecraft/tags/blocks/needs_stone_tool.json b/src/generated/resources/data/minecraft/tags/blocks/needs_stone_tool.json index 320a8891..d98eaa37 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/needs_stone_tool.json +++ b/src/generated/resources/data/minecraft/tags/blocks/needs_stone_tool.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:refined_beeswax_block", "locusazzurro_icaruswings:refined_beeswax_pillar", diff --git a/src/generated/resources/data/minecraft/tags/blocks/wool.json b/src/generated/resources/data/minecraft/tags/blocks/wool.json index bcbdda85..345fd063 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/wool.json +++ b/src/generated/resources/data/minecraft/tags/blocks/wool.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:golden_wool_block" ] diff --git a/src/generated/resources/data/minecraft/tags/blocks/carpets.json b/src/generated/resources/data/minecraft/tags/blocks/wool_carpets.json similarity index 78% rename from src/generated/resources/data/minecraft/tags/blocks/carpets.json rename to src/generated/resources/data/minecraft/tags/blocks/wool_carpets.json index 103119e4..191e862c 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/carpets.json +++ b/src/generated/resources/data/minecraft/tags/blocks/wool_carpets.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "locusazzurro_icaruswings:golden_wool_carpet" ] diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/ElysianGrass.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/ElysianGrass.java index 78f91afa..e5af2ff1 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/ElysianGrass.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/ElysianGrass.java @@ -4,6 +4,7 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.TallGrassBlock; import net.minecraft.world.level.block.state.BlockBehaviour; @@ -27,7 +28,7 @@ protected boolean mayPlaceOn(BlockState stateIn, BlockGetter iBlockReader, Block } @Override - public boolean isValidBonemealTarget(BlockGetter p_176473_1_, BlockPos p_176473_2_, BlockState p_176473_3_, boolean p_176473_4_) { + public boolean isValidBonemealTarget(LevelReader p_255692_, BlockPos p_57326_, BlockState p_57327_, boolean p_57328_) { return false; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireBlock.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireBlock.java index e4719584..fdf153e3 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireBlock.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireBlock.java @@ -22,16 +22,16 @@ public GreekFireBlock(){ @SuppressWarnings("deprecation") @Override - public void entityInside(BlockState p_49260_, Level p_49261_, BlockPos p_49262_, Entity p_49263_) { - if (!p_49263_.fireImmune()) { - p_49263_.setRemainingFireTicks(p_49263_.getRemainingFireTicks() + 1); - if (p_49263_.getRemainingFireTicks() == 0) { - p_49263_.setSecondsOnFire(8); + public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) { + if (!entity.fireImmune()) { + entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1); + if (entity.getRemainingFireTicks() == 0) { + entity.setSecondsOnFire(8); } } - p_49263_.hurt(DamageSource.IN_FIRE, 4); - super.entityInside(p_49260_, p_49261_, p_49262_, p_49263_); + entity.hurt(level.damageSources().inFire(), 4); + super.entityInside(state, level, pos, entity); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireFluidType.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireFluidType.java index 7d8288c3..54647838 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireFluidType.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/blocks/GreekFireFluidType.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.shaders.FogShape; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.math.Vector3f; +import org.joml.Vector3f; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/damage/DamageTimeRift.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/damage/DamageTimeRift.java deleted file mode 100644 index ff40feb8..00000000 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/damage/DamageTimeRift.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.mineplugin.locusazzurro.icaruswings.damage; - -import net.minecraft.world.damagesource.EntityDamageSource; -import net.minecraft.world.entity.Entity; - -import javax.annotation.Nullable; - -public class DamageTimeRift extends EntityDamageSource { - - public DamageTimeRift(@Nullable Entity source){ - super("timeRift", source); - } - - @Override - public boolean isBypassArmor(){ - return true; - } - -} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModArmorMaterial.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModArmorMaterial.java index 53ce96f2..f8f42d26 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModArmorMaterial.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModArmorMaterial.java @@ -4,6 +4,7 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.tags.ItemTags; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.crafting.Ingredient; import net.minecraftforge.api.distmarker.Dist; @@ -71,15 +72,19 @@ public enum ModArmorMaterial implements ArmorMaterial { public String getName() { return this.name; } - + @Override - public int getDurabilityForSlot(EquipmentSlot slot) { - return HEALTH_PER_SLOT[slot.getIndex()] * this.durabilityMultiplier; + public int getDurabilityForType(ArmorItem.Type slot) { + return HEALTH_PER_SLOT[slot.getSlot().getIndex()] * this.durabilityMultiplier; } - + @Override + public int getDefenseForType(ArmorItem.Type type) { + return this.slotProtections[type.getSlot().getIndex()]; + } + public int getDefenseForSlot(EquipmentSlot slot) { - return this.slotProtections[slot.getIndex()]; + return this.slotProtections[slot.getIndex()]; } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModDamageSources.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModDamageSources.java index b9651a41..c582f486 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModDamageSources.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModDamageSources.java @@ -1,13 +1,41 @@ package org.mineplugin.locusazzurro.icaruswings.data; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.worldgen.BootstapContext; +import net.minecraft.resources.ResourceKey; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; -import org.mineplugin.locusazzurro.icaruswings.damage.DamageTimeRift; +import net.minecraft.world.level.Level; +import org.mineplugin.locusazzurro.icaruswings.registry.DamageTypeRegistry; +import net.minecraft.world.damagesource.DamageType; +import net.minecraft.core.Holder.Reference; public class ModDamageSources { - public static DamageSource timeRift(Entity source){ - return new DamageTimeRift(source); + public static void bootstrap(BootstapContext context) + { + context.register(DamageTypeRegistry.SPEAR, new DamageType("spear", 0.1F)); + context.register(DamageTypeRegistry.TIME_RIFT, new DamageType("time_rift", 0.1F)); + } + + public static Reference damageTypeReference(Level pLevel, ResourceKey type){ + return pLevel.registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(type); + } + + public static DamageSource spear(Level level, Entity projectile, Entity owner){ + return new DamageSource(damageTypeReference(level, DamageTypeRegistry.SPEAR), projectile, owner); + } + + public static DamageSource timeRift(Level level, Entity projectile, Entity owner){ + return new DamageSource(damageTypeReference(level, DamageTypeRegistry.TIME_RIFT), projectile, owner); + } + + public static DamageSource timeRift(Level level, Entity source){ + return new DamageSource(damageTypeReference(level, DamageTypeRegistry.TIME_RIFT), source); + } + + public static DamageSource timeRift(Level level){ + return new DamageSource(damageTypeReference(level, DamageTypeRegistry.TIME_RIFT)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModData.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModData.java index 61621b87..82ce4233 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModData.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModData.java @@ -5,6 +5,7 @@ import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.item.ArmorItem; import java.util.UUID; @@ -17,6 +18,16 @@ public class ModData { UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")}; + public static ImmutableMultimap.Builder createArmorModifierBuilder(ArmorItem.Type type, ModArmorMaterial material){ + ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); + UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[type.getSlot().getIndex()]; + builder.put(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", + (double) material.getDefenseForType(type), AttributeModifier.Operation.ADDITION)); + builder.put(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", + (double) material.getToughness(), AttributeModifier.Operation.ADDITION)); + return builder; + } + public static ImmutableMultimap.Builder createArmorModifierBuilder(EquipmentSlot slot, ModArmorMaterial material){ ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[slot.getIndex()]; diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModGroup.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModGroup.java deleted file mode 100644 index 125833f3..00000000 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/data/ModGroup.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.mineplugin.locusazzurro.icaruswings.data; - -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.ItemStack; -import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; - -public class ModGroup { - public static final CreativeModeTab itemGroup = new WingsGroup(); - - public static class WingsGroup extends CreativeModeTab { - public WingsGroup() { - super("icaruswings_group"); - } - - @Override - public ItemStack makeIcon() { - return new ItemStack(ItemRegistry.iconBadge.get()); - } - } -} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BaseLootTableProvider.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BaseLootTableProvider.java deleted file mode 100644 index 6f5b5c56..00000000 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BaseLootTableProvider.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.mineplugin.locusazzurro.icaruswings.datagen; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import net.minecraft.advancements.critereon.EnchantmentPredicate; -import net.minecraft.advancements.critereon.ItemPredicate; -import net.minecraft.advancements.critereon.MinMaxBounds; -import net.minecraft.data.CachedOutput; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.DataProvider; -import net.minecraft.data.loot.LootTableProvider; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.enchantment.Enchantments; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.storage.loot.LootPool; -import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraft.world.level.storage.loot.LootTables; -import net.minecraft.world.level.storage.loot.entries.AlternativesEntry; -import net.minecraft.world.level.storage.loot.entries.DynamicLoot; -import net.minecraft.world.level.storage.loot.entries.LootItem; -import net.minecraft.world.level.storage.loot.functions.*; -import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; -import net.minecraft.world.level.storage.loot.predicates.MatchTool; -import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider; -import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; -import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Map; - -/** - * @author DustW - **/ -public abstract class BaseLootTableProvider extends LootTableProvider { - - private static final Logger LOGGER = LogManager.getLogger(); - private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - - protected final Map lootTables = new HashMap<>(); - private final DataGenerator generator; - - public BaseLootTableProvider(DataGenerator dataGeneratorIn) { - super(dataGeneratorIn); - this.generator = dataGeneratorIn; - } - - protected abstract void addTables(); - - protected LootTable.Builder createStandardTable(String name, Block block, BlockEntityType type) { - LootPool.Builder builder = LootPool.lootPool() - .name(name) - .setRolls(ConstantValue.exactly(1)) - .add(LootItem.lootTableItem(block) - .apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY)) - .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) - .copy("Info", "BlockEntityTag.Info", CopyNbtFunction.MergeStrategy.REPLACE) - .copy("Inventory", "BlockEntityTag.Inventory", CopyNbtFunction.MergeStrategy.REPLACE) - .copy("Energy", "BlockEntityTag.Energy", CopyNbtFunction.MergeStrategy.REPLACE)) - .apply(SetContainerContents.setContents(type) - .withEntry(DynamicLoot.dynamicEntry(new ResourceLocation("minecraft", "contents")))) - ); - return LootTable.lootTable().withPool(builder); - } - - protected LootTable.Builder createSimpleTable(String name, Block block) { - LootPool.Builder builder = LootPool.lootPool() - .name(name) - .setRolls(ConstantValue.exactly(1)) - .add(LootItem.lootTableItem(block)); - return LootTable.lootTable().withPool(builder); - } - - protected LootTable.Builder createSilkTouchTable(String name, Block block, Item lootItem, float min, float max) { - LootPool.Builder builder = LootPool.lootPool() - .name(name) - .setRolls(ConstantValue.exactly(1)) - .add(AlternativesEntry.alternatives( - LootItem.lootTableItem(block) - .when(MatchTool.toolMatches(ItemPredicate.Builder.item() - .hasEnchantment(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1))))), - LootItem.lootTableItem(lootItem) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(min, max))) - .apply(ApplyBonusCount.addUniformBonusCount(Enchantments.BLOCK_FORTUNE, 1)) - .apply(ApplyExplosionDecay.explosionDecay()) - ) - ); - return LootTable.lootTable().withPool(builder); - } - - - @Override - public void run(CachedOutput cache) { - addTables(); - - Map tables = new HashMap<>(); - for (Map.Entry entry : lootTables.entrySet()) { - tables.put(entry.getKey().getLootTable(), entry.getValue().setParamSet(LootContextParamSets.BLOCK).build()); - } - writeTables(cache, tables); - } - - private void writeTables(CachedOutput cache, Map tables) { - Path outputFolder = this.generator.getOutputFolder(); - tables.forEach((key, lootTable) -> { - Path path = outputFolder.resolve("data/" + key.getNamespace() + "/loot_tables/" + key.getPath() + ".json"); - try { - DataProvider.saveStable(cache, LootTables.serialize(lootTable), path); - } catch (IOException e) { - LOGGER.error("Couldn't write loot table {}", path, e); - } - }); - } - - @Override - public String getName() { - return "MyTutorial LootTables"; - } -} \ No newline at end of file diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockLootTableProvider.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockLootTableProvider.java new file mode 100644 index 00000000..bcec7844 --- /dev/null +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockLootTableProvider.java @@ -0,0 +1,25 @@ +package org.mineplugin.locusazzurro.icaruswings.datagen; + +import net.minecraft.data.loot.BlockLootSubProvider; +import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.level.block.Block; +import net.minecraftforge.registries.RegistryObject; +import org.mineplugin.locusazzurro.icaruswings.registry.BlockRegistry; + +import java.util.Set; + +public class BlockLootTableProvider extends BlockLootSubProvider { + + public BlockLootTableProvider() { + super(Set.of(), FeatureFlags.REGISTRY.allFlags()); + } + + @Override + protected void generate() { + } + + @Override + protected Iterable getKnownBlocks() { + return BlockRegistry.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator; + } +} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockStatesGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockStatesGenerator.java index cc31204e..9e227fac 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockStatesGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockStatesGenerator.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraftforge.client.model.generators.BlockStateProvider; import net.minecraftforge.common.data.ExistingFileHelper; @@ -9,8 +10,8 @@ **/ public class BlockStatesGenerator extends BlockStateProvider { - public BlockStatesGenerator(DataGenerator gen, ExistingFileHelper helper) { - super(gen, DataGenerators.MOD_ID, helper); + public BlockStatesGenerator(PackOutput output, ExistingFileHelper existingFileHelper) { + super(output, DataGenerators.MOD_ID, existingFileHelper); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockTagsGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockTagsGenerator.java index 7fb615da..daea8947 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockTagsGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/BlockTagsGenerator.java @@ -1,22 +1,26 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.tags.BlockTagsProvider; +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; import net.minecraft.tags.BlockTags; +import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; +import org.jetbrains.annotations.Nullable; import org.mineplugin.locusazzurro.icaruswings.registry.BlockRegistry; +import java.util.concurrent.CompletableFuture; + /** * @author DustW **/ public class BlockTagsGenerator extends BlockTagsProvider { - public BlockTagsGenerator(DataGenerator generator, ExistingFileHelper helper) { - super(generator, DataGenerators.MOD_ID, helper); + public BlockTagsGenerator(PackOutput output, CompletableFuture lookupProvider, @Nullable ExistingFileHelper helper) { + super(output, lookupProvider, DataGenerators.MOD_ID, helper); } @Override - protected void addTags() { + protected void addTags(HolderLookup.Provider p_256380_) { tag(BlockTags.MINEABLE_WITH_PICKAXE) .add(BlockRegistry.refinedBeeswaxBlock.get()) .add(BlockRegistry.refinedBeeswaxPillar.get()) diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DamageTagsGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DamageTagsGenerator.java new file mode 100644 index 00000000..dca62454 --- /dev/null +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DamageTagsGenerator.java @@ -0,0 +1,26 @@ +package org.mineplugin.locusazzurro.icaruswings.datagen; + +import net.minecraft.core.HolderLookup; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.PackOutput; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.resources.ResourceKey; +import net.minecraft.tags.DamageTypeTags; +import net.minecraft.world.damagesource.DamageType; +import net.minecraftforge.common.data.ExistingFileHelper; +import org.mineplugin.locusazzurro.icaruswings.registry.DamageTypeRegistry; + +import javax.annotation.Nullable; +import java.util.concurrent.CompletableFuture; + +public class DamageTagsGenerator extends TagsProvider { + + public DamageTagsGenerator(PackOutput output, CompletableFuture provider, @Nullable ExistingFileHelper fh) { + super(output, Registries.DAMAGE_TYPE, provider, CompletableFuture.completedFuture(TagsProvider.TagLookup.empty()), DataGenerators.MOD_ID, fh); + } + @Override + protected void addTags(HolderLookup.Provider provider) { + tag(DamageTypeTags.BYPASSES_ARMOR).add(DamageTypeRegistry.TIME_RIFT); + } +} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DataGenerators.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DataGenerators.java index 6714f12c..f7d7603d 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DataGenerators.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/DataGenerators.java @@ -1,11 +1,21 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.core.registries.Registries; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; +import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; +import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; +import org.mineplugin.locusazzurro.icaruswings.data.ModDamageSources; import org.mineplugin.locusazzurro.icaruswings.data.ModData; +import java.util.Set; +import java.util.concurrent.CompletableFuture; + /** * @author DustW **/ @@ -14,16 +24,26 @@ public class DataGenerators { public static final String MOD_ID = ModData.MOD_ID; public static final String MOD_NAME = "Icarus Wings"; + private static final RegistrySetBuilder BUILDER = new RegistrySetBuilder() + .add(Registries.DAMAGE_TYPE, ModDamageSources::bootstrap); + @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); - generator.addProvider(event.includeServer(), new RecipesGenerator(generator)); - generator.addProvider(event.includeServer(), new LootTablesGenerator(generator)); - BlockTagsGenerator blockTags = new BlockTagsGenerator(generator, event.getExistingFileHelper()); + PackOutput output = generator.getPackOutput(); + ExistingFileHelper fh = event.getExistingFileHelper(); + CompletableFuture lookupProvider = event.getLookupProvider(); + + generator.addProvider(event.includeServer(), new RecipesGenerator(output)); + //generator.addProvider(event.includeServer(), LootTableProvider.create(output)); + + BlockTagsGenerator blockTags = new BlockTagsGenerator(output, lookupProvider, fh); generator.addProvider(event.includeServer(), blockTags); - generator.addProvider(event.includeServer(), new ItemTagsGenerator(generator, blockTags, event.getExistingFileHelper())); + generator.addProvider(event.includeServer(), new ItemTagsGenerator(output, lookupProvider, blockTags, fh)); + generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(output, event.getLookupProvider(), BUILDER, Set.of(ModData.MOD_ID))); + //generator.addProvider(event.includeServer(), new DamageTagsGenerator(output, lookupProvider, fh)); - generator.addProvider(event.includeClient(), new BlockStatesGenerator(generator, event.getExistingFileHelper())); - generator.addProvider(event.includeClient(), new ItemModelsGenerator(generator, event.getExistingFileHelper())); + generator.addProvider(event.includeClient(), new BlockStatesGenerator(output, fh)); + generator.addProvider(event.includeClient(), new ItemModelsGenerator(output, fh)); } } \ No newline at end of file diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemModelsGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemModelsGenerator.java index e0d5e61e..22478133 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemModelsGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemModelsGenerator.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; @@ -9,8 +10,8 @@ **/ public class ItemModelsGenerator extends ItemModelProvider { - public ItemModelsGenerator(DataGenerator generator, ExistingFileHelper existingFileHelper) { - super(generator, DataGenerators.MOD_ID, existingFileHelper); + public ItemModelsGenerator(PackOutput output, ExistingFileHelper existingFileHelper) { + super(output, DataGenerators.MOD_ID, existingFileHelper); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemTagsGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemTagsGenerator.java index b5f63c9d..f4e1a167 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemTagsGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/ItemTagsGenerator.java @@ -1,25 +1,29 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.tags.BlockTagsProvider; +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; import net.minecraft.data.tags.ItemTagsProvider; +import net.minecraft.data.tags.TagsProvider; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.Block; import net.minecraftforge.common.data.ExistingFileHelper; import org.mineplugin.locusazzurro.icaruswings.data.ModTags; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; +import java.util.concurrent.CompletableFuture; + /** * @author DustW **/ public class ItemTagsGenerator extends ItemTagsProvider { - public ItemTagsGenerator(DataGenerator generator, BlockTagsProvider blockTags, ExistingFileHelper helper) { - super(generator, blockTags, DataGenerators.MOD_ID, helper); + public ItemTagsGenerator(PackOutput output, CompletableFuture lookupProvider, TagsProvider blockTagProvider, ExistingFileHelper existingFileHelper) { + super(output, lookupProvider, blockTagProvider.contentsGetter(), DataGenerators.MOD_ID, existingFileHelper); } @Override - protected void addTags() { + protected void addTags(HolderLookup.Provider lookupProvider) { tag(ModTags.COLORED_FEATHERS) .add(ItemRegistry.redFeather.get()) diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTableProvider.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTableProvider.java new file mode 100644 index 00000000..cea116d3 --- /dev/null +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTableProvider.java @@ -0,0 +1,15 @@ +package org.mineplugin.locusazzurro.icaruswings.datagen; + +import net.minecraft.data.PackOutput; +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; + +import java.util.List; +import java.util.Set; + +public class LootTableProvider { + + public static net.minecraft.data.loot.LootTableProvider create(PackOutput output){ + return new net.minecraft.data.loot.LootTableProvider(output, Set.of(), + List.of(new net.minecraft.data.loot.LootTableProvider.SubProviderEntry(BlockLootTableProvider::new, LootContextParamSets.BLOCK))); + } +} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTablesGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTablesGenerator.java deleted file mode 100644 index b4ee48b6..00000000 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/LootTablesGenerator.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.mineplugin.locusazzurro.icaruswings.datagen; - -import net.minecraft.data.DataGenerator; - -/** - * @author DustW - **/ -public class LootTablesGenerator extends BaseLootTableProvider { - - public LootTablesGenerator(DataGenerator dataGeneratorIn) { - super(dataGeneratorIn); - } - - @Override - protected void addTables() { - } -} \ No newline at end of file diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/RecipesGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/RecipesGenerator.java index 09078e6a..34add5b1 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/RecipesGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/datagen/RecipesGenerator.java @@ -1,33 +1,23 @@ package org.mineplugin.locusazzurro.icaruswings.datagen; import net.minecraft.data.DataGenerator; +import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeProvider; +import net.minecraftforge.common.crafting.conditions.IConditionBuilder; import java.util.function.Consumer; /** * @author DustW **/ -public class RecipesGenerator extends RecipeProvider { +public class RecipesGenerator extends RecipeProvider implements IConditionBuilder { - public RecipesGenerator(DataGenerator generatorIn) { - super(generatorIn); + public RecipesGenerator(PackOutput output) { + super(output); } @Override - protected void buildCraftingRecipes(Consumer consumer) { - //合成表,你自己看看,unlockedBy 是必填项 - //ShapedRecipeBuilder - // .shaped(result item) - // .define('R', ) - // .define('B', ) - // .define('G', ) - // .define('Y', ) - // .define('C', ) - // .pattern("RRG") - // .pattern("YCG") - // .pattern("YBB") - // .unlockedBy("has_stone", has(Blocks.DIORITE)).save(consumer); + protected void buildRecipes(Consumer pFinishedRecipeConsumer) { } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectInevitability.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectInevitability.java index 605323b1..062b8182 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectInevitability.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectInevitability.java @@ -22,6 +22,6 @@ public int getMaxLevel() { @Override public void overflow(LivingEntity entity, int overflowLevel) { - entity.hurt(ModDamageSources.timeRift(entity), overflowLevel * 50); + entity.hurt(ModDamageSources.timeRift(entity.level), overflowLevel * 50); }; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectSensoryMasking.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectSensoryMasking.java index 4abf3c29..8442e028 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectSensoryMasking.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/effect/EffectSensoryMasking.java @@ -3,6 +3,7 @@ import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; +import net.minecraftforge.event.entity.living.LivingChangeTargetEvent; import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; @@ -17,11 +18,11 @@ public EffectSensoryMasking() { } @SubscribeEvent - public static void onSetTarget(LivingSetAttackTargetEvent e) { - if (e.getTarget() != null) { + public static void onSetTarget(LivingChangeTargetEvent e) { + if (e.getNewTarget() != null) { LivingEntity targeter = e.getEntity(); - if (e.getTarget().hasEffect(EffectRegistry.sensoryMasking.get()) && targeter instanceof Mob) { - ((Mob) targeter).setTarget(null); + if (e.getNewTarget().hasEffect(EffectRegistry.sensoryMasking.get()) && targeter instanceof Mob) { + ((Mob) targeter).setTarget(e.getOriginalTarget()); } } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentBlessingOfTheSky.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentBlessingOfTheSky.java index 805e0476..2166e8f9 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentBlessingOfTheSky.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentBlessingOfTheSky.java @@ -1,5 +1,6 @@ package org.mineplugin.locusazzurro.icaruswings.ench; +import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -37,7 +38,8 @@ public EnchantmentBlessingOfTheSky() { public boolean isDiscoverable() {return false;} private static boolean isValidDamageType(DamageSource damage){ - return damage.isExplosion() || damage.isFire() || damage.isProjectile() || damage.isMagic(); + return damage.is(DamageTypeTags.IS_EXPLOSION) || damage.is(DamageTypeTags.IS_FIRE) || + damage.is(DamageTypeTags.IS_PROJECTILE) || damage.is(DamageTypeTags.BYPASSES_ARMOR); } @SubscribeEvent diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentCollisionProtection.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentCollisionProtection.java index 9273e1a8..85ffd26d 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentCollisionProtection.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/ench/EnchantmentCollisionProtection.java @@ -1,6 +1,8 @@ package org.mineplugin.locusazzurro.icaruswings.ench; +import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraftforge.event.entity.living.LivingHurtEvent; @@ -14,29 +16,29 @@ public class EnchantmentCollisionProtection extends WingsEnchantment { public EnchantmentCollisionProtection() { super(Rarity.UNCOMMON); } - + @Override public int getMinLevel() {return 1;} - + @Override public int getMaxLevel() {return 3;} - + @Override public int getMinCost(int lvl) {return lvl * 10;} - + @Override public int getMaxCost(int lvl) {return getMinCost(lvl) + 5;} - + @Override public int getDamageProtection(int level, DamageSource source) { - if (source.isBypassInvul()) return 0; - if (source == DamageSource.FLY_INTO_WALL) return level * 3; + if (source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) return 0; + if (source.is(DamageTypes.FLY_INTO_WALL)) return level * 3; else return 0; } @SubscribeEvent public static void onEntityHurt(LivingHurtEvent e) { - if (e.getSource() == DamageSource.FLY_INTO_WALL){ + if (e.getSource().is(DamageTypes.FLY_INTO_WALL)){ int lvl = getWingsEnchantmentLevel(e.getEntity(), EnchantmentRegistry.collisionProtection.get()); int dmg = (int) (e.getAmount() * 0.1 * lvl); if (e.getEntity() instanceof LivingEntity){ @@ -44,7 +46,7 @@ public static void onEntityHurt(LivingHurtEvent e) { livingIn.getItemBySlot(EquipmentSlot.CHEST).hurtAndBreak(dmg, livingIn, e1 -> e1.broadcastBreakEvent((EquipmentSlot.CHEST))); } } - /* + /* if (e.getEntity() instanceof PlayerEntity){ PlayerEntity player = (PlayerEntity) e.getEntity(); ItemStack armor = player.getItemBySlot(EquipmentSlotType.CHEST); @@ -56,5 +58,5 @@ public static void onEntityHurt(LivingHurtEvent e) { } */ } - + } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/ArtemisMissileEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/ArtemisMissileEntity.java index 83d62a93..432d578d 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/ArtemisMissileEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/ArtemisMissileEntity.java @@ -5,14 +5,14 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.Mth; -import net.minecraft.world.damagesource.IndirectEntityDamageSource; +import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.AbstractHurtingProjectile; -import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.phys.BlockHitResult; @@ -153,7 +153,7 @@ protected void onHit(HitResult ray){ super.onHit(ray); if(!this.level.isClientSide){ boolean flag = ForgeEventFactory.getMobGriefingEvent(this.level, this.getOwner()); - this.level.explode(null, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower, flag, Explosion.BlockInteraction.NONE); + this.level.explode(null, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower, flag, Level.ExplosionInteraction.NONE); } this.discard(); } @@ -169,9 +169,8 @@ protected void onHitEntity(EntityHitResult ray){ if (!this.level.isClientSide) { Entity entity = ray.getEntity(); Entity owner = this.getOwner(); - entity.hurt( - (new IndirectEntityDamageSource("explosion", this, owner)).setExplosion() - , 8.0F); + DamageSource damageSource = this.level.damageSources().explosion(this, owner); + entity.hurt(damageSource, 8.0F); if (owner instanceof LivingEntity) { this.doEnchantDamageEffects((LivingEntity)owner, entity); } @@ -182,7 +181,7 @@ protected void onHitEntity(EntityHitResult ray){ protected void onEmptyFuel(){ if(!this.level.isClientSide){ boolean flag = ForgeEventFactory.getMobGriefingEvent(this.level, this.getOwner()); - this.level.explode(null, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower + 0.5f, flag, Explosion.BlockInteraction.NONE); + this.level.explode(null, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower + 0.5f, flag, Level.ExplosionInteraction.NONE); } this.discard(); } @@ -254,7 +253,7 @@ protected void defineSynchedData() { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/GoldenRamEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/GoldenRamEntity.java index a5d8fe96..ac8e33e8 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/GoldenRamEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/GoldenRamEntity.java @@ -3,6 +3,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -77,7 +78,7 @@ public void addAdditionalSaveData(CompoundTag compound) { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/KayrosBlastEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/KayrosBlastEntity.java index 940dd3fa..0bc97881 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/KayrosBlastEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/KayrosBlastEntity.java @@ -4,6 +4,7 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -87,7 +88,7 @@ public void onHitBlock(BlockHitResult ray){ } this.level.getEntitiesOfClass(LivingEntity.class, new AABB(pos).inflate(4)).forEach(e -> { ((EffectInevitability) EffectRegistry.inevitability.get()).addEffect(e, 3); - e.hurt(ModDamageSources.timeRift(this.getOwner()), 5.0f); + e.hurt(ModDamageSources.timeRift(this.level, this.getOwner()), 5.0f); }); ((ServerLevel)level).sendParticles(ParticleTypes.WITCH, pos.getX(), pos.getY(), pos.getZ(), @@ -102,7 +103,7 @@ protected void onHitEntity(EntityHitResult pResult) { Entity entity = pResult.getEntity(); if (entity instanceof LivingEntity livingEntity) { ((EffectInevitability) EffectRegistry.inevitability.get()).addEffect(livingEntity, 5); - livingEntity.hurt(ModDamageSources.timeRift(this.getOwner()), 15.0f); + livingEntity.hurt(ModDamageSources.timeRift(this.level, this.getOwner()), 15.0f); } } @@ -137,7 +138,7 @@ protected void defineSynchedData() { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/SpearEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/SpearEntity.java index 7b4efef4..d00bbb83 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/SpearEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/SpearEntity.java @@ -1,13 +1,14 @@ package org.mineplugin.locusazzurro.icaruswings.entity; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.IndirectEntityDamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; @@ -21,7 +22,9 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.network.NetworkHooks; +import org.mineplugin.locusazzurro.icaruswings.data.ModDamageSources; import org.mineplugin.locusazzurro.icaruswings.items.SpearItem; +import org.mineplugin.locusazzurro.icaruswings.registry.DamageTypeRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.EntityTypeRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -76,7 +79,8 @@ protected void onHitEntity(EntityHitResult ray) { } Entity owner = this.getOwner(); - DamageSource damageSource = new IndirectEntityDamageSource("spear", this, (owner == null ? this : owner)).setProjectile(); + DamageSource damageSource = ModDamageSources.spear(this.level, this, owner == null ? this : owner); + //DamageSource damageSource = new DamageSource(this.level.registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypeRegistry.SPEAR),this, owner == null ? this : owner); this.dealtDamage = true; SoundEvent soundevent = SoundRegistry.spearHit.get(); if (target.hurt(damageSource, f)) { @@ -168,7 +172,7 @@ public boolean shouldRender(double p_145770_1_, double p_145770_3_, double p_145 } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeBombEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeBombEntity.java index dcf9a459..4fff9631 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeBombEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeBombEntity.java @@ -1,20 +1,24 @@ package org.mineplugin.locusazzurro.icaruswings.entity; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundSource; +import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; import net.minecraftforge.network.NetworkHooks; -import org.mineplugin.locusazzurro.icaruswings.damage.DamageTimeRift; +import org.mineplugin.locusazzurro.icaruswings.data.ModDamageSources; +import org.mineplugin.locusazzurro.icaruswings.registry.DamageTypeRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.EntityTypeRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.ParticleRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -97,8 +101,9 @@ private void explode(){ Entity attachedTo = this.getAttachedTo(); AABB aabb = new AABB(r, r, r, -r, -r, -r).move(attachedTo.position()); List entities = attachedTo.level.getEntitiesOfClass(LivingEntity.class, aabb); + DamageSource damagesource = ModDamageSources.timeRift(this.level, attachedTo); for (LivingEntity entity : entities) { - entity.hurt(new DamageTimeRift(attachedTo), this.damage); + entity.hurt(damagesource, this.damage); } } this.discard(); @@ -115,7 +120,7 @@ private void moveToAttached(){ this.entityData.get(ATTACHED_TO_TARGET).ifPresent((e) -> { Entity attachedTo = this.level.getEntity(e); if (attachedTo != null) - this.setPos(attachedTo.getX(), attachedTo.getY(), attachedTo.getZ()); + this.setPos(attachedTo.getX(), attachedTo.getY(), attachedTo.getZ()); }); } @@ -175,7 +180,7 @@ protected void addAdditionalSaveData(CompoundTag nbt) { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeRiftParticleEntity.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeRiftParticleEntity.java index f0a95311..6f0a55c9 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeRiftParticleEntity.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/entity/TimeRiftParticleEntity.java @@ -3,6 +3,7 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; @@ -77,7 +78,7 @@ protected void onHitEntity(EntityHitResult ray){ if (!this.level.isClientSide) { Entity entity = ray.getEntity(); Entity owner = this.getOwner(); - entity.hurt(ModDamageSources.timeRift(owner), 2.0f); + entity.hurt(ModDamageSources.timeRift(entity.level, owner), 2.0f); if (entity instanceof LivingEntity) { ((EffectInevitability) EffectRegistry.inevitability.get()).addEffect((LivingEntity) entity, 1); } @@ -117,7 +118,7 @@ protected void defineSynchedData() { } @Override - public Packet getAddEntityPacket() { + public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModClientRenderEventHandler.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModClientRenderEventHandler.java index 832837ca..b3a7871b 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModClientRenderEventHandler.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModClientRenderEventHandler.java @@ -16,6 +16,7 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.event.EntityRenderersEvent; +import net.minecraftforge.client.event.ModelEvent; import net.minecraftforge.client.event.ModelEvent.BakingCompleted; import net.minecraftforge.client.event.RegisterParticleProvidersEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -56,7 +57,7 @@ public static void onClientSetup(FMLClientSetupEvent e){ } @SubscribeEvent - public static void onModelBaked(BakingCompleted e) { + public static void onModelBaked(ModelEvent.ModifyBakingResult e) { Map modelRegistry = e.getModels(); ModelResourceLocation location; for (RegistryObject spear : SPEARS){ @@ -104,12 +105,12 @@ public static void addWingsLayer(EntityRenderersEvent.AddLayers event){ @SubscribeEvent public static void onParticleFactoryRegister(RegisterParticleProvidersEvent event){ - event.register(ParticleRegistry.nullity.get(), NullityParticle.Factory::new); - event.register(ParticleRegistry.plasmaTrail.get(), PlasmaTrailParticle.Factory::new); - event.register(ParticleRegistry.electronicBit.get(), ElectronicBitParticle.Factory::new); - event.register(ParticleRegistry.goldenSparkleBase.get(), GoldenSparkleParticle.BaseFactory::new); - event.register(ParticleRegistry.goldenSparkle.get(), GoldenSparkleParticle.AdvFactory::new); - event.register(ParticleRegistry.timeRiftExplosion.get(), TimeRiftExplosionParticle.Factory::new); + event.registerSpriteSet(ParticleRegistry.nullity.get(), NullityParticle.Factory::new); + event.registerSpriteSet(ParticleRegistry.plasmaTrail.get(), PlasmaTrailParticle.Factory::new); + event.registerSpriteSet(ParticleRegistry.electronicBit.get(), ElectronicBitParticle.Factory::new); + event.registerSpriteSet(ParticleRegistry.goldenSparkleBase.get(), GoldenSparkleParticle.BaseFactory::new); + event.registerSpriteSet(ParticleRegistry.goldenSparkle.get(), GoldenSparkleParticle.AdvFactory::new); + event.registerSpriteSet(ParticleRegistry.timeRiftExplosion.get(), TimeRiftExplosionParticle.Factory::new); } private static void registerEntityRenderer(EntityType type, EntityRendererProvider renderer){ diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModCommonEventHandler.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModCommonEventHandler.java index c65cea94..0eabfa72 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModCommonEventHandler.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/event/ModCommonEventHandler.java @@ -1,14 +1,20 @@ package org.mineplugin.locusazzurro.icaruswings.event; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.event.CreativeModeTabEvent; import net.minecraftforge.event.entity.EntityAttributeCreationEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.registries.RegistryObject; +import org.mineplugin.locusazzurro.icaruswings.data.ModData; import org.mineplugin.locusazzurro.icaruswings.entity.GoldenRamEntity; import org.mineplugin.locusazzurro.icaruswings.network.ModPacketHandler; import org.mineplugin.locusazzurro.icaruswings.registry.EntityTypeRegistry; +import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +@Mod.EventBusSubscriber(modid = ModData.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModCommonEventHandler { @@ -21,4 +27,13 @@ public static void registerPacketHandlers(FMLCommonSetupEvent event) { public static void registerEntityAttributes(EntityAttributeCreationEvent e){ e.put(EntityTypeRegistry.goldenRamEntity.get(), GoldenRamEntity.setCustomAttributes().build()); } + + @SubscribeEvent + public static void buildContents(CreativeModeTabEvent.Register event) { + event.registerCreativeModeTab(new ResourceLocation(ModData.MOD_ID, "icaruswings"), builder -> builder + .icon(() -> ItemRegistry.iconBadge.get().getDefaultInstance()) + .title(Component.translatable("itemGroup.icaruswings_group")) + .displayItems((displayParameters, output) -> ItemRegistry.ITEMS.getEntries().stream().map(RegistryObject::get).forEach(output::accept)) + ); + } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractTransportCard.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractTransportCard.java index f667d229..2c80a009 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractTransportCard.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractTransportCard.java @@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable; import org.mineplugin.locusazzurro.icaruswings.data.ModConfig; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import java.util.List; @@ -25,7 +24,7 @@ public abstract class AbstractTransportCard extends Item { private CardType type; public AbstractTransportCard(CardType type){ - super(new Item.Properties().tab(ModGroup.itemGroup).rarity(Rarity.UNCOMMON)); + super(new Item.Properties().rarity(Rarity.UNCOMMON)); this.type = type; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractWings.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractWings.java index 23a5561d..806d19fa 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractWings.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AbstractWings.java @@ -10,7 +10,6 @@ import net.minecraft.world.item.Rarity; import net.minecraftforge.fml.common.Mod; import org.mineplugin.locusazzurro.icaruswings.data.IWingsType; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.data.WingsType; import javax.annotation.Nullable; @@ -22,17 +21,17 @@ public class AbstractWings extends ElytraItem { protected IWingsType type; protected AbstractWings(IWingsType type) { - super(new Properties().tab(ModGroup.itemGroup).durability(type.getDurability())); + super(new Properties().durability(type.getDurability())); this.type = type; } protected AbstractWings(IWingsType type, Rarity rarity) { - super(new Properties().tab(ModGroup.itemGroup).durability(type.getDurability()).rarity(rarity)); + super(new Properties().durability(type.getDurability()).rarity(rarity)); this.type = type; } protected AbstractWings() { - super(new Properties().tab(ModGroup.itemGroup).durability(WingsType.FEATHER.getDurability())); + super(new Properties().durability(WingsType.FEATHER.getDurability())); this.type = WingsType.FEATHER; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AirJar.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AirJar.java index 9c09bd31..698ce32a 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AirJar.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/AirJar.java @@ -1,6 +1,6 @@ package org.mineplugin.locusazzurro.icaruswings.items; -import com.mojang.math.Vector3f; +import org.joml.Vector3f; import net.minecraft.core.particles.DustParticleOptions; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.sounds.SoundSource; @@ -14,7 +14,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraftforge.items.ItemHandlerHelper; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -30,7 +29,7 @@ public class AirJar extends Item { private AirType type; public AirJar(AirType type) { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(16)); + super(new Properties().stacksTo(16)); this.type = type; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Anemone.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Anemone.java index 413e7c55..0e0201a7 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Anemone.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Anemone.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class Anemone extends Item{ public Anemone(){ - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisLauncher.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisLauncher.java index 3c1c685e..404760da 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisLauncher.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisLauncher.java @@ -10,7 +10,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ProjectileWeaponItem; import net.minecraft.world.level.Level; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.entity.ArtemisMissileEntity; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -21,7 +20,7 @@ public class ArtemisLauncher extends ProjectileWeaponItem { public ArtemisLauncher(){ - super(new Item.Properties().tab(ModGroup.itemGroup).durability(400)); + super(new Item.Properties().durability(400)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisMissile.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisMissile.java index c40f39a3..077f2376 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisMissile.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ArtemisMissile.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class ArtemisMissile extends Item{ public ArtemisMissile(){ - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Beeswax.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Beeswax.java index ff72f8f0..8182e208 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Beeswax.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Beeswax.java @@ -6,14 +6,13 @@ import net.minecraftforge.event.furnace.FurnaceFuelBurnTimeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; @Mod.EventBusSubscriber() public class Beeswax extends Item { public Beeswax() { - super(new Properties().tab(ModGroup.itemGroup).food(food)); + super(new Properties().food(food)); } private static final FoodProperties food = (new FoodProperties.Builder()) diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/BeeswaxArmor.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/BeeswaxArmor.java index 289f4936..c3fec3d3 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/BeeswaxArmor.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/BeeswaxArmor.java @@ -8,43 +8,33 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.Equipable; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Wearable; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import java.util.UUID; -public class BeeswaxArmor extends ArmorItem implements Wearable { +public class BeeswaxArmor extends ArmorItem implements Equipable { private static final ModArmorMaterial material = ModArmorMaterial.BEESWAX; private static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = ModData.ARMOR_MODIFIER_UUID_PER_SLOT; - public BeeswaxArmor(EquipmentSlot slot) { - super(material, slot, new Item.Properties().tab(ModGroup.itemGroup).defaultDurability(material.getDurabilityForSlot(slot))); + public BeeswaxArmor(ArmorItem.Type type) { + super(material, type, new Item.Properties().defaultDurability(material.getDurabilityForType(type))); } @Override public Multimap getDefaultAttributeModifiers(EquipmentSlot slot) { - return slot == this.slot ? this.getModifiersPerSlot(slot) : super.getDefaultAttributeModifiers(slot); + return slot == this.type.getSlot() ? this.getModifiersPerSlot(slot) : super.getDefaultAttributeModifiers(slot); } private Multimap getModifiersPerSlot(EquipmentSlot slot) { - /* - Builder builder = ImmutableMultimap.builder(); - UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[slot.getIndex()]; - builder.put(Attributes.ARMOR, new AttributeModifier(uuid, "Armor modifier", - (double) material.getDefenseForSlot(slot), AttributeModifier.Operation.ADDITION)); - builder.put(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(uuid, "Armor toughness", - (double) material.getToughness(), AttributeModifier.Operation.ADDITION)); - - */ Builder builder = ModData.createArmorModifierBuilder(slot, material); - if (slot == EquipmentSlot.FEET) { + if (slot == Type.BOOTS.getSlot()) { builder.put(Attributes.MOVEMENT_SPEED, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[slot.getIndex()], "movement_speed", 0.01f, AttributeModifier.Operation.ADDITION));} return builder.build(); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ColoredFeather.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ColoredFeather.java index 3eea1401..b0868053 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ColoredFeather.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/ColoredFeather.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class ColoredFeather extends Item { public ColoredFeather() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/DaedalusDecryptor.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/DaedalusDecryptor.java index 08bdce63..b76b19a8 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/DaedalusDecryptor.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/DaedalusDecryptor.java @@ -3,7 +3,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; public class DaedalusDecryptor extends Item { @@ -15,7 +14,7 @@ public DaedalusDecryptor() { } public DaedalusDecryptor(boolean isPersistent) { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(1).rarity(Rarity.UNCOMMON)); + super(new Properties().stacksTo(1).rarity(Rarity.UNCOMMON)); this.isPersistent = isPersistent; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Demeter.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Demeter.java index bad513fa..4f3aa70d 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Demeter.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Demeter.java @@ -18,7 +18,6 @@ import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; import org.mineplugin.locusazzurro.icaruswings.data.ModDamageSources; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.effect.EffectInevitability; import org.mineplugin.locusazzurro.icaruswings.entity.KayrosBlastEntity; import org.mineplugin.locusazzurro.icaruswings.registry.EffectRegistry; @@ -34,7 +33,7 @@ public class Demeter extends ProjectileWeaponItem { private static final float attackSpeed = -2.0f; private static final Multimap defaultModifiers; public Demeter(){ - super(new Item.Properties().tab(ModGroup.itemGroup).durability(600).rarity(Rarity.RARE)); + super(new Item.Properties().durability(600).rarity(Rarity.RARE)); } static { @@ -83,7 +82,7 @@ public boolean hurtEnemy(ItemStack pStack, LivingEntity pTarget, LivingEntity pA attacker.broadcastBreakEvent(EquipmentSlot.MAINHAND); }); ((EffectInevitability) EffectRegistry.inevitability.get()).addEffect(pTarget, 1); - pTarget.hurt(ModDamageSources.timeRift(pAttacker), 2.0f); + pTarget.hurt(ModDamageSources.timeRift(pTarget.level, pAttacker), 2.0f); return true; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FallenRelic.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FallenRelic.java index 495b08cb..d19eee11 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FallenRelic.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FallenRelic.java @@ -10,7 +10,6 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import java.util.List; @@ -21,7 +20,7 @@ public class FallenRelic extends Item{ private final boolean isUpgraded = false; public FallenRelic(RelicType type, boolean restored){ - super(new Item.Properties().tab(ModGroup.itemGroup).stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); + super(new Item.Properties().stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); this.relicType = type; this.isRestored = restored; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherArmor.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherArmor.java index 092abc89..23c6b60e 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherArmor.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherArmor.java @@ -5,17 +5,16 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Vanishable; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class FeatherArmor extends ArmorItem implements Vanishable { private static final ModArmorMaterial materialFeather = ModArmorMaterial.FEATHER; private static final ModArmorMaterial materialGoldenFeather = ModArmorMaterial.GOLDEN_FEATHER; - public FeatherArmor(EquipmentSlot slot, boolean isGolden) { + public FeatherArmor(ArmorItem.Type type, boolean isGolden) { super((isGolden ? materialGoldenFeather : materialFeather), - slot, new Item.Properties().tab(ModGroup.itemGroup) - .defaultDurability((isGolden ? materialGoldenFeather : materialFeather).getDurabilityForSlot(slot))); + type, new Item.Properties() + .defaultDurability((isGolden ? materialGoldenFeather : materialFeather).getDurabilityForType(type))); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherBunch.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherBunch.java index c0cdd221..5e3a90af 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherBunch.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FeatherBunch.java @@ -1,7 +1,6 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.data.WingsType; public class FeatherBunch extends Item { @@ -9,7 +8,7 @@ public class FeatherBunch extends Item { public WingsType type; public FeatherBunch(WingsType type) { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); this.type = type; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Flax.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Flax.java index 364f736a..719911a7 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Flax.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Flax.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class Flax extends Item{ public Flax() { - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FlaxSeeds.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FlaxSeeds.java index 5044bc85..125a016d 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FlaxSeeds.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/FlaxSeeds.java @@ -2,12 +2,11 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemNameBlockItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.BlockRegistry; public class FlaxSeeds extends ItemNameBlockItem { public FlaxSeeds() { - super(BlockRegistry.flaxCrop.get(), new Item.Properties().tab(ModGroup.itemGroup)); + super(BlockRegistry.flaxCrop.get(), new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GemCurrency.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GemCurrency.java index 63d4673f..ffa1dec7 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GemCurrency.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GemCurrency.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class GemCurrency extends Item{ public GemCurrency() { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(16)); + super(new Properties().stacksTo(16)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GlassJar.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GlassJar.java index eba3b98a..01192e03 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GlassJar.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GlassJar.java @@ -13,7 +13,6 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.registries.RegistryObject; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -21,7 +20,7 @@ public class GlassJar extends Item { public GlassJar(){ - super(new Item.Properties().tab(ModGroup.itemGroup).stacksTo(16)); + super(new Item.Properties().stacksTo(16)); } @SubscribeEvent diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFeather.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFeather.java index 5b8742bc..7cd728cf 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFeather.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFeather.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class GoldenFeather extends Item { public GoldenFeather() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleece.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleece.java index 1e21d719..9b16d7f2 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleece.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleece.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class GoldenFleece extends Item { public GoldenFleece() { - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleeceArmor.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleeceArmor.java index 5cef8ee8..ca15be94 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleeceArmor.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenFleeceArmor.java @@ -1,18 +1,16 @@ package org.mineplugin.locusazzurro.icaruswings.items; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ArmorItem; +import net.minecraft.world.item.Equipable; import net.minecraft.world.item.Item; -import net.minecraft.world.item.Wearable; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; -public class GoldenFleeceArmor extends ArmorItem implements Wearable { +public class GoldenFleeceArmor extends ArmorItem implements Equipable { private static final ModArmorMaterial material = ModArmorMaterial.GOLDEN_FLEECE; - public GoldenFleeceArmor(EquipmentSlot pSlot) { - super(material, pSlot, new Item.Properties().tab(ModGroup.itemGroup).defaultDurability(material.getDurabilityForSlot(pSlot))); + public GoldenFleeceArmor(Type type) { + super(material, type, new Item.Properties().defaultDurability(material.getDurabilityForType(type))); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenRamSpawnEgg.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenRamSpawnEgg.java index 9cb5afe4..282d7714 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenRamSpawnEgg.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenRamSpawnEgg.java @@ -1,7 +1,6 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraftforge.common.ForgeSpawnEggItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.EntityTypeRegistry; public class GoldenRamSpawnEgg extends ForgeSpawnEggItem { @@ -10,6 +9,6 @@ public class GoldenRamSpawnEgg extends ForgeSpawnEggItem { public GoldenRamSpawnEgg() { super(EntityTypeRegistry.goldenRamEntity, 15198183, 0xf2f1aa, - new Properties().tab(ModGroup.itemGroup)); + new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenString.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenString.java index 9688e16c..0eae4b5f 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenString.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GoldenString.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class GoldenString extends Item { public GoldenString() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GrainsMeal.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GrainsMeal.java index e5dfa548..57687dd9 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GrainsMeal.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GrainsMeal.java @@ -2,12 +2,11 @@ import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.BowlFoodItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class GrainsMeal extends BowlFoodItem { public GrainsMeal() { - super(new Properties().tab(ModGroup.itemGroup).food(food)); + super(new Properties().food(food)); } private static final FoodProperties food = (new FoodProperties.Builder()) diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GreekFireBucket.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GreekFireBucket.java index 8b9c4ec6..1bc192cd 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GreekFireBucket.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/GreekFireBucket.java @@ -2,12 +2,11 @@ import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.Items; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.FluidRegistry; public class GreekFireBucket extends BucketItem { public GreekFireBucket() { - super(FluidRegistry.greekFire, new Properties().tab(ModGroup.itemGroup).craftRemainder(Items.BUCKET)); + super(FluidRegistry.greekFire, new Properties().craftRemainder(Items.BUCKET)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbBunch.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbBunch.java index db42de50..a6db9acf 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbBunch.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbBunch.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class HerbBunch extends Item { public HerbBunch() { - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbalAccessory.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbalAccessory.java index 7b2d44c2..351fc681 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbalAccessory.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/HerbalAccessory.java @@ -5,14 +5,13 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Vanishable; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class HerbalAccessory extends ArmorItem implements Vanishable { private static final ModArmorMaterial material = ModArmorMaterial.HERBAL; - public HerbalAccessory(EquipmentSlot slot) { - super(material, slot, new Item.Properties().tab(ModGroup.itemGroup).defaultDurability(material.getDurabilityForSlot(slot))); + public HerbalAccessory(ArmorItem.Type type) { + super(material, type, new Item.Properties().defaultDurability(material.getDurabilityForType(type))); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/InterdictionFieldTransportCard.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/InterdictionFieldTransportCard.java index 43f0bfba..de94efa5 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/InterdictionFieldTransportCard.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/InterdictionFieldTransportCard.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.items; -import com.mojang.math.Vector3f; +import org.joml.Vector3d; +import org.joml.Vector3f; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; @@ -20,8 +21,8 @@ public class InterdictionFieldTransportCard extends AbstractTransportCard{ - private static final List PARTICLE_POINTS = MathUtils.fibonacciSphere(500); - private static final List LINE_ANCHORS = MathUtils.fibonacciSphere(50); + private static final List PARTICLE_POINTS = MathUtils.fibonacciSphere(500); + private static final List LINE_ANCHORS = MathUtils.fibonacciSphere(50); private static final float RANGE = 10; public InterdictionFieldTransportCard() { @@ -34,9 +35,9 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In if (worldIn.isClientSide()) { PARTICLE_POINTS.forEach((point) -> { - Vector3f rPoint = new Vector3f(point.scale(2)); - Vector3f[] expand = {new Vector3f(point.scale(0.3)), new Vector3f(point.scale(0.6)), new Vector3f(point.scale(0.9))}; - for (Vector3f vec : expand) { + Vector3d rPoint = new Vector3d(point.mul(2.0)); + Vector3d[] expand = {new Vector3d(point.mul(0.3)), new Vector3d(point.mul(0.6)), new Vector3d(point.mul(0.9))}; + for (Vector3d vec : expand) { worldIn.addParticle(ParticleTypes.END_ROD, playerIn.getX() + rPoint.x(), playerIn.getY() + rPoint.y(), @@ -45,12 +46,12 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In } }); LINE_ANCHORS.forEach((point) -> { - Vector3f rPoint = new Vector3f(point.scale(2)); - Vector3f[] expand = new Vector3f[10]; + Vector3d rPoint = new Vector3d(point.mul(2)); + Vector3d[] expand = new Vector3d[10]; for (int i = 0; i < expand.length; i++){ - expand[i] = new Vector3f(point.scale(0.1 * i)); + expand[i] = new Vector3d(point.mul(0.1 * i)); } - for (Vector3f vec : expand) { + for (Vector3d vec : expand) { worldIn.addParticle(ParticleTypes.END_ROD, playerIn.getX() + rPoint.x(), playerIn.getY() + rPoint.y(), diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Linen.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Linen.java index 9f0967ea..3645d37e 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Linen.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Linen.java @@ -1,10 +1,9 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class Linen extends Item { public Linen() { - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenCloth.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenCloth.java index 81af23d3..d6e38a95 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenCloth.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenCloth.java @@ -5,14 +5,13 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Vanishable; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class LinenCloth extends ArmorItem implements Vanishable { private static final ModArmorMaterial material = ModArmorMaterial.LINEN; - public LinenCloth(EquipmentSlot slot) { - super(material, slot, new Item.Properties().tab(ModGroup.itemGroup).defaultDurability(material.getDurabilityForSlot(slot))); + public LinenCloth(ArmorItem.Type type) { + super(material, type, new Item.Properties().defaultDurability(material.getDurabilityForType(type))); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenString.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenString.java index ac3b6e15..ee94d14c 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenString.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/LinenString.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class LinenString extends Item { public LinenString() { - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicMembrane.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicMembrane.java index f24d34b6..8e9b5571 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicMembrane.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicMembrane.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class MagicMembrane extends Item{ public MagicMembrane() { - super(new Item.Properties().tab(ModGroup.itemGroup).stacksTo(16)); + super(new Item.Properties().stacksTo(16)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicalAnemone.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicalAnemone.java index 31c95955..af4e92b6 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicalAnemone.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MagicalAnemone.java @@ -10,14 +10,13 @@ import net.minecraft.world.item.Rarity; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import java.util.List; public class MagicalAnemone extends Item { public MagicalAnemone(){ - super(new Item.Properties().tab(ModGroup.itemGroup).rarity(Rarity.UNCOMMON).stacksTo(1)); + super(new Item.Properties().rarity(Rarity.UNCOMMON).stacksTo(1)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MaskingFieldTransportCard.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MaskingFieldTransportCard.java index a9a95b49..b61bb1c3 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MaskingFieldTransportCard.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MaskingFieldTransportCard.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.items; -import com.mojang.math.Vector3f; +import org.joml.Vector3d; +import org.joml.Vector3f; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; @@ -20,7 +21,7 @@ public class MaskingFieldTransportCard extends AbstractTransportCard{ - private static final List PARTICLE_POINTS = MathUtils.cubeMatrixFrame(20); + private static final List PARTICLE_POINTS = MathUtils.cubeMatrixFrame(20); private static final float RANGE = 4; public MaskingFieldTransportCard() { @@ -36,7 +37,7 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In if (worldIn.isClientSide()) { PARTICLE_POINTS.forEach((point) -> { - Vector3f rPoint = new Vector3f(point.scale(0.4)); + Vector3d rPoint = new Vector3d(point.mul(0.4)); worldIn.addParticle(ParticleRegistry.electronicBit.get(), playerIn.getX(), playerIn.getY() + 0.5, playerIn.getZ(), rPoint.x(), rPoint.y(), rPoint.z()); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Mead.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Mead.java index a2682082..b5ad2e2e 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Mead.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/Mead.java @@ -26,7 +26,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraftforge.items.ItemHandlerHelper; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.*; import javax.annotation.Nullable; @@ -38,7 +37,7 @@ public class Mead extends Item { private Infusion infusionType = null; public Mead() { - super(new Properties().tab(ModGroup.itemGroup).food(food).stacksTo(4)); + super(new Properties().food(food).stacksTo(4)); } public Mead(Infusion type) { diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MelonItem.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MelonItem.java index c32e6bf2..fcbfed34 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MelonItem.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/MelonItem.java @@ -5,7 +5,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.BlockRegistry; import javax.annotation.Nullable; @@ -13,7 +12,7 @@ public class MelonItem extends BlockItem { public MelonItem() { - super(BlockRegistry.melon.get(), new Item.Properties().tab(ModGroup.itemGroup).rarity(Rarity.RARE)); + super(BlockRegistry.melon.get(), new Item.Properties().rarity(Rarity.RARE)); } @Nullable diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/PhilosopherStone.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/PhilosopherStone.java index db48db5a..5ee82da9 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/PhilosopherStone.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/PhilosopherStone.java @@ -5,13 +5,12 @@ import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; public class PhilosopherStone extends Item { public PhilosopherStone() { - super(new Item.Properties().tab(ModGroup.itemGroup).stacksTo(1).food(food)); + super(new Item.Properties().stacksTo(1).food(food)); } private static final FoodProperties food = (new FoodProperties.Builder()) diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/QuantumFuel.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/QuantumFuel.java index 4e2dbe2f..dbd5588f 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/QuantumFuel.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/QuantumFuel.java @@ -4,13 +4,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraftforge.fml.common.Mod; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; @Mod.EventBusSubscriber() public class QuantumFuel extends Item { public QuantumFuel() { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(4).rarity(Rarity.UNCOMMON)); + super(new Properties().stacksTo(4).rarity(Rarity.UNCOMMON)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/RefinedBeeswaxBar.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/RefinedBeeswaxBar.java index b8e6d8fc..d1af4424 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/RefinedBeeswaxBar.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/RefinedBeeswaxBar.java @@ -2,7 +2,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class RefinedBeeswaxBar extends Item{ @@ -12,7 +11,7 @@ public RefinedBeeswaxBar() { } public RefinedBeeswaxBar(boolean isGlistering) { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); this.isGlistering = isGlistering; } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SkyMusicDisc.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SkyMusicDisc.java index 1f088fea..0d33a17c 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SkyMusicDisc.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SkyMusicDisc.java @@ -4,7 +4,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Rarity; import net.minecraft.world.item.RecordItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; import java.util.function.Supplier; @@ -15,7 +14,7 @@ public class SkyMusicDisc extends RecordItem { private Track track; public SkyMusicDisc(Track track){ - super(track.getTrackNum(), track.getMusic(), new Item.Properties().tab(ModGroup.itemGroup).stacksTo(1).rarity(Rarity.RARE), track.length); + super(track.getTrackNum(), track.getMusic(), new Item.Properties().stacksTo(1).rarity(Rarity.RARE), track.length); } public Track getTrack() { diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SpearItem.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SpearItem.java index e07fe1d3..48863b66 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SpearItem.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SpearItem.java @@ -27,7 +27,6 @@ import net.minecraftforge.client.extensions.common.IClientItemExtensions; import net.minecraftforge.common.ForgeMod; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.entity.SpearEntity; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; import org.mineplugin.locusazzurro.icaruswings.render.renderers.SpearItemStackTileEntityRenderer; @@ -44,7 +43,7 @@ public class SpearItem extends TieredItem implements Vanishable { private static final float BASE_ATTACK_RANGE = 1.5f; public SpearItem(Tier tier) { - super(tier, new Properties().tab(ModGroup.itemGroup)); + super(tier, new Properties()); this.attackDamage = BASE_DAMAGE + tier.getAttackDamageBonus(); this.attackSpeed = BASE_ATTACK_SPEED; this.attackRange = BASE_ATTACK_RANGE; @@ -56,7 +55,7 @@ protected Multimap getModifiers(){ "Weapon modifier", this.attackDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", this.attackSpeed, AttributeModifier.Operation.ADDITION)); - builder.put(ForgeMod.ATTACK_RANGE.get(), new AttributeModifier(ModData.WEAPON_ATTACK_RANGE_UUID, + builder.put(ForgeMod.ENTITY_REACH.get(), new AttributeModifier(ModData.WEAPON_ATTACK_RANGE_UUID, "Weapon modifier", this.attackRange, AttributeModifier.Operation.ADDITION)); return builder.build(); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SteelPickaxe.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SteelPickaxe.java index 945f8184..668fee3f 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SteelPickaxe.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SteelPickaxe.java @@ -2,13 +2,12 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.PickaxeItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.data.ModItemTier; public class SteelPickaxe extends PickaxeItem { public SteelPickaxe() { - super(ModItemTier.STEEL, 1, -2.5F, new Item.Properties().tab(ModGroup.itemGroup)); + super(ModItemTier.STEEL, 1, -2.5F, new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseAlloySword.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseAlloySword.java index abc68504..6edcdf96 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseAlloySword.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseAlloySword.java @@ -2,14 +2,13 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.SwordItem; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.data.ModItemTier; public class SynapseAlloySword extends SwordItem { public SynapseAlloySword() { - super(ModItemTier.SYNAPSE_ALLOY, 4, -2.0F, new Item.Properties().tab(ModGroup.itemGroup)); + super(ModItemTier.SYNAPSE_ALLOY, 4, -2.0F, new Item.Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseArmor.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseArmor.java index 1416557a..48110ca9 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseArmor.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseArmor.java @@ -11,7 +11,6 @@ import net.minecraft.world.item.*; import org.mineplugin.locusazzurro.icaruswings.data.ModArmorMaterial; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import java.util.UUID; @@ -21,13 +20,13 @@ public class SynapseArmor extends ArmorItem implements Vanishable { private static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = ModData.ARMOR_MODIFIER_UUID_PER_SLOT; - public SynapseArmor(EquipmentSlot slot) { - super(material, slot, - new Item.Properties().tab(ModGroup.itemGroup).defaultDurability(material.getDurabilityForSlot(slot)).rarity(Rarity.RARE)); + public SynapseArmor(ArmorItem.Type type) { + super(material, type, + new Item.Properties().defaultDurability(material.getDurabilityForType(type)).rarity(Rarity.RARE)); } public Multimap getDefaultAttributeModifiers(EquipmentSlot slot) { - return slot == this.slot ? this.getModifiersPerSlot(slot) : super.getDefaultAttributeModifiers(slot); + return slot == this.type.getSlot() ? this.getModifiersPerSlot(slot) : super.getDefaultAttributeModifiers(slot); } private Multimap getModifiersPerSlot(EquipmentSlot slot) @@ -49,7 +48,7 @@ private Multimap getModifiersPerSlot(EquipmentSlot @Override public boolean isEnderMask(ItemStack stack, Player player, EnderMan endermanEntity) { - return (this.slot == EquipmentSlot.HEAD); + return (this.type == Type.HELMET); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseRepairKit.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseRepairKit.java index 4c7b7e5d..96668592 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseRepairKit.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseRepairKit.java @@ -2,12 +2,11 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Rarity; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class SynapseRepairKit extends Item{ public SynapseRepairKit() { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); + super(new Properties().stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseWingsRecharger.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseWingsRecharger.java index 21d321f9..ac440004 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseWingsRecharger.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/SynapseWingsRecharger.java @@ -3,12 +3,11 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class SynapseWingsRecharger extends Item{ public SynapseWingsRecharger() { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); + super(new Properties().stacksTo(1).fireResistant().rarity(Rarity.UNCOMMON)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TeleportTransportCard.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TeleportTransportCard.java index 2aab9389..f6b4231a 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TeleportTransportCard.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TeleportTransportCard.java @@ -2,6 +2,7 @@ import net.minecraft.core.Registry; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; @@ -17,6 +18,8 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.UseAnim; import net.minecraft.world.level.Level; +import net.minecraft.world.level.dimension.DimensionType; +import net.minecraft.world.level.dimension.LevelStem; import net.minecraft.world.phys.Vec3; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; import org.mineplugin.locusazzurro.icaruswings.utils.MathUtils; @@ -64,7 +67,7 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In else { worldIn.playSound(null, playerIn, SoundRegistry.transportCardFail.get(), SoundSource.PLAYERS, 1.0F, 1.0F); if (!worldIn.isClientSide()) - playerIn.sendSystemMessage(Component.translatable("item.locusazzurro_icaruswings.transport_card_teleport.error1")); + playerIn.sendSystemMessage(Component.translatable("item.locusazzurro_icaruswings.transport_card_teleport.error1")); playerIn.getCooldowns().addCooldown(this, 20); return InteractionResultHolder.pass(itemstack); } @@ -90,11 +93,16 @@ public void onUseTick(Level worldIn, LivingEntity livingIn, ItemStack itemStack, public ItemStack finishUsingItem(ItemStack itemStack, Level worldIn, LivingEntity entityIn) { if (!worldIn.isClientSide() && entityIn instanceof ServerPlayer){ ServerPlayer playerIn = (ServerPlayer) entityIn; - if (playerIn.connection.getConnection().isConnected() && !playerIn.isSleeping()) { + if (!playerIn.hasDisconnected() && !playerIn.isSleeping()) { CompoundTag dest = itemStack.getOrCreateTag().getCompound("Destination"); String dim = dest.getString("Dimension"); - ResourceKey dimension = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(dim)); - if (worldIn.dimension().equals(dimension)) { + Level dimension = null; + DimensionType type = worldIn.registryAccess().registryOrThrow(Registries.DIMENSION_TYPE).get(new ResourceLocation(dim)); + if (type != null) { + dimension = worldIn.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(dim))); + } + //ResourceKey dimension = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(dim)); + if (worldIn.equals(dimension)) { double x = dest.getDouble("X"); double y = dest.getDouble("Y"); double z = dest.getDouble("Z"); @@ -116,14 +124,13 @@ public ItemStack finishUsingItem(ItemStack itemStack, Level worldIn, LivingEntit itemStack.shrink(1); if (itemStack.isEmpty()) itemStack = new ItemStack(Items.AIR); } - return itemStack; } else { worldIn.playSound(null, playerIn, SoundRegistry.transportCardFail.get(), SoundSource.PLAYERS, 1.0F, 1.0F); playerIn.sendSystemMessage(Component.translatable("item.locusazzurro_icaruswings.transport_card_teleport.error2")); playerIn.getCooldowns().addCooldown(this, 20); - return itemStack; } + return itemStack; } else { worldIn.playSound(null, playerIn, SoundRegistry.transportCardFail.get(), SoundSource.PLAYERS, 1.0F, 1.0F); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftCharge.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftCharge.java index 3e9bcb1d..fa030c84 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftCharge.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftCharge.java @@ -2,14 +2,13 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class TimeRiftCharge extends Item { private boolean advanced = false; public TimeRiftCharge(){ - super(new Item.Properties().tab(ModGroup.itemGroup)); + super(new Item.Properties()); } public TimeRiftCharge(boolean advanced){ diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftGenerator.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftGenerator.java index deacd2d9..481475d7 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftGenerator.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/TimeRiftGenerator.java @@ -9,7 +9,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ProjectileWeaponItem; import net.minecraft.world.level.Level; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.entity.TimeRiftParticleEntity; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; @@ -19,7 +18,7 @@ public class TimeRiftGenerator extends ProjectileWeaponItem { public TimeRiftGenerator(){ - super(new Item.Properties().tab(ModGroup.itemGroup).durability(400)); + super(new Item.Properties().durability(400)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatGrains.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatGrains.java index 29549079..52b5f3fe 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatGrains.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatGrains.java @@ -16,7 +16,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.items.ItemHandlerHelper; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; @Mod.EventBusSubscriber @@ -25,7 +24,7 @@ public class WheatGrains extends Item{ private final static float ACQUIRE_FEATHER_CHANCE = 0.5f; public WheatGrains() { - super(new Properties().tab(ModGroup.itemGroup).food(food)); + super(new Properties().food(food)); } @@ -47,16 +46,15 @@ public InteractionResult interactLivingEntity(ItemStack stack, Player player, } target.playSound(SoundEvents.PARROT_EAT, 2.0f, 1.3f); if (Math.random() > ACQUIRE_FEATHER_CHANCE) { - - int variant = ((Parrot) target).getVariant(); + + Parrot.Variant var = ((Parrot) target).getVariant(); new ItemStack(Items.FEATHER); - ItemStack feather = switch (variant) { - case 0 -> new ItemStack(ItemRegistry.redFeather.get()); - case 1 -> new ItemStack(ItemRegistry.blueFeather.get()); - case 2 -> new ItemStack(ItemRegistry.greenFeather.get()); - case 3 -> new ItemStack(ItemRegistry.cyanFeather.get()); - case 4 -> new ItemStack(ItemRegistry.grayFeather.get()); - default -> new ItemStack(Items.FEATHER); + ItemStack feather = switch (var) { + case RED_BLUE -> new ItemStack(ItemRegistry.redFeather.get()); + case BLUE -> new ItemStack(ItemRegistry.blueFeather.get()); + case GREEN -> new ItemStack(ItemRegistry.greenFeather.get()); + case YELLOW_BLUE -> new ItemStack(ItemRegistry.cyanFeather.get()); + case GRAY -> new ItemStack(ItemRegistry.grayFeather.get()); }; ItemHandlerHelper.giveItemToPlayer(player, feather); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatString.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatString.java index 2737973a..f2f003bb 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatString.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WheatString.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class WheatString extends Item { public WheatString() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WindWand.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WindWand.java index cdb6bc34..4508eaa2 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WindWand.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WindWand.java @@ -12,14 +12,13 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.items.ItemHandlerHelper; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry; import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry; public class WindWand extends Item { public WindWand() { - super(new Properties().tab(ModGroup.itemGroup).durability(100)); + super(new Properties().durability(100)); } @Override diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldEssence.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldEssence.java index eea7b44f..c823f516 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldEssence.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldEssence.java @@ -1,11 +1,10 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class WorldEssence extends Item { public WorldEssence() { - super(new Properties().tab(ModGroup.itemGroup).stacksTo(16)); + super(new Properties().stacksTo(16)); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngot.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngot.java index 99fb97bd..1faee365 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngot.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngot.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class WorldIngot extends Item{ public WorldIngot() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngotMaterial.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngotMaterial.java index 09c8c16c..f5fad790 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngotMaterial.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/items/WorldIngotMaterial.java @@ -1,12 +1,11 @@ package org.mineplugin.locusazzurro.icaruswings.items; import net.minecraft.world.item.Item; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; public class WorldIngotMaterial extends Item{ public WorldIngotMaterial() { - super(new Properties().tab(ModGroup.itemGroup)); + super(new Properties()); } } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/DamageTypeRegistry.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/DamageTypeRegistry.java new file mode 100644 index 00000000..1bae8d17 --- /dev/null +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/DamageTypeRegistry.java @@ -0,0 +1,20 @@ +package org.mineplugin.locusazzurro.icaruswings.registry; + +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.damagesource.DamageType; +import org.mineplugin.locusazzurro.icaruswings.IcarusWings; +import org.mineplugin.locusazzurro.icaruswings.data.ModData; + +public class DamageTypeRegistry { + + public static final ResourceKey TIME_RIFT = register("time_rift"); + public static final ResourceKey SPEAR = register("spear"); + + private static ResourceKey register(String name) + { + return ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(ModData.MOD_ID, name)); + } + +} diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/ItemRegistry.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/ItemRegistry.java index 43dd108d..5740ea34 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/ItemRegistry.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/ItemRegistry.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.registry; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.Tiers; @@ -8,7 +9,6 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import org.mineplugin.locusazzurro.icaruswings.data.ModData; -import org.mineplugin.locusazzurro.icaruswings.data.ModGroup; import org.mineplugin.locusazzurro.icaruswings.data.ModItemTier; import org.mineplugin.locusazzurro.icaruswings.data.WingsType; import org.mineplugin.locusazzurro.icaruswings.items.*; @@ -51,39 +51,39 @@ public class ItemRegistry { public static final RegistryObject beeswax = ITEMS.register("beeswax", Beeswax::new); public static final RegistryObject beeswaxBlock = ITEMS.register("beeswax_block", - () -> new BlockItem(BlockRegistry.beeswaxBlock.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.beeswaxBlock.get(), new Item.Properties())); public static final RegistryObject refinedBeeswaxBar = ITEMS.register("refined_beeswax_bar", RefinedBeeswaxBar::new); public static final RegistryObject glisteringRefinedBeeswaxBar = ITEMS.register("glistering_refined_beeswax_bar", () -> new RefinedBeeswaxBar(true)); public static final RegistryObject refinedBeeswaxBlock = ITEMS.register("refined_beeswax_block", - () -> new BlockItem(BlockRegistry.refinedBeeswaxBlock.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.refinedBeeswaxBlock.get(), new Item.Properties())); public static final RegistryObject refinedBeeswaxSlab = ITEMS.register("refined_beeswax_slab", - () -> new BlockItem(BlockRegistry.refinedBeeswaxSlab.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.refinedBeeswaxSlab.get(), new Item.Properties())); public static final RegistryObject refinedBeeswaxPillar = ITEMS.register("refined_beeswax_pillar", - () -> new BlockItem(BlockRegistry.refinedBeeswaxPillar.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.refinedBeeswaxPillar.get(), new Item.Properties())); public static final RegistryObject refinedBeeswaxStairs = ITEMS.register("refined_beeswax_stairs", - () -> new BlockItem(BlockRegistry.refinedBeeswaxStairs.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.refinedBeeswaxStairs.get(), new Item.Properties())); public static final RegistryObject refinedBeeswaxBlockChiseled = ITEMS.register("chiseled_refined_beeswax_block", - () -> new BlockItem(BlockRegistry.refinedBeeswaxBlockChiseled.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.refinedBeeswaxBlockChiseled.get(), new Item.Properties())); public static final RegistryObject smoothRefinedBeeswaxBlock = ITEMS.register("smooth_refined_beeswax_block", - () -> new BlockItem(BlockRegistry.smoothRefinedBeeswaxBlock.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.smoothRefinedBeeswaxBlock.get(), new Item.Properties())); public static final RegistryObject elysianGrassBlock = ITEMS.register("elysian_grass_block", - () -> new BlockItem(BlockRegistry.elysianGrassBlock.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.elysianGrassBlock.get(), new Item.Properties())); public static final RegistryObject elysianSoil = ITEMS.register("elysian_soil", - () -> new BlockItem(BlockRegistry.elysianSoil.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.elysianSoil.get(), new Item.Properties())); public static final RegistryObject elysianGrass = ITEMS.register("elysian_grass", - () -> new BlockItem(BlockRegistry.elysianGrass.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.elysianGrass.get(), new Item.Properties())); public static final RegistryObject goldenWoolBlock = ITEMS.register("golden_wool_block", - () -> new BlockItem(BlockRegistry.goldenWoolBlock.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.goldenWoolBlock.get(), new Item.Properties())); public static final RegistryObject goldenWoolCarpet = ITEMS.register("golden_wool_carpet", - () -> new BlockItem(BlockRegistry.goldenWoolCarpet.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.goldenWoolCarpet.get(), new Item.Properties())); public static final RegistryObject honeyCake = ITEMS.register("honey_cake", - () -> new BlockItem(BlockRegistry.honeyCake.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.honeyCake.get(), new Item.Properties())); public static final RegistryObject meadPot = ITEMS.register("mead_pot", - () -> new BlockItem(BlockRegistry.meadPot.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.meadPot.get(), new Item.Properties())); public static final RegistryObject amphora = ITEMS.register("amphora", - () -> new BlockItem(BlockRegistry.amphora.get(), new Item.Properties().tab(ModGroup.itemGroup))); + () -> new BlockItem(BlockRegistry.amphora.get(), new Item.Properties())); public static final RegistryObject greekFireBucket = ITEMS.register("greek_fire_bucket", GreekFireBucket::new); public static final RegistryObject glassJar = ITEMS.register("glass_jar", GlassJar::new); @@ -124,19 +124,19 @@ public class ItemRegistry { public static final RegistryObject grainsMeal = ITEMS.register("grains_meal", GrainsMeal::new); public static final RegistryObject herbalCrown = ITEMS.register("herbal_crown", - () -> new HerbalAccessory(EquipmentSlot.HEAD)); + () -> new HerbalAccessory(ArmorItem.Type.HELMET)); public static final RegistryObject featherHelmet = ITEMS.register("feather_helmet", - () -> new FeatherArmor(EquipmentSlot.HEAD, false)); + () -> new FeatherArmor(ArmorItem.Type.HELMET, false)); public static final RegistryObject goldenFeatherHelmet = ITEMS.register("golden_feather_helmet", - () -> new FeatherArmor(EquipmentSlot.HEAD, true)); + () -> new FeatherArmor(ArmorItem.Type.HELMET, true)); public static final RegistryObject linenCloak = ITEMS.register("linen_cloak", - () -> new LinenCloth(EquipmentSlot.CHEST)); + () -> new LinenCloth(ArmorItem.Type.CHESTPLATE)); public static final RegistryObject linenUndergarment = ITEMS.register("linen_undergarment", - () -> new LinenCloth(EquipmentSlot.LEGS)); + () -> new LinenCloth(ArmorItem.Type.LEGGINGS)); public static final RegistryObject goldenFleeceMantle = ITEMS.register("golden_fleece_mantle", - () -> new GoldenFleeceArmor(EquipmentSlot.CHEST)); + () -> new GoldenFleeceArmor(ArmorItem.Type.CHESTPLATE)); public static final RegistryObject beeswaxBoots = ITEMS.register("beeswax_boots", - () -> new BeeswaxArmor(EquipmentSlot.FEET)); + () -> new BeeswaxArmor(ArmorItem.Type.BOOTS)); public static final RegistryObject goldemRamSpawmEgg = ITEMS.register("golden_ram_spawn_egg", GoldenRamSpawnEgg::new); @@ -190,13 +190,13 @@ public class ItemRegistry { public static final RegistryObject quantumFuel = ITEMS.register("quantum_fuel", QuantumFuel::new); public static final RegistryObject synapseHelmet = ITEMS.register("synapse_helmet", - () -> new SynapseArmor(EquipmentSlot.HEAD)); + () -> new SynapseArmor(ArmorItem.Type.HELMET)); public static final RegistryObject synapseChestplate = ITEMS.register("synapse_chestplate", - () -> new SynapseArmor(EquipmentSlot.CHEST)); + () -> new SynapseArmor(ArmorItem.Type.CHESTPLATE)); public static final RegistryObject synapseLeggings = ITEMS.register("synapse_leggings", - () -> new SynapseArmor(EquipmentSlot.LEGS)); + () -> new SynapseArmor(ArmorItem.Type.LEGGINGS)); public static final RegistryObject synapseBoots = ITEMS.register("synapse_boots", - () -> new SynapseArmor(EquipmentSlot.FEET)); + () -> new SynapseArmor(ArmorItem.Type.BOOTS)); public static final RegistryObject synapseAlloySword = ITEMS.register("synapse_alloy_sword", SynapseAlloySword::new); public static final RegistryObject steelPickaxe = ITEMS.register("steel_pickaxe", SteelPickaxe::new); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/SoundRegistry.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/SoundRegistry.java index abffe88a..7715e6c8 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/SoundRegistry.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/registry/SoundRegistry.java @@ -11,93 +11,93 @@ public class SoundRegistry { public static final DeferredRegister SOUNDS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, ModData.MOD_ID); public static final RegistryObject trackFallenDown = SOUNDS.register("track.fallen_down", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID, "track.fallen_down"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID, "track.fallen_down"))); public static final RegistryObject trackRingMyBell = SOUNDS.register("track.ring_my_bell", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID, "track.ring_my_bell"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID, "track.ring_my_bell"))); public static final RegistryObject spearThrow = SOUNDS.register("item.spear.throw", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.throw"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.throw"))); public static final RegistryObject spearHit = SOUNDS.register("item.spear.hit", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.hit"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.hit"))); public static final RegistryObject spearHitGround = SOUNDS.register("item.spear.hit_ground", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.hit_ground"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.spear.hit_ground"))); public static final RegistryObject meadPotBrew = SOUNDS.register("block.mead_pot.brew", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"block.mead_pot.brew"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"block.mead_pot.brew"))); public static final RegistryObject greekFireAmbient = SOUNDS.register("block.greek_fire.ambient", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"block.greek_fire.ambient"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"block.greek_fire.ambient"))); public static final RegistryObject greekFirePop = SOUNDS.register("block.greek_fire.pop", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"block.greek_fire.pop"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"block.greek_fire.pop"))); public static final RegistryObject bucketFillGreekFire = SOUNDS.register("item.bucket.fill_greek_fire", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.bucket.fill_greek_fire"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.bucket.fill_greek_fire"))); public static final RegistryObject bucketEmptyGreekFire = SOUNDS.register("item.bucket.empty_greek_fire", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.bucket.empty_greek_fire"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.bucket.empty_greek_fire"))); public static final RegistryObject goldenRamAmbient = SOUNDS.register("entity.golden_ram.ambient", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.ambient"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.ambient"))); public static final RegistryObject goldenRamDeath = SOUNDS.register("entity.golden_ram.death", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.death"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.death"))); public static final RegistryObject goldenRamHurt = SOUNDS.register("entity.golden_ram.hurt", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.hurt"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.hurt"))); public static final RegistryObject goldenRamShear = SOUNDS.register("entity.golden_ram.shear", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.shear"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.shear"))); public static final RegistryObject goldenRamStep = SOUNDS.register("entity.golden_ram.step", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.step"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.golden_ram.step"))); public static final RegistryObject armorEquipFeather = SOUNDS.register("item.armor.equip_feather", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_feather"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_feather"))); public static final RegistryObject armorEquipBeeswax = SOUNDS.register("item.armor.equip_beeswax", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_beeswax"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_beeswax"))); public static final RegistryObject armorEquipLinen = SOUNDS.register("item.armor.equip_linen", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_linen"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_linen"))); public static final RegistryObject armorEquipGoldenFleece = SOUNDS.register("item.armor.equip_golden_fleece", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_golden_fleece"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_golden_fleece"))); public static final RegistryObject armorEquipHerbal = SOUNDS.register("item.armor.equip_herbal", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_herbal"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_herbal"))); public static final RegistryObject armorEquipSynapse = SOUNDS.register("item.armor.equip_synapse", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_synapse"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.armor.equip_synapse"))); public static final RegistryObject wingsEquipFeather = SOUNDS.register("item.wings.equip_feather", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_feather"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_feather"))); public static final RegistryObject wingsEquipSynapse = SOUNDS.register("item.wings.equip_synapse", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_synapse"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_synapse"))); public static final RegistryObject wingsEquipPaper = SOUNDS.register("item.wings.equip_paper", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_paper"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_paper"))); public static final RegistryObject wingsEquipMagic = SOUNDS.register("item.wings.equip_magic", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_magic"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.wings.equip_magic"))); public static final RegistryObject airJarFill = SOUNDS.register("item.air_jar.fill", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.air_jar.fill"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.air_jar.fill"))); public static final RegistryObject airJarEmpty = SOUNDS.register("item.air_jar.empty", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.air_jar.empty"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.air_jar.empty"))); public static final RegistryObject windWandBurst = SOUNDS.register("item.wind_wand.burst", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.wind_wand.burst"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.wind_wand.burst"))); public static final RegistryObject artemisMissileLaunch = SOUNDS.register("entity.artemis_missile.launch", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.artemis_missile.launch"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.artemis_missile.launch"))); public static final RegistryObject timeRiftCollapse = SOUNDS.register("entity.time_rift.collapse", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"entity.time_rift.collapse"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"entity.time_rift.collapse"))); public static final RegistryObject timeRiftGeneratorFire = SOUNDS.register("item.time_rift_generator.fire", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.time_rift_generator.fire"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.time_rift_generator.fire"))); public static final RegistryObject demeterBlast = SOUNDS.register("item.demeter.blast", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.demeter.blast"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.demeter.blast"))); public static final RegistryObject transportCardActivationGeneric = SOUNDS.register("item.transport_card.activation.generic", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.generic"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.generic"))); public static final RegistryObject transportCardActivationArtemis = SOUNDS.register("item.transport_card.activation.artemis", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.artemis"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.artemis"))); public static final RegistryObject transportCardActivationElectronic = SOUNDS.register("item.transport_card.activation.electronic", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.electronic"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.electronic"))); public static final RegistryObject transportCardActivationChrono = SOUNDS.register("item.transport_card.activation.chrono", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.chrono"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.chrono"))); public static final RegistryObject transportCardTeleportAnchor = SOUNDS.register("item.transport_card.teleport_anchor", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.teleport_anchor"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.teleport_anchor"))); public static final RegistryObject transportCardTeleport = SOUNDS.register("item.transport_card.teleport", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.teleport"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.teleport"))); public static final RegistryObject transportCardFail = SOUNDS.register("item.transport_card.fail", - () -> new SoundEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.fail"))); + () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModData.MOD_ID,"item.transport_card.activation.fail"))); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/models/SpearBakedModel.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/models/SpearBakedModel.java index 3250dfd5..bf46f9ac 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/models/SpearBakedModel.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/models/SpearBakedModel.java @@ -8,6 +8,7 @@ import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -63,12 +64,12 @@ public ItemTransforms getTransforms() { } @Override - public BakedModel applyTransform(ItemTransforms.TransformType cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) { - if (cameraTransformType == ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND || - cameraTransformType == ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND || - cameraTransformType == ItemTransforms.TransformType.THIRD_PERSON_RIGHT_HAND || - cameraTransformType == ItemTransforms.TransformType.THIRD_PERSON_LEFT_HAND) { - return (BakedModel) this; + public BakedModel applyTransform(ItemDisplayContext cameraTransformType, PoseStack poseStack, boolean applyLeftHandTransform) { + if (cameraTransformType == ItemDisplayContext.FIRST_PERSON_RIGHT_HAND || + cameraTransformType == ItemDisplayContext.FIRST_PERSON_LEFT_HAND || + cameraTransformType == ItemDisplayContext.THIRD_PERSON_RIGHT_HAND || + cameraTransformType == ItemDisplayContext.THIRD_PERSON_LEFT_HAND) { + return this; } return this.existingModel.applyTransform(cameraTransformType, poseStack, applyLeftHandTransform); } diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/ArtemisMissileRenderer.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/ArtemisMissileRenderer.java index b217a12b..7049a565 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/ArtemisMissileRenderer.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/ArtemisMissileRenderer.java @@ -2,7 +2,8 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; -import com.mojang.math.Vector3f; +import com.mojang.math.Axis; +import org.joml.Vector3f; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider.Context; @@ -37,8 +38,8 @@ public void render(ArtemisMissileEntity entityIn, float entityYaw, float partial matrixStackIn.pushPose(); matrixStackIn.scale(0.15f,0.15f, 0.15f); matrixStackIn.translate(0f, -0.25f, 0f); - matrixStackIn.mulPose(Vector3f.YN.rotationDegrees(entityYaw)); - matrixStackIn.mulPose(Vector3f.XN.rotationDegrees(entityIn.getXRot())); + matrixStackIn.mulPose(Axis.YN.rotationDegrees(entityYaw)); + matrixStackIn.mulPose(Axis.XN.rotationDegrees(entityIn.getXRot())); VertexConsumer vertexBuilder = bufferIn.getBuffer(model.renderType(MISSILE)); this.model.renderToBuffer(matrixStackIn, vertexBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); matrixStackIn.popPose(); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearItemStackTileEntityRenderer.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearItemStackTileEntityRenderer.java index 6d21c6c7..3e8532e8 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearItemStackTileEntityRenderer.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearItemStackTileEntityRenderer.java @@ -11,6 +11,7 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher; import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -32,7 +33,7 @@ public SpearItemStackTileEntityRenderer(){ } @Override - public void renderByItem(ItemStack stack, ItemTransforms.TransformType transformType, PoseStack matrixStack, MultiBufferSource buffer, int combinedLight, int combinedOverlay){ + public void renderByItem(ItemStack stack, ItemDisplayContext transformType, PoseStack matrixStack, MultiBufferSource buffer, int combinedLight, int combinedOverlay){ if (stack.getItem() instanceof SpearItem) { CompoundTag stackTag = stack.getOrCreateTag(); boolean throwing = stackTag.contains("Throwing") && stackTag.getBoolean("Throwing"); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearRenderer.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearRenderer.java index a9d0033f..b102a7a3 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearRenderer.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/render/renderers/SpearRenderer.java @@ -2,7 +2,8 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; -import com.mojang.math.Vector3f; +import com.mojang.math.Axis; +import org.joml.Vector3f; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider.Context; @@ -37,8 +38,8 @@ public SpearRenderer(Context context) { @Override public void render(SpearEntity spearEntity, float entityYaw, float partialTicks, PoseStack stack, MultiBufferSource buffer, int packedLight) { stack.pushPose(); - stack.mulPose(Vector3f.YP.rotationDegrees(Mth.lerp(partialTicks, spearEntity.yRotO, spearEntity.getYRot()) - 90.0F)); - stack.mulPose(Vector3f.ZP.rotationDegrees(Mth.lerp(partialTicks, spearEntity.xRotO, spearEntity.getXRot()) + 90.0F)); + stack.mulPose(Axis.YP.rotationDegrees(Mth.lerp(partialTicks, spearEntity.yRotO, spearEntity.getYRot()) - 90.0F)); + stack.mulPose(Axis.ZP.rotationDegrees(Mth.lerp(partialTicks, spearEntity.xRotO, spearEntity.getXRot()) + 90.0F)); VertexConsumer vertexBuilder = ItemRenderer.getFoilBufferDirect(buffer, this.model.renderType(this.getTextureLocation(spearEntity)), false, spearEntity.isFoil()); this.model.renderToBuffer(stack, vertexBuilder, packedLight, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); stack.popPose(); diff --git a/src/main/java/org/mineplugin/locusazzurro/icaruswings/utils/MathUtils.java b/src/main/java/org/mineplugin/locusazzurro/icaruswings/utils/MathUtils.java index ddcb38b5..804f0712 100644 --- a/src/main/java/org/mineplugin/locusazzurro/icaruswings/utils/MathUtils.java +++ b/src/main/java/org/mineplugin/locusazzurro/icaruswings/utils/MathUtils.java @@ -1,6 +1,7 @@ package org.mineplugin.locusazzurro.icaruswings.utils; -import com.mojang.math.Vector3f; +import org.joml.Vector3d; +import org.joml.Vector3f; import net.minecraft.util.RandomSource; import net.minecraft.world.phys.Vec3; @@ -15,9 +16,9 @@ public class MathUtils { * @param samples number of points * @return ArrayList of points in Vector3d */ - public static List fibonacciSphere(int samples){ + public static List fibonacciSphere(int samples){ - List points = new ArrayList<>(); + List points = new ArrayList<>(); double phi = Math.PI * (3.0d - Math.sqrt(5.0d)); double theta,x,y,z,r; for (int i = 0; i < samples; i++){ @@ -26,15 +27,15 @@ public static List fibonacciSphere(int samples){ theta = phi * i; x = Math.cos(theta) * r; z = Math.sin(theta) * r; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } return points; } public static List fibonacciSphereFloat(int samples){ - List pointsDouble = fibonacciSphere(samples); + List pointsDouble = fibonacciSphere(samples); List pointsFloat = new ArrayList<>(); - pointsDouble.forEach((p) -> pointsFloat.add(new Vector3f(p))); + pointsDouble.forEach((p) -> pointsFloat.add(new Vector3f((float) p.x(), (float) p.y(), (float) p.z()))); return pointsFloat; } @@ -110,8 +111,8 @@ public static List squareMatrixFrame(int subDivisions){ * @param subDivisions number of subdivisions (segments) for each side * @return ArrayList of points in Vector3d */ - public static List cubeMatrixFrame(int subDivisions){ - List points = new ArrayList<>(); + public static List cubeMatrixFrame(int subDivisions){ + List points = new ArrayList<>(); double x,y,z,s; s = 2d / subDivisions; y = -1; @@ -119,7 +120,7 @@ public static List cubeMatrixFrame(int subDivisions){ z = -1 + s * i; for (int j = 0; j <= subDivisions; j++){ x = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } } for (int i = 1; i < subDivisions; i++){ @@ -127,22 +128,22 @@ public static List cubeMatrixFrame(int subDivisions){ x = -1; for (int j = 0; j <= subDivisions; j++){ z = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } z = -1; for (int j = 1; j < subDivisions; j++){ x = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } z = 1; for (int j = 1; j < subDivisions; j++){ x = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } x = 1; for (int j = 0; j <= subDivisions; j++){ z = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } } y = 1; @@ -150,7 +151,7 @@ public static List cubeMatrixFrame(int subDivisions){ z = -1 + s * i; for (int j = 0; j <= subDivisions; j++){ x = -1 + s * j; - points.add(new Vec3(x,y,z)); + points.add(new Vector3d(x,y,z)); } } return points; diff --git a/src/main/resources/assets/locusazzurro_icaruswings/lang/en_us.json b/src/main/resources/assets/locusazzurro_icaruswings/lang/en_us.json index 1b18c818..05d612ba 100644 --- a/src/main/resources/assets/locusazzurro_icaruswings/lang/en_us.json +++ b/src/main/resources/assets/locusazzurro_icaruswings/lang/en_us.json @@ -202,8 +202,8 @@ "effect.locusazzurro_icaruswings.inevitability": "Inevitability", "effect.locusazzurro_icaruswings.interdiction": "Interdiction", - "death.attack.timeRift": "%1$s got stuck in a time paradox", - "death.attack.timeRift.player": "%1$s got thrown into a time paradox by %2$s", + "death.attack.time_rift": "%1$s got stuck in a time paradox", + "death.attack.time_rift.player": "%1$s got thrown into a time paradox by %2$s", "death.attack.spear": "%1$s was speared by %2$s", "death.attack.spear.item": "%1$s was speared by %2$s with %3$s", @@ -211,8 +211,8 @@ "subtitles.item.spear.hit": "Spear hits", "subtitles.item.spear.hit_ground": "Spear hits ground", "subtitles.block.mead_pot.brew": "Mead pot bubbles", - "subtitles.block.greek_fire.ambient": 'Greek fire pops', - "subtitles.block.greek_fire.pop": 'Greek fire pops', + "subtitles.block.greek_fire.ambient": "Greek fire pops", + "subtitles.block.greek_fire.pop": "Greek fire pops", "subtitles.item.bucket.fill_greek_fire": "Greek fire bucket fills", "subtitles.item.bucket.empty_greek_fire": "Greek fire bucket empties", "subtitles.entity.golden_ram.ambient": "Golden ram baahs", diff --git a/src/main/resources/assets/locusazzurro_icaruswings/lang/zh_cn.json b/src/main/resources/assets/locusazzurro_icaruswings/lang/zh_cn.json index e7019974..cef3365b 100644 --- a/src/main/resources/assets/locusazzurro_icaruswings/lang/zh_cn.json +++ b/src/main/resources/assets/locusazzurro_icaruswings/lang/zh_cn.json @@ -201,8 +201,8 @@ "effect.locusazzurro_icaruswings.inevitability": "宿命", "effect.locusazzurro_icaruswings.interdiction": "阻扰", - "death.attack.timeRift": "%1$s 被卷进了时空悖论", - "death.attack.timeRift.player": "%1$s 被 %2$s 丢进了时空悖论", + "death.attack.time_rift": "%1$s 被卷进了时空悖论", + "death.attack.time_rift.player": "%1$s 被 %2$s 丢进了时空悖论", "death.attack.spear": "%1$s 被 %2$s 一枪戳死了", "death.attack.spear.item": "%1$s 被 %2$s 用 %3$s 一枪戳死了", @@ -210,8 +210,8 @@ "subtitles.item.spear.hit": "枪:击中", "subtitles.item.spear.hit_ground": "枪:落地", "subtitles.block.mead_pot.brew": "蜜酒锅:冒泡", - "subtitles.block.greek_fire.ambient": '希腊火:迸裂', - "subtitles.block.greek_fire.pop": '希腊火:迸裂', + "subtitles.block.greek_fire.ambient": "希腊火:迸裂", + "subtitles.block.greek_fire.pop": "希腊火:迸裂", "subtitles.item.bucket.fill_greek_fire": "希腊火桶:装满", "subtitles.item.bucket.empty_greek_fire": "希腊火桶:倒出", "subtitles.entity.golden_ram.ambient": "金羊:咩~", diff --git a/src/main/resources/data/locusazzurro_icaruswings/tags/damage_type/bypasses_armor.json b/src/main/resources/data/locusazzurro_icaruswings/tags/damage_type/bypasses_armor.json new file mode 100644 index 00000000..38123e81 --- /dev/null +++ b/src/main/resources/data/locusazzurro_icaruswings/tags/damage_type/bypasses_armor.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "locusazzurro_icaruswings:time_rift" + ] +} \ No newline at end of file