diff --git a/common/src/main/java/com/craisinlord/antarchy/compat/jei/AntarchyJeiPlugin.java b/common/src/main/java/com/craisinlord/antarchy/compat/jei/AntarchyJeiPlugin.java index dbe6a041..d8104513 100644 --- a/common/src/main/java/com/craisinlord/antarchy/compat/jei/AntarchyJeiPlugin.java +++ b/common/src/main/java/com/craisinlord/antarchy/compat/jei/AntarchyJeiPlugin.java @@ -1,10 +1,10 @@ package com.craisinlord.antarchy.compat.jei; import com.craisinlord.antarchy.Antarchy; -import com.craisinlord.antarchy.content.AmericanizeRecipe; +import com.craisinlord.antarchy.content.recipe.AmericanizeRecipe; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchyTags; -import com.craisinlord.antarchy.content.CustomBrewingRecipes; +import com.craisinlord.antarchy.content.recipe.CustomBrewingRecipes; import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant; import com.craisinlord.antarchy.content.item.GlimmerBottleItem; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/AntarchySoundEvents.java b/common/src/main/java/com/craisinlord/antarchy/content/AntarchySoundEvents.java index 86424c80..bd197f36 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/AntarchySoundEvents.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/AntarchySoundEvents.java @@ -160,6 +160,14 @@ public final class AntarchySoundEvents { public static Supplier ROLLY_POLLY_WHEEL_MODE = (Supplier) UNBOUND; public static Supplier ROLLY_POLLY_NORMAL_MODE = (Supplier) UNBOUND; public static Supplier ROLLY_POLLY_ROLL = (Supplier) UNBOUND; + public static Supplier JERRY_YOUNG_IDLE = (Supplier) UNBOUND; + public static Supplier JERRY_YOUNG_HURT = (Supplier) UNBOUND; + public static Supplier JERRY_YOUNG_DEATH = (Supplier) UNBOUND; + public static Supplier JERRY_YOUNG_ATTACK = (Supplier) UNBOUND; + public static Supplier JERRY_ADULT_IDLE = (Supplier) UNBOUND; + public static Supplier JERRY_ADULT_HURT = (Supplier) UNBOUND; + public static Supplier JERRY_ADULT_DEATH = (Supplier) UNBOUND; + public static Supplier JERRY_ADULT_ATTACK = (Supplier) UNBOUND; private AntarchySoundEvents() { } @@ -315,7 +323,15 @@ public final class AntarchySoundEvents { Supplier brutalflySpit, Supplier rollyPollyWheelMode, Supplier rollyPollyNormalMode, - Supplier rollyPollyRoll + Supplier rollyPollyRoll, + Supplier jerryYoungIdle, + Supplier jerryYoungHurt, + Supplier jerryYoungDeath, + Supplier jerryYoungAttack, + Supplier jerryAdultIdle, + Supplier jerryAdultHurt, + Supplier jerryAdultDeath, + Supplier jerryAdultAttack ) { SQUIDZOOKA_FIRE = squidzookaFire; SHRINK_RAY_SOUND = shrinkRaySound; @@ -468,5 +484,13 @@ public final class AntarchySoundEvents { ROLLY_POLLY_WHEEL_MODE = rollyPollyWheelMode; ROLLY_POLLY_NORMAL_MODE = rollyPollyNormalMode; ROLLY_POLLY_ROLL = rollyPollyRoll; + JERRY_YOUNG_IDLE = jerryYoungIdle; + JERRY_YOUNG_HURT = jerryYoungHurt; + JERRY_YOUNG_DEATH = jerryYoungDeath; + JERRY_YOUNG_ATTACK = jerryYoungAttack; + JERRY_ADULT_IDLE = jerryAdultIdle; + JERRY_ADULT_HURT = jerryAdultHurt; + JERRY_ADULT_DEATH = jerryAdultDeath; + JERRY_ADULT_ATTACK = jerryAdultAttack; } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/AntarchyTags.java b/common/src/main/java/com/craisinlord/antarchy/content/AntarchyTags.java index 358600a8..b89e94b9 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/AntarchyTags.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/AntarchyTags.java @@ -33,6 +33,7 @@ public final class AntarchyTags { public static final TagKey UMBRAL_MOSS_REPLACEABLE = TagKey.create(Registries.BLOCK, id("umbral_moss_replaceable")); public static final TagKey BLUSH_MOSS_REPLACEABLE = TagKey.create(Registries.BLOCK, id("blush_moss_replaceable")); public static final TagKey BIOWART_REPLACEABLE = TagKey.create(Registries.BLOCK, id("biowart_replaceable")); + public static final TagKey BIOWART_TENDRILS_PLANTABLE = TagKey.create(Registries.BLOCK, id("biowart_tendrils_plantable")); public static final TagKey HERCULES_BEETLE_CHARGE_IMMUNE_BLOCKS = TagKey.create(Registries.BLOCK, id("hercules_beetle_charge_immune_blocks")); public static final TagKey ELYTHIA_PORTAL_FRAMES = TagKey.create(Registries.BLOCK, id("elythia_portal_frames")); public static final TagKey THORAXIS_PORTAL_FRAMES = TagKey.create(Registries.BLOCK, id("thoraxis_portal_frames")); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabContents.java b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabContents.java new file mode 100644 index 00000000..187e7dec --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabContents.java @@ -0,0 +1,495 @@ +package com.craisinlord.antarchy.content; + +import com.craisinlord.antarchy.Antarchy; +import com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant; +import com.craisinlord.antarchy.content.item.GlimmerBottleItem; +import com.craisinlord.antarchy.content.item.ultimate.UltimateGearHelper; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.core.Holder; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.alchemy.Potion; +import net.minecraft.world.item.alchemy.PotionContents; +import net.minecraft.world.level.ItemLike; + +public final class CreativeTabContents { + private CreativeTabContents() {} + + private record CatalogEntry(String path, String neoTabPath, String insertAfterPath) {} + + public interface AntarchyTabOutput { + void accept(ItemLike item); + void accept(ItemStack stack); + } + + public interface NeoForgeVanillaTabOutput extends AntarchyTabOutput { + void insertAfter(ItemLike anchor, ItemLike item); + } + + private static final List CATALOG = List.of( + entry("ouranwood_log", "building_blocks"), + entry("ouranwood_wood", "building_blocks"), + entry("mossy_ouranwood_log", "building_blocks"), + entry("mossy_ouranwood_wood", "building_blocks"), + entry("stripped_ouranwood_log", "building_blocks"), + entry("stripped_ouranwood_wood", "building_blocks"), + entry("ouranwood_planks", "building_blocks"), + entry("ouranwood_stairs", "building_blocks"), + entry("ouranwood_slab", "building_blocks"), + entry("ouranwood_fence", "building_blocks"), + entry("ouranwood_fence_gate", "building_blocks"), + entry("ouranwood_boat", "building_blocks"), + entry("ouranwood_chest_boat", "building_blocks"), + entry("ouranwood_door", "building_blocks"), + entry("ouranwood_trapdoor", "building_blocks"), + entry("ouranwood_pressure_plate", "building_blocks"), + entry("ouranwood_button", "building_blocks"), + entry("ouranwood_sign", "building_blocks"), + entry("ouranwood_hanging_sign", "building_blocks"), + entry("peach_log", "building_blocks"), + entry("peach_wood", "building_blocks"), + entry("stripped_peach_log", "building_blocks"), + entry("stripped_peach_wood", "building_blocks"), + entry("peach_planks", "building_blocks"), + entry("peach_stairs", "building_blocks"), + entry("peach_slab", "building_blocks"), + entry("peach_fence", "building_blocks"), + entry("peach_fence_gate", "building_blocks"), + entry("peach_boat", "building_blocks"), + entry("peach_chest_boat", "building_blocks"), + entry("peach_door", "building_blocks"), + entry("peach_trapdoor", "building_blocks"), + entry("peach_pressure_plate", "building_blocks"), + entry("peach_button", "building_blocks"), + entry("peach_sign", "building_blocks"), + entry("peach_hanging_sign", "building_blocks"), + entry("shellstone", "building_blocks"), + entry("shellstone_stairs", "building_blocks"), + entry("shellstone_slab", "building_blocks"), + entry("shellstone_wall", "building_blocks"), + entry("polished_shellstone", "building_blocks"), + entry("polished_shellstone_stairs", "building_blocks"), + entry("polished_shellstone_slab", "building_blocks"), + entry("polished_shellstone_wall", "building_blocks"), + entry("shellstone_bricks", "building_blocks"), + entry("shellstone_brick_stairs", "building_blocks"), + entry("shellstone_brick_slab", "building_blocks"), + entry("shellstone_brick_wall", "building_blocks"), + entry("chiseled_shellstone", "building_blocks"), + entry("mossy_shellstone_bricks", "building_blocks"), + entry("mossy_shellstone_brick_stairs", "building_blocks"), + entry("mossy_shellstone_brick_slab", "building_blocks"), + entry("mossy_shellstone_brick_wall", "building_blocks"), + entry("cracked_shellstone_bricks", "building_blocks"), + entry("blush_moss_block", "building_blocks"), + entry("blush_moss_carpet", "building_blocks"), + entry("lumen_froglight", "natural_blocks"), + entry("roseate_froglight", "natural_blocks"), + entry("nyxite", "building_blocks"), + entry("nyxite_stairs", "building_blocks"), + entry("nyxite_slab", "building_blocks"), + entry("nyxite_wall", "building_blocks"), + entry("polished_nyxite", "building_blocks"), + entry("polished_nyxite_stairs", "building_blocks"), + entry("polished_nyxite_slab", "building_blocks"), + entry("polished_nyxite_wall", "building_blocks"), + entry("nyxite_bricks", "building_blocks"), + entry("nyxite_brick_stairs", "building_blocks"), + entry("nyxite_brick_slab", "building_blocks"), + entry("nyxite_brick_wall", "building_blocks"), + entry("chiseled_nyxite", "building_blocks"), + entry("pale_nyxite", "building_blocks"), + entry("nyxite_spike", "building_blocks"), + entry("potent_nyxite", "building_blocks"), + entry("antimetal", "building_blocks"), + entry("polished_antimetal", "building_blocks"), + entry("antimetal_scaffolding", "building_blocks"), + entry("umbral_moss_block", "building_blocks"), + entry("umbral_moss_carpet", "building_blocks"), + entry("dream_torch", "building_blocks"), + entry("dream_lantern", "building_blocks"), + entry("dream_campfire", "building_blocks"), + entry("dream_sand", "building_blocks"), + entry("dream_sandstone", "building_blocks"), + entry("chiseled_dream_sandstone", "building_blocks"), + entry("cut_dream_sandstone", "building_blocks"), + entry("smooth_dream_sandstone", "building_blocks"), + entry("dream_sandstone_stairs", "building_blocks"), + entry("dream_sandstone_slab", "building_blocks"), + entry("dream_sandstone_wall", "building_blocks"), + entry("smooth_dream_sandstone_stairs", "building_blocks"), + entry("smooth_dream_sandstone_slab", "building_blocks"), + entry("cut_dream_sandstone_slab", "building_blocks"), + entry("budding_blood_crystal", "building_blocks"), + entry("blood_crystal_block", "building_blocks"), + entry("blood_crystal_cluster", "building_blocks"), + entry("small_blood_crystal_bud", "building_blocks"), + entry("medium_blood_crystal_bud", "building_blocks"), + entry("large_blood_crystal_bud", "building_blocks"), + entry("myrmite", "building_blocks"), + entry("biomite", "building_blocks"), + entry("biomite_turf", "building_blocks"), + entry("biowart", "building_blocks"), + entry("biowart_tendrils", "building_blocks"), + entry("broodstone", "building_blocks"), + entry("polished_broodstone", "building_blocks"), + entry("chiseled_broodstone", "building_blocks"), + entry("broodstone_bricks", "building_blocks"), + entry("broodstone_stairs", "building_blocks"), + entry("broodstone_slab", "building_blocks"), + entry("broodstone_wall", "building_blocks"), + entry("polished_broodstone_stairs", "building_blocks"), + entry("polished_broodstone_slab", "building_blocks"), + entry("polished_broodstone_wall", "building_blocks"), + entry("broodstone_brick_stairs", "building_blocks"), + entry("broodstone_brick_slab", "building_blocks"), + entry("broodstone_brick_wall", "building_blocks"), + entry("myrmite_coal_ore", "building_blocks"), + entry("broodstone_uranium_ore", "building_blocks"), + entry("broodstone_titanium_ore", "building_blocks"), + entry("bile_vein", "building_blocks"), + entry("chiten_block", "building_blocks"), + entry("chiten_spike", "building_blocks"), + entry("amber_moss_block", "building_blocks"), + entry("amber_moss_carpet", "building_blocks"), + entry("uranium_block", "building_blocks"), + entry("raw_uranium_block", "building_blocks"), + entry("cut_uranium", "building_blocks"), + entry("cut_uranium_stairs", "building_blocks"), + entry("cut_uranium_slab", "building_blocks"), + entry("chiseled_uranium", "building_blocks"), + entry("uranium_door", "building_blocks"), + entry("uranium_trapdoor", "building_blocks"), + entry("uranium_bars", "building_blocks"), + entry("uranium_bulb", "building_blocks"), + entry("titanium_block", "building_blocks"), + entry("raw_titanium_block", "building_blocks"), + entry("cut_titanium", "building_blocks"), + entry("cut_titanium_stairs", "building_blocks"), + entry("cut_titanium_slab", "building_blocks"), + entry("chiseled_titanium", "building_blocks"), + entry("titanium_door", "building_blocks"), + entry("titanium_trapdoor", "building_blocks"), + entry("titanium_bars", "building_blocks"), + entry("titanium_bulb", "building_blocks"), + entry("ouranwood_leaves", "natural_blocks"), + entry("ouranwood_acorn", "natural_blocks"), + entry("peach_leaves", "natural_blocks"), + entry("peach_sapling", "natural_blocks"), + entry("duplicator_log", "natural_blocks"), + entry("duplicator_sapling", "natural_blocks"), + entry("orange_milkweed", "natural_blocks"), + entry("pink_milkweed", "natural_blocks"), + entry("camellia", "natural_blocks"), + entry("spider_lily", "natural_blocks"), + entry("lotus", "natural_blocks"), + entry("giant_lily_pad", "natural_blocks"), + entry("seashell", "natural_blocks"), + entry("hushweed", "natural_blocks"), + entry("amber_lichen", "natural_blocks"), + entry("creepvine", "natural_blocks"), + entry("hanging_creeproots", "natural_blocks"), + entry("molting_vines", "natural_blocks"), + entry("glowcap_mushroom", "natural_blocks"), + entry("glowcap_mushroom_block", "natural_blocks"), + entry("infested_rooted_dirt", "natural_blocks"), + entry("infested_coarse_dirt", "natural_blocks"), + entry("triffid_goo_block", "natural_blocks"), + entry("bed_bug_egg", "natural_blocks"), + entry("creeping_horror_egg", "natural_blocks"), + entry("lurking_terror_egg", "natural_blocks"), + entry("jumpy_bug_egg", "natural_blocks"), + entry("spit_bug_egg", "natural_blocks"), + entry("jerry_egg", "natural_blocks"), + entry("wasp_nest", "natural_blocks"), + entry("red_ant_nest", "natural_blocks"), + entry("brown_ant_nest", "natural_blocks"), + entry("rainbow_ant_nest", "natural_blocks"), + entry("termite_nest", "natural_blocks"), + entry("uranium_ore", "natural_blocks"), + entry("deepslate_uranium_ore", "natural_blocks"), + entry("titanium_ore", "natural_blocks"), + entry("deepslate_titanium_ore", "natural_blocks"), + entry("corn_seeds", "natural_blocks"), + entry("star_coral", "natural_blocks"), + entry("star_coral_fan", "natural_blocks"), + entry("star_coral_block", "natural_blocks"), + entry("dead_star_coral", "natural_blocks"), + entry("dead_star_coral_fan", "natural_blocks"), + entry("dead_star_coral_block", "natural_blocks"), + entry("duct_tape", "tools_and_utilities", "shears"), + entry("diamond_minecart", "tools_and_utilities", "minecart"), + entry("bile_bucket", "tools_and_utilities"), + entry("ichor_bucket", "tools_and_utilities"), + entry("antiwater_bucket", "tools_and_utilities"), + entry("lumen_bucket", "tools_and_utilities"), + entry("cloud_bucket", "tools_and_utilities"), + entry("reverie_bottle", "tools_and_utilities"), + entry("glimmer_bottle", "tools_and_utilities"), + entry("critter_cage", "tools_and_utilities"), + entry("ultimate_pickaxe", "tools_and_utilities"), + entry("ultimate_axe", "tools_and_utilities"), + entry("ultimate_shovel", "tools_and_utilities"), + entry("ultimate_hoe", "tools_and_utilities"), + entry("battle_axe", "combat"), + entry("big_bertha", "combat"), + entry("basilisk_dagger", "combat"), + entry("ultimate_helmet", "combat"), + entry("ultimate_chestplate", "combat"), + entry("ultimate_leggings", "combat"), + entry("ultimate_boots", "combat"), + entry("ultimate_sword", "combat"), + entry("ultimate_bow", "combat"), + entry("ultimate_crossbow", "combat"), + entry("squidzooka", "combat"), + entry("rpo_launcher", "combat"), + entry("krakens_grasp", "combat"), + entry("shrink_ray", "combat"), + entry("growth_ray", "combat"), + entry("gravity_gun", "combat"), + entry("water_cannon", "combat"), + entry("attitude_adjuster", "combat"), + entry("lucid_pearl", "combat"), + entry("primordial_helmet", "combat"), + entry("primordial_chestplate", "combat"), + entry("primordial_leggings", "combat"), + entry("primordial_boots", "combat"), + entry("nightmare_helmet", "combat"), + entry("nightmare_chestplate", "combat"), + entry("nightmare_leggings", "combat"), + entry("nightmare_boots", "combat"), + entry("nightmare_sword", "combat"), + entry("blood_crystal_katana", "combat"), + entry("blood_crystal_helmet", "combat"), + entry("blood_crystal_chestplate", "combat"), + entry("blood_crystal_leggings", "combat"), + entry("blood_crystal_boots", "combat"), + entry("moggles", "combat"), + entry("scorpion_whip", "combat"), + entry("fallen_king_crown", "combat"), + entry("brutalfly_elytra", "combat"), + entry("jumpy_boots", "combat"), + entry("raw_uranium_scrap", "ingredients"), + entry("raw_titanium_scrap", "ingredients"), + entry("raw_uranium", "ingredients"), + entry("raw_titanium", "ingredients"), + entry("uranium_nugget", "ingredients"), + entry("titanium_nugget", "ingredients"), + entry("uranium_ingot", "ingredients"), + entry("titanium_ingot", "ingredients"), + entry("cloud_shark_fin", "ingredients"), + entry("cloud_shark_fin_soup", "ingredients"), + entry("basilisk_fang", "ingredients"), + entry("nightmare_scale", "ingredients"), + entry("molevore_nose", "ingredients"), + entry("moleworm", "ingredients"), + entry("mud_pie", "ingredients"), + entry("lucid_eye", "ingredients"), + entry("blood_crystal_shard", "ingredients"), + entry("blood_crystal_apple", "ingredients"), + entry("spirit_apple", "ingredients"), + entry("mantis_claw", "combat"), + entry("hercules_horn", "ingredients"), + entry("king_scale", "ingredients"), + entry("queen_scale", "ingredients"), + entry("chiten", "ingredients"), + entry("jerry_nucleus", "ingredients"), + entry("carapace", "ingredients"), + entry("stink_bug", "ingredients"), + entry("brutalfly_wing", "ingredients"), + entry("primordial_scute", "ingredients"), + entry("triffid_goo", "ingredients"), + entry("vortex_eye", "ingredients"), + entry("emperor_scorpion_stinger", "ingredients"), + entry("kraken_tooth", "ingredients"), + entry("kraken_tentacle", "ingredients"), + entry("jumpy_bug_leg", "ingredients"), + entry("cornea_ear", "ingredients"), + entry("corn", "ingredients"), + entry("high_fructose_corn_syrup", "ingredients"), + entry("peach", "ingredients"), + entry("peach_pie", "ingredients"), + entry("cornbread", "ingredients"), + entry("popcorn", "ingredients"), + entry("raw_corndog", "ingredients"), + entry("cooked_corndog", "ingredients"), + entry("raw_venison", "ingredients"), + entry("cooked_venison", "ingredients"), + entry("raw_bug_meat", "ingredients"), + entry("cooked_bug_meat", "ingredients"), + entry("broodfruit", "ingredients"), + entry("cheep", "ingredients"), + entry("root_beer", "ingredients"), + entry("rainbow_sugar", "ingredients"), + entry("big_bertha_blade", "ingredients"), + entry("big_bertha_handle", "ingredients"), + entry("big_bertha_hilt", "ingredients"), + entry("easter_bunny_spawn_egg", "spawn_eggs"), + entry("flying_squirrel_spawn_egg", "spawn_eggs"), + entry("caterpillar_spawn_egg", "spawn_eggs"), + entry("butterfly_spawn_egg", "spawn_eggs"), + entry("reverie_spawn_egg", "spawn_eggs"), + entry("brutalfly_spawn_egg", "spawn_eggs"), + entry("red_ant_spawn_egg", "spawn_eggs"), + entry("brown_ant_spawn_egg", "spawn_eggs"), + entry("rainbow_ant_spawn_egg", "spawn_eggs"), + entry("termite_spawn_egg", "spawn_eggs"), + entry("moleworm_spawn_egg", "spawn_eggs"), + entry("mantis_spawn_egg", "spawn_eggs"), + entry("alpha_mantis_spawn_egg", "spawn_eggs"), + entry("rolly_polly_spawn_egg", "spawn_eggs"), + entry("molevore_spawn_egg", "spawn_eggs"), + entry("triffid_spawn_egg", "spawn_eggs"), + entry("apple_cow_spawn_egg", "spawn_eggs"), + entry("golden_apple_cow_spawn_egg", "spawn_eggs"), + entry("enchanted_golden_apple_cow_spawn_egg", "spawn_eggs"), + entry("dr_trayaurus_spawn_egg", "spawn_eggs"), + entry("wasp_spawn_egg", "spawn_eggs"), + entry("bomber_spawn_egg", "spawn_eggs"), + entry("jumpy_bug_spawn_egg", "spawn_eggs"), + entry("spit_bug_spawn_egg", "spawn_eggs"), + entry("stink_bug_spawn_egg", "spawn_eggs"), + entry("cloud_shark_spawn_egg", "spawn_eggs"), + entry("kraken_spawn_egg", "spawn_eggs"), + entry("missile_squid_spawn_egg", "spawn_eggs"), + entry("octopus_bomb_spawn_egg", "spawn_eggs"), + entry("nightmare_spawn_egg", "spawn_eggs"), + entry("bed_bug_spawn_egg", "spawn_eggs"), + entry("lucid_spawn_egg", "spawn_eggs"), + entry("scorpion_spawn_egg", "spawn_eggs"), + entry("basilisk_spawn_egg", "spawn_eggs"), + entry("emperor_scorpion_spawn_egg", "spawn_eggs"), + entry("toreterror_spawn_egg", "spawn_eggs"), + entry("creeping_horror_spawn_egg", "spawn_eggs"), + entry("lurking_terror_spawn_egg", "spawn_eggs"), + entry("hercules_beetle_spawn_egg", "spawn_eggs"), + entry("jerry_spawn_egg", "spawn_eggs"), + entry("dorrie_spawn_egg", "spawn_eggs"), + entry("ouranwood_deer_spawn_egg", "spawn_eggs"), + entry("glimmer_spawn_egg", "spawn_eggs"), + entry("elka_spawn_egg", "spawn_eggs") + ); + + private static final List ANTARCHY_POTION_FAMILIES = List.of( + "dread", "long_dread", "inversion", "long_inversion", "stinky", "long_stinky", + "paralysis", "long_paralysis", "haste", "strong_haste", "shrinking", + "strong_shrinking", "extreme_shrinking", "growing", "strong_growing", "extreme_growing" + ); + + private static final Map ORDER_INDEX = createOrderIndex(); + + private static CatalogEntry entry(String path, String neoTabPath) { + return new CatalogEntry(path, neoTabPath, null); + } + + private static CatalogEntry entry(String path, String neoTabPath, String insertAfterPath) { + return new CatalogEntry(path, neoTabPath, insertAfterPath); + } + + private static Map createOrderIndex() { + HashMap index = new HashMap<>(); + for (int i = 0; i < CATALOG.size(); i++) { + index.put(CATALOG.get(i).path(), i); + } + return index; + } + + public static int orderIndex(Item item) { + return ORDER_INDEX.getOrDefault(path(item), Integer.MAX_VALUE); + } + + public static void populateAntarchyTab(AntarchyTabOutput output) { + for (CatalogEntry entry : CATALOG) { + if ("glimmer_bottle".equals(entry.path())) { + for (GlimmerVariant variant : GlimmerVariant.values()) { + output.accept(GlimmerBottleItem.create(variant)); + } + continue; + } + output.accept(item(entry.path())); + } + for (String potionPath : ANTARCHY_POTION_FAMILIES) { + acceptPotionFamily(output, potionPath); + } + } + + public static boolean populateNeoForgeVanillaTab(ResourceKey tabKey, HolderLookup.Provider holders, + NeoForgeVanillaTabOutput output) { + String tabPath = tabKey.location().getPath(); + boolean matched = false; + for (CatalogEntry entry : CATALOG) { + if (!tabPath.equals(entry.neoTabPath())) { + continue; + } + matched = true; + if (entry.insertAfterPath() != null) { + output.insertAfter(vanillaItem(entry.insertAfterPath()), item(entry.path())); + continue; + } + if ("combat".equals(tabPath)) { + if (isUltimateArmor(entry.path())) { + output.accept(UltimateGearHelper.createUltimateArmorStack(item(entry.path()), holders)); + continue; + } + if ("ultimate_bow".equals(entry.path())) { + output.accept(UltimateGearHelper.createUltimateBowStack(item(entry.path()), holders)); + continue; + } + } + output.accept(item(entry.path())); + } + if ("combat".equals(tabPath)) { + for (String potionPath : ANTARCHY_POTION_FAMILIES) { + Holder potion = potion(potionPath); + if (potion != null) { + output.accept(PotionContents.createItemStack(Items.POTION, potion)); + } + } + matched = true; + } + return matched; + } + + private static boolean isUltimateArmor(String path) { + return "ultimate_helmet".equals(path) + || "ultimate_chestplate".equals(path) + || "ultimate_leggings".equals(path) + || "ultimate_boots".equals(path); + } + + private static void acceptPotionFamily(AntarchyTabOutput output, String path) { + Holder potion = potion(path); + if (potion == null) { + return; + } + output.accept(PotionContents.createItemStack(Items.POTION, potion)); + output.accept(PotionContents.createItemStack(Items.SPLASH_POTION, potion)); + output.accept(PotionContents.createItemStack(Items.LINGERING_POTION, potion)); + output.accept(PotionContents.createItemStack(Items.TIPPED_ARROW, potion)); + } + + private static String path(Item item) { + return BuiltInRegistries.ITEM.getKey(item).getPath(); + } + + private static Item item(String path) { + return BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path)); + } + + private static Item vanillaItem(String path) { + return BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(path)); + } + + private static Holder potion(String path) { + Potion potion = BuiltInRegistries.POTION.get(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path)); + return potion == null ? null : BuiltInRegistries.POTION.wrapAsHolder(potion); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java index cc1fafd8..bdfe445c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/CreativeTabOrder.java @@ -8,362 +8,18 @@ public final class CreativeTabOrder { private CreativeTabOrder() {} public static final Comparator COMPARATOR = - Comparator.comparingInt(CreativeTabOrder::group) - .thenComparingInt(CreativeTabOrder::subOrder); + Comparator.comparingInt(CreativeTabContents::orderIndex) + .thenComparing(CreativeTabOrder::path); public static int group(Item item) { - String path = BuiltInRegistries.ITEM.getKey(item).getPath(); - return switch (path) { - case "ouranwood_log", "ouranwood_wood", "mossy_ouranwood_log", "mossy_ouranwood_wood", - "stripped_ouranwood_log", "stripped_ouranwood_wood", "duplicator_log", - "ouranwood_planks", "ouranwood_stairs", "ouranwood_slab", - "ouranwood_fence", "ouranwood_fence_gate", - "ouranwood_door", "ouranwood_trapdoor", - "ouranwood_pressure_plate", "ouranwood_button", - "ouranwood_sign", "ouranwood_hanging_sign", - "ouranwood_boat", "ouranwood_chest_boat", - "peach_log", "peach_wood", "stripped_peach_log", "stripped_peach_wood", - "peach_planks", "peach_stairs", "peach_slab", "peach_fence", "peach_fence_gate", - "peach_door", "peach_trapdoor", "peach_pressure_plate", "peach_button", - "peach_sign", "peach_hanging_sign", "peach_boat", "peach_chest_boat" -> 0; - case "nyxite", "polished_nyxite", "chiseled_nyxite", "nyxite_bricks", - "nyxite_stairs", "nyxite_slab", "nyxite_wall", - "polished_nyxite_stairs", "polished_nyxite_slab", "polished_nyxite_wall", - "nyxite_brick_stairs", "nyxite_brick_slab", "nyxite_brick_wall", - "pale_nyxite", "nyxite_spike", "potent_nyxite" -> 1; - case "shellstone", "polished_shellstone", "shellstone_bricks", "chiseled_shellstone", - "mossy_shellstone_bricks", "cracked_shellstone_bricks", - "shellstone_stairs", "shellstone_slab", "shellstone_wall", - "polished_shellstone_stairs", "polished_shellstone_slab", "polished_shellstone_wall", - "shellstone_brick_stairs", "shellstone_brick_slab", "shellstone_brick_wall", - "mossy_shellstone_brick_stairs", "mossy_shellstone_brick_slab", "mossy_shellstone_brick_wall", - "blush_moss_block", "blush_moss_carpet", - "lumen_froglight", "roseate_froglight" -> 2; - case "antimetal", "polished_antimetal" -> 3; - case "dream_sand", "dream_sandstone", "chiseled_dream_sandstone", - "cut_dream_sandstone", "smooth_dream_sandstone", - "dream_sandstone_stairs", "dream_sandstone_slab", "dream_sandstone_wall", - "smooth_dream_sandstone_stairs", "smooth_dream_sandstone_slab", - "cut_dream_sandstone_slab" -> 4; - case "umbral_moss_block", "umbral_moss_carpet" -> 4; - case "uranium_ore", "deepslate_uranium_ore", "broodstone_uranium_ore", - "titanium_ore", "deepslate_titanium_ore", "broodstone_titanium_ore", - "uranium_block", "titanium_block", - "cut_uranium", "cut_titanium", "cut_uranium_slab", "cut_titanium_slab", - "cut_uranium_stairs", "cut_titanium_stairs", - "chiseled_uranium", "chiseled_titanium", - "uranium_door", "titanium_door", "uranium_trapdoor", "titanium_trapdoor", - "uranium_bars", "titanium_bars", "uranium_bulb", "titanium_bulb" -> 6; - case "raw_uranium", "raw_titanium", "raw_uranium_scrap", "raw_titanium_scrap", - "raw_uranium_block", "raw_titanium_block" -> 7; - case "blood_crystal_block", "small_blood_crystal_bud", "medium_blood_crystal_bud", - "large_blood_crystal_bud", "budding_blood_crystal", "blood_crystal_cluster", - "myrmite", "biomite", "biomite_turf", "biowart", "biowart_tendrils", - "broodstone", "polished_broodstone", "chiseled_broodstone", "broodstone_bricks", - "broodstone_stairs", "broodstone_slab", "broodstone_wall", - "polished_broodstone_stairs", "polished_broodstone_slab", "polished_broodstone_wall", - "broodstone_brick_stairs", "broodstone_brick_slab", "broodstone_brick_wall", - "myrmite_coal_ore", "chiten_block", "chiten_spike", "amber_moss_block", "amber_moss_carpet", - "glowcap_mushroom", "glowcap_mushroom_block" -> 8; - case "ouranwood_leaves", "peach_leaves" -> 9; - case "duplicator_sapling", "ouranwood_acorn", "peach_sapling", "corn_seeds" -> 10; - case "orange_milkweed", "pink_milkweed", "camellia", "spider_lily", "lotus", "hushweed", "hanging_creeproots", "molting_vines", "amber_lichen", "creepvine", - "triffid_goo_block", "cloud_block", "wasp_nest", - "red_ant_nest", "brown_ant_nest", "rainbow_ant_nest", "termite_nest", - "star_coral", "star_coral_fan", "star_coral_block", - "dead_star_coral", "dead_star_coral_fan", "dead_star_coral_block" -> 11; - case "dream_torch", "dream_lantern", "dream_campfire", "dream_fire", "dream_fire_ceiling" -> 12; - case "antimetal_scaffolding" -> 13; - case "infested_rooted_dirt", "infested_coarse_dirt", "bed_bug_egg", "creeping_horror_egg", "lurking_terror_egg", "jumpy_bug_egg", "spit_bug_egg", "jerry_egg" -> 14; - case "ultimate_pickaxe", "ultimate_axe", "ultimate_shovel", "ultimate_hoe", - "duct_tape", "diamond_minecart", "critter_cage", "gravity_sculk_sensor", "miners_dream" -> 15; - case "bile_bucket", "ichor_bucket", "antiwater_bucket", "cloud_bucket", "lumen_bucket" -> 16; - case "moggles", "brutalfly_elytra", "fallen_king_crown", "jumpy_boots" -> 17; - case "battle_axe", "basilisk_dagger", "squidzooka", "rpo_launcher", "shrink_ray", "growth_ray", - "gravity_gun", "water_cannon", "nightmare_sword", "lucid_pearl", "scorpion_whip", "blood_crystal_katana", - "attitude_adjuster", "big_bertha", "big_bertha_blade", "big_bertha_handle", "big_bertha_hilt", - "ultimate_sword", "ultimate_mace", "krakens_grasp" -> 18; - case "primordial_helmet", "primordial_chestplate", - "primordial_leggings", "primordial_boots", - "blood_crystal_helmet", "blood_crystal_chestplate", - "blood_crystal_leggings", "blood_crystal_boots", - "nightmare_helmet", "nightmare_chestplate", - "nightmare_leggings", "nightmare_boots", - "ultimate_helmet", "ultimate_chestplate", - "ultimate_leggings", "ultimate_boots" -> 19; - case "ultimate_bow", "ultimate_crossbow" -> 20; - case "cloud_shark_fin_soup", "mud_pie", "peach_pie", "cornbread", "popcorn", "rainbow_sugar", - "blood_crystal_apple", "spirit_apple", "peach", "raw_corndog", "cooked_corndog", - "raw_venison", "cooked_venison", "raw_bug_meat", "cooked_bug_meat", "broodfruit" -> 21; - case "blood_crystal_shard", "cloud_shark_fin", "basilisk_fang", "kraken_tooth", "kraken_tentacle", - "emperor_scorpion_stinger", "nightmare_scale", "molevore_nose", - "moleworm", "uranium_nugget", "titanium_nugget", - "uranium_ingot", "titanium_ingot", "lucid_eye", - "mantis_claw", "hercules_horn", "jumpy_bug_leg", "brutalfly_wing", "cornea_ear", - "primordial_scute", "triffid_goo", "vortex_eye", - "king_scale", "queen_scale", "chiten", "jerry_nucleus", "carapace", - "stink_bug", "corn", "high_fructose_corn_syrup" -> 22; - case "reverie_bottle", "glimmer_bottle", "root_beer" -> 24; - case "easter_bunny_spawn_egg", "flying_squirrel_spawn_egg", "caterpillar_spawn_egg", - "butterfly_spawn_egg", "reverie_spawn_egg", "brutalfly_spawn_egg", - "red_ant_spawn_egg", "brown_ant_spawn_egg", "rainbow_ant_spawn_egg", "termite_spawn_egg", - "moleworm_spawn_egg", "mantis_spawn_egg", "alpha_mantis_spawn_egg", "rolly_polly_spawn_egg", - "molevore_spawn_egg", "triffid_spawn_egg", "apple_cow_spawn_egg", "golden_apple_cow_spawn_egg", - "enchanted_golden_apple_cow_spawn_egg", "dr_trayaurus_spawn_egg", "wasp_spawn_egg", - "bomber_spawn_egg", "jumpy_bug_spawn_egg", "spit_bug_spawn_egg", "stink_bug_spawn_egg", "cloud_shark_spawn_egg", - "kraken_spawn_egg", "missile_squid_spawn_egg", "octopus_bomb_spawn_egg", - "nightmare_spawn_egg", "bed_bug_spawn_egg", "lucid_spawn_egg", "scorpion_spawn_egg", - "basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg", - "dorrie_spawn_egg", "glimmer_spawn_egg", "ouranwood_deer_spawn_egg", "elka_spawn_egg", - "hercules_beetle_spawn_egg", "creeping_horror_spawn_egg", "lurking_terror_spawn_egg", "jerry_spawn_egg" -> 25; - default -> 99; - }; + return CreativeTabContents.orderIndex(item); } public static int subOrder(Item item) { - String path = BuiltInRegistries.ITEM.getKey(item).getPath(); - return switch (path) { - case "ouranwood_log" -> 0; - case "ouranwood_wood" -> 1; - case "mossy_ouranwood_log" -> 2; - case "mossy_ouranwood_wood" -> 3; - case "stripped_ouranwood_log" -> 4; - case "stripped_ouranwood_wood" -> 5; - case "duplicator_log" -> 6; - case "ouranwood_planks" -> 7; - case "ouranwood_stairs" -> 8; - case "ouranwood_slab" -> 9; - case "ouranwood_fence" -> 10; - case "ouranwood_fence_gate" -> 11; - case "ouranwood_door" -> 12; - case "ouranwood_trapdoor" -> 13; - case "ouranwood_pressure_plate" -> 14; - case "ouranwood_button" -> 15; - case "ouranwood_sign" -> 16; - case "ouranwood_hanging_sign" -> 17; - case "ouranwood_boat" -> 18; - case "ouranwood_chest_boat" -> 19; - case "peach_log" -> 20; - case "peach_wood" -> 21; - case "stripped_peach_log" -> 22; - case "stripped_peach_wood" -> 23; - case "peach_planks" -> 24; - case "peach_stairs" -> 25; - case "peach_slab" -> 26; - case "peach_fence" -> 27; - case "peach_fence_gate" -> 28; - case "peach_door" -> 29; - case "peach_trapdoor" -> 30; - case "peach_pressure_plate" -> 31; - case "peach_button" -> 32; - case "peach_sign" -> 33; - case "peach_hanging_sign" -> 34; - case "peach_boat" -> 35; - case "peach_chest_boat" -> 36; - case "ouranwood_leaves" -> 0; - case "peach_leaves" -> 1; - case "duplicator_sapling" -> 0; - case "ouranwood_acorn" -> 1; - case "peach_sapling" -> 2; - case "corn_seeds" -> 3; - case "orange_milkweed" -> 0; - case "pink_milkweed" -> 1; - case "camellia" -> 2; - case "spider_lily" -> 3; - case "hushweed" -> 4; - case "hanging_creeproots" -> 21; - case "molting_vines" -> 22; - case "amber_lichen" -> 5; - case "creepvine" -> 6; - case "triffid_goo_block" -> 7; - case "cloud_block" -> 8; - case "wasp_nest" -> 9; - case "red_ant_nest" -> 10; - case "brown_ant_nest" -> 11; - case "rainbow_ant_nest" -> 12; - case "termite_nest" -> 13; - case "star_coral" -> 14; - case "star_coral_fan" -> 15; - case "star_coral_block" -> 16; - case "dead_star_coral" -> 17; - case "dead_star_coral_fan" -> 18; - case "dead_star_coral_block" -> 19; - case "lotus" -> 20; - case "blood_crystal_block" -> 0; - case "small_blood_crystal_bud" -> 1; - case "medium_blood_crystal_bud" -> 2; - case "large_blood_crystal_bud" -> 3; - case "budding_blood_crystal" -> 4; - case "blood_crystal_cluster" -> 5; - case "myrmite" -> 6; - case "broodstone" -> 7; - case "polished_broodstone" -> 8; - case "chiseled_broodstone" -> 9; - case "broodstone_bricks" -> 10; - case "broodstone_stairs" -> 11; - case "broodstone_slab" -> 12; - case "broodstone_wall" -> 13; - case "polished_broodstone_stairs" -> 14; - case "polished_broodstone_slab" -> 15; - case "polished_broodstone_wall" -> 16; - case "broodstone_brick_stairs" -> 17; - case "broodstone_brick_slab" -> 18; - case "broodstone_brick_wall" -> 19; - case "myrmite_coal_ore" -> 20; - case "chiten_block" -> 21; - case "chiten_spike" -> 22; - case "amber_moss_block" -> 23; - case "amber_moss_carpet" -> 24; - case "glowcap_mushroom" -> 25; - case "glowcap_mushroom_block" -> 26; - case "uranium_ore" -> 0; - case "deepslate_uranium_ore" -> 1; - case "broodstone_uranium_ore" -> 2; - case "titanium_ore" -> 3; - case "deepslate_titanium_ore" -> 4; - case "broodstone_titanium_ore" -> 5; - case "uranium_block" -> 4; - case "titanium_block" -> 5; - case "cut_uranium" -> 6; - case "cut_titanium" -> 7; - case "cut_uranium_slab" -> 8; - case "cut_titanium_slab" -> 9; - case "cut_uranium_stairs" -> 10; - case "cut_titanium_stairs" -> 11; - case "chiseled_uranium" -> 12; - case "chiseled_titanium" -> 13; - case "uranium_door" -> 14; - case "titanium_door" -> 15; - case "uranium_trapdoor" -> 16; - case "titanium_trapdoor" -> 17; - case "uranium_bars" -> 18; - case "titanium_bars" -> 19; - case "uranium_bulb" -> 20; - case "titanium_bulb" -> 21; - case "raw_uranium" -> 0; - case "raw_titanium" -> 1; - case "raw_uranium_scrap" -> 2; - case "raw_titanium_scrap" -> 3; - case "raw_uranium_block" -> 4; - case "raw_titanium_block" -> 5; - case "dream_torch" -> 0; - case "dream_lantern" -> 1; - case "dream_campfire" -> 2; - case "dream_fire" -> 3; - case "dream_fire_ceiling" -> 4; - case "blush_moss_block" -> 18; - case "blush_moss_carpet" -> 19; - case "lumen_froglight" -> 20; - case "roseate_froglight" -> 21; - case "infested_rooted_dirt" -> 0; - case "infested_coarse_dirt" -> 1; - case "bed_bug_egg" -> 2; - case "ultimate_pickaxe" -> 0; - case "ultimate_axe" -> 1; - case "ultimate_shovel" -> 2; - case "ultimate_hoe" -> 3; - case "duct_tape" -> 4; - case "diamond_minecart" -> 5; - case "critter_cage" -> 6; - case "gravity_sculk_sensor" -> 7; - case "miners_dream" -> 8; - case "bile_bucket" -> 0; - case "ichor_bucket" -> 1; - case "antiwater_bucket" -> 2; - case "cloud_bucket" -> 3; - case "lumen_bucket" -> 4; - case "moggles" -> 0; - case "brutalfly_elytra" -> 1; - case "fallen_king_crown" -> 2; - case "jumpy_boots" -> 3; - case "battle_axe" -> 0; - case "basilisk_dagger" -> 1; - case "squidzooka" -> 2; - case "rpo_launcher" -> 3; - case "shrink_ray" -> 4; - case "growth_ray" -> 5; - case "gravity_gun" -> 6; - case "water_cannon" -> 7; - case "nightmare_sword" -> 8; - case "attitude_adjuster" -> 9; - case "lucid_pearl" -> 10; - case "scorpion_whip" -> 11; - case "blood_crystal_katana" -> 12; - case "big_bertha" -> 13; - case "big_bertha_blade" -> 14; - case "big_bertha_handle" -> 15; - case "big_bertha_hilt" -> 16; - case "ultimate_sword" -> 17; - case "ultimate_mace" -> 18; - case "krakens_grasp" -> 19; - case "primordial_helmet" -> 0; - case "primordial_chestplate" -> 1; - case "primordial_leggings" -> 2; - case "primordial_boots" -> 3; - case "blood_crystal_helmet" -> 4; - case "blood_crystal_chestplate" -> 5; - case "blood_crystal_leggings" -> 6; - case "blood_crystal_boots" -> 7; - case "nightmare_helmet" -> 8; - case "nightmare_chestplate" -> 9; - case "nightmare_leggings" -> 10; - case "nightmare_boots" -> 11; - case "ultimate_helmet" -> 12; - case "ultimate_chestplate" -> 13; - case "ultimate_leggings" -> 14; - case "ultimate_boots" -> 15; - case "ultimate_bow" -> 0; - case "ultimate_crossbow" -> 1; - case "cloud_shark_fin_soup" -> 0; - case "mud_pie" -> 1; - case "peach_pie" -> 2; - case "cornbread" -> 3; - case "popcorn" -> 4; - case "rainbow_sugar" -> 5; - case "raw_corndog" -> 6; - case "cooked_corndog" -> 7; - case "raw_venison" -> 8; - case "cooked_venison" -> 9; - case "raw_bug_meat" -> 10; - case "cooked_bug_meat" -> 11; - case "broodfruit" -> 12; - case "blood_crystal_apple" -> 10; - case "spirit_apple" -> 11; - case "peach" -> 12; - case "reverie_bottle" -> 0; - case "glimmer_bottle" -> 1; - case "root_beer" -> 2; - case "blood_crystal_shard" -> 0; - case "cloud_shark_fin" -> 1; - case "basilisk_fang" -> 2; - case "kraken_tooth" -> 3; - case "kraken_tentacle" -> 4; - case "emperor_scorpion_stinger" -> 5; - case "nightmare_scale" -> 6; - case "molevore_nose" -> 7; - case "moleworm" -> 8; - case "uranium_nugget" -> 9; - case "titanium_nugget" -> 10; - case "uranium_ingot" -> 11; - case "titanium_ingot" -> 12; - case "lucid_eye" -> 13; - case "mantis_claw" -> 14; - case "hercules_horn" -> 15; - case "jumpy_bug_leg" -> 16; - case "brutalfly_wing" -> 17; - case "cornea_ear" -> 18; - case "primordial_scute" -> 19; - case "triffid_goo" -> 20; - case "vortex_eye" -> 21; - case "king_scale" -> 22; - case "queen_scale" -> 23; - case "chiten" -> 24; - case "jerry_nucleus" -> 25; - case "carapace" -> 26; - case "stink_bug" -> 27; - case "corn" -> 28; - case "high_fructose_corn_syrup" -> 29; - default -> 0; - }; + return 0; + } + + private static String path(Item item) { + return BuiltInRegistries.ITEM.getKey(item).getPath(); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/AntarchyAdvancements.java b/common/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancements.java similarity index 94% rename from common/src/main/java/com/craisinlord/antarchy/content/AntarchyAdvancements.java rename to common/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancements.java index ad7c3374..dfea92d4 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/AntarchyAdvancements.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/advancement/AntarchyAdvancements.java @@ -1,4 +1,4 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.advancement; import net.minecraft.advancements.AdvancementHolder; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BedBugEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BedBugEggBlock.java index 48818b6a..de81e7d8 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BedBugEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BedBugEggBlock.java @@ -180,6 +180,10 @@ public class BedBugEggBlock extends Block { } } + public void hatchWithNucleus(ServerLevel level, BlockPos pos, BlockState state) { + this.hatchEggs(level, pos, state, level.random); + } + private void decreaseEggs(Level level, BlockPos pos, BlockState state) { int eggs = state.getValue(EGGS); if (eggs <= 1) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java index a36c6d1c..4134ffc2 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/BiowartTendrilsBlock.java @@ -1,5 +1,6 @@ package com.craisinlord.antarchy.content.block; +import com.craisinlord.antarchy.content.AntarchyTags; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; @@ -26,7 +27,7 @@ public class BiowartTendrilsBlock extends BushBlock { @Override protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) { - return super.mayPlaceOn(state, level, pos); + return state.is(AntarchyTags.Blocks.BIOWART_TENDRILS_PLANTABLE) || super.mayPlaceOn(state, level, pos); } @Override diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java index 91b5af76..0c09713e 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/CreepingHorrorEggBlock.java @@ -4,6 +4,7 @@ import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity; import com.craisinlord.antarchy.content.block.AmberMossBlock; import com.craisinlord.antarchy.content.block.LurkingTerrorEggBlock; +import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -37,6 +38,7 @@ public class CreepingHorrorEggBlock extends Block { public static final IntegerProperty HATCH = BlockStateProperties.HATCH; public static final IntegerProperty EGGS = BlockStateProperties.EGGS; private static final float PANIC_HATCH_CHANCE = 0.25F; + private static final double HORDE_ACCELERATION_RADIUS = 5.0D; private static final int MAX_HATCH = 2; private static final int MAX_EGGS = 4; private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D); @@ -204,6 +206,10 @@ public class CreepingHorrorEggBlock extends Block { } } + public void hatchWithNucleus(ServerLevel level, BlockPos pos, BlockState state) { + this.hatchEggs(level, pos, state, level.random, state.getValue(EGGS)); + } + private static int rollPanickedEggs(int eggs, RandomSource random) { int hatchedEggs = 0; for (int i = 0; i < eggs; i++) { @@ -224,6 +230,11 @@ public class CreepingHorrorEggBlock extends Block { } private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) { + if (level instanceof ServerLevel serverLevel + && CavarynHordeManager.shouldAccelerateNearbyEggHatching(serverLevel, pos, HORDE_ACCELERATION_RADIUS, level.random)) { + return true; + } + boolean onAmberMoss = level.getBlockState(pos.below()).getBlock() instanceof AmberMossBlock; return level.random.nextInt(onAmberMoss ? 150 : 500) == 0; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/DuctTapeBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/DuctTapeBlock.java index f881db51..5ddf8e5c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/DuctTapeBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/DuctTapeBlock.java @@ -1,7 +1,7 @@ package com.craisinlord.antarchy.content.block; import com.craisinlord.antarchy.config.AntarchySettings; -import com.craisinlord.antarchy.content.AntarchyAdvancements; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.AntarchyTags; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java index 3a0c37cd..edea3005 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/JerryEggBlock.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.block; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.entity.JerryEntity; +import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -32,6 +33,7 @@ public class JerryEggBlock extends Block { public static final BooleanProperty ROTATED = BooleanProperty.create("rotated"); private static final ResourceLocation JERRY_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jerry"); private static final int HATCH_CHECK_INTERVAL = 1200; + private static final double HORDE_ACCELERATION_RADIUS = 5.0D; private static final VoxelShape SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); public JerryEggBlock(BlockBehaviour.Properties properties) { @@ -83,9 +85,18 @@ public class JerryEggBlock extends Block { @Override protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { - if (random.nextInt(HATCH_CHECK_INTERVAL) != 0) { + if (!CavarynHordeManager.shouldAccelerateNearbyEggHatching(level, pos, HORDE_ACCELERATION_RADIUS, random) + && random.nextInt(HATCH_CHECK_INTERVAL) != 0) { return; } + this.hatch(level, pos, random); + } + + public void hatchWithNucleus(ServerLevel level, BlockPos pos) { + this.hatch(level, pos, level.random); + } + + private void hatch(ServerLevel level, BlockPos pos, RandomSource random) { EntityType entityType = BuiltInRegistries.ENTITY_TYPE.get(JERRY_ID); if (entityType.create(level) instanceof JerryEntity jerry) { jerry.setStage(JerryEntity.Stage.INFANT); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java index a37ae85a..f5dac862 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/JumpyBugEggBlock.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.block; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.entity.JumpyBugEntity; +import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -38,6 +39,7 @@ public class JumpyBugEggBlock extends Block { public static final BooleanProperty ROTATED = BooleanProperty.create("rotated"); private static final int MAX_HATCH = 2; private static final double PLAYER_PROXIMITY_RADIUS = 12.0D; + private static final double HORDE_ACCELERATION_RADIUS = 5.0D; private static final float PLAYER_PROXIMITY_HATCH_CHANCE = 0.25F; private static final int PLAYER_PROXIMITY_CHECK_INTERVAL = 200; private static final VoxelShape FLOOR_SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); @@ -119,6 +121,11 @@ public class JumpyBugEggBlock extends Block { } private boolean shouldUpdateHatchLevel(Level level, BlockPos pos, BlockState state) { + if (level instanceof ServerLevel serverLevel + && CavarynHordeManager.shouldAccelerateNearbyEggHatching(serverLevel, pos, HORDE_ACCELERATION_RADIUS, level.random)) { + return true; + } + if (level.random.nextInt(PLAYER_PROXIMITY_CHECK_INTERVAL) == 0) { Player nearbyPlayer = level.getNearestPlayer(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, PLAYER_PROXIMITY_RADIUS, false); if (nearbyPlayer != null && level.random.nextFloat() < PLAYER_PROXIMITY_HATCH_CHANCE) { @@ -149,6 +156,10 @@ public class JumpyBugEggBlock extends Block { level.addFreshEntity(entity); } + public void hatchWithNucleus(ServerLevel level, BlockPos pos) { + this.hatch(level, pos, level.random); + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(HATCH, HANGING, ROTATED); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java index f352b6c0..8a05880c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/LurkingTerrorEggBlock.java @@ -4,6 +4,7 @@ import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity; import com.craisinlord.antarchy.content.block.AmberMossBlock; import com.craisinlord.antarchy.content.block.CreepingHorrorEggBlock; +import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -37,6 +38,7 @@ public class LurkingTerrorEggBlock extends Block { public static final IntegerProperty HATCH = BlockStateProperties.HATCH; public static final IntegerProperty EGGS = BlockStateProperties.EGGS; private static final float PANIC_HATCH_CHANCE = 0.25F; + private static final double HORDE_ACCELERATION_RADIUS = 5.0D; private static final int MAX_HATCH = 2; private static final int MAX_EGGS = 4; private static final VoxelShape SINGLE_SHAPE = Block.box(3.0D, 0.0D, 3.0D, 13.0D, 7.0D, 13.0D); @@ -204,6 +206,10 @@ public class LurkingTerrorEggBlock extends Block { } } + public void hatchWithNucleus(ServerLevel level, BlockPos pos, BlockState state) { + this.hatchEggs(level, pos, state, level.random, state.getValue(EGGS)); + } + private static int rollPanickedEggs(int eggs, RandomSource random) { int hatchedEggs = 0; for (int i = 0; i < eggs; i++) { @@ -224,6 +230,11 @@ public class LurkingTerrorEggBlock extends Block { } private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) { + if (level instanceof ServerLevel serverLevel + && CavarynHordeManager.shouldAccelerateNearbyEggHatching(serverLevel, pos, HORDE_ACCELERATION_RADIUS, level.random)) { + return true; + } + boolean onAmberMoss = level.getBlockState(pos.below()).getBlock() instanceof AmberMossBlock; return level.random.nextInt(onAmberMoss ? 150 : 500) == 0; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/PotentNyxiteBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/PotentNyxiteBlock.java index 414fa23d..4a0a7f5c 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/PotentNyxiteBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/PotentNyxiteBlock.java @@ -1,9 +1,9 @@ package com.craisinlord.antarchy.content.block; -import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.block.entity.PotentNyxiteBlockEntity; import com.craisinlord.antarchy.content.block.state.PotentNyxiteState; import com.craisinlord.antarchy.content.AntarchyTags; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.mojang.serialization.MapCodec; import java.util.function.Supplier; import net.minecraft.core.BlockPos; @@ -31,13 +31,9 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; public class PotentNyxiteBlock extends BaseEntityBlock { - private static final ResourceLocation ANTIWATER_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "antiwater"); - private static final ResourceLocation FLOWING_ANTIWATER_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_antiwater"); - private static final ResourceLocation ICHOR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "ichor"); - private static final ResourceLocation FLOWING_ICHOR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_ichor"); - private static final ResourceLocation HYPNOTIC_GAS_SOUND_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "potent_nyxite_hypnotic_gas"); - private static final ResourceLocation HYPNOTIC_GAS_CLOUD_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hypnotic_gas_cloud"); - private static final ResourceLocation HYPNOTIC_GAS_CLOUD_DOWN_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hypnotic_gas_cloud_down"); + private static final ResourceLocation HYPNOTIC_GAS_SOUND_ID = ResourceLocation.fromNamespaceAndPath("antarchy", "potent_nyxite_hypnotic_gas"); + private static final ResourceLocation HYPNOTIC_GAS_CLOUD_ID = ResourceLocation.fromNamespaceAndPath("antarchy", "hypnotic_gas_cloud"); + private static final ResourceLocation HYPNOTIC_GAS_CLOUD_DOWN_ID = ResourceLocation.fromNamespaceAndPath("antarchy", "hypnotic_gas_cloud_down"); public static final EnumProperty STATE = EnumProperty.create("state", PotentNyxiteState.class); @@ -177,16 +173,6 @@ public class PotentNyxiteBlock extends BaseEntityBlock { return fluidDirection != null && hasContinuousTrigger(level, pos, fluidDirection); } - public static boolean isAntiwater(FluidState fluidState) { - ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); - return ANTIWATER_ID.equals(fluidId) || FLOWING_ANTIWATER_ID.equals(fluidId); - } - - public static boolean isIchor(FluidState fluidState) { - ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); - return ICHOR_ID.equals(fluidId) || FLOWING_ICHOR_ID.equals(fluidId); - } - public static Direction getEruptionDirection(LevelAccessor level, BlockPos pos) { Direction fluidDirection = getFluidColumnDirection(level, pos); if (fluidDirection != null) { @@ -236,12 +222,12 @@ public class PotentNyxiteBlock extends BaseEntityBlock { public static boolean hasAntiwaterOnSide(LevelAccessor level, BlockPos pos, Direction direction) { FluidState fluidState = level.getFluidState(pos.relative(direction)); - return fluidState.isSource() && isAntiwater(fluidState); + return fluidState.isSource() && AntarchyFluidChecks.isAntiwater(fluidState); } public static boolean hasGasFluid(LevelAccessor level, BlockPos pos, Direction direction) { FluidState fluidState = level.getFluidState(pos.relative(direction)); - return fluidState.isSource() && isAntiwater(fluidState); + return fluidState.isSource() && AntarchyFluidChecks.isAntiwater(fluidState); } public static boolean hasPeriodicTrigger(LevelAccessor level, BlockPos pos, Direction direction) { @@ -269,7 +255,7 @@ public class PotentNyxiteBlock extends BaseEntityBlock { BlockPos.MutableBlockPos cursor = pos.relative(direction).mutable(); while (true) { FluidState fluidState = level.getFluidState(cursor); - if (!isAntiwater(fluidState)) { + if (!AntarchyFluidChecks.isAntiwater(fluidState)) { break; } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java b/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java index a674c328..e29802ad 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/SpitBugEggBlock.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.block; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.content.entity.SpitBugEntity; +import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -37,6 +38,7 @@ public class SpitBugEggBlock extends Block { public static final BooleanProperty ROTATED = BooleanProperty.create("rotated"); private static final int MAX_HATCH = 2; private static final double PLAYER_PROXIMITY_RADIUS = 12.0D; + private static final double HORDE_ACCELERATION_RADIUS = 5.0D; private static final float PLAYER_PROXIMITY_HATCH_CHANCE = 0.25F; private static final int PLAYER_PROXIMITY_CHECK_INTERVAL = 200; private static final VoxelShape SHAPE = Block.box(1.5D, 0.0D, 1.5D, 14.5D, 16.0D, 14.5D); @@ -106,6 +108,11 @@ public class SpitBugEggBlock extends Block { } private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) { + if (level instanceof ServerLevel serverLevel + && CavarynHordeManager.shouldAccelerateNearbyEggHatching(serverLevel, pos, HORDE_ACCELERATION_RADIUS, level.random)) { + return true; + } + if (level.random.nextInt(PLAYER_PROXIMITY_CHECK_INTERVAL) == 0) { Player nearbyPlayer = level.getNearestPlayer(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, PLAYER_PROXIMITY_RADIUS, false); if (nearbyPlayer != null && level.random.nextFloat() < PLAYER_PROXIMITY_HATCH_CHANCE) { @@ -135,6 +142,10 @@ public class SpitBugEggBlock extends Block { level.addFreshEntity(entity); } + public void hatchWithNucleus(ServerLevel level, BlockPos pos) { + this.hatch(level, pos, level.random); + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(HATCH, ROTATED); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/block/entity/PotentNyxiteBlockEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/block/entity/PotentNyxiteBlockEntity.java index fcfce0f4..8c09372d 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/block/entity/PotentNyxiteBlockEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/block/entity/PotentNyxiteBlockEntity.java @@ -5,6 +5,7 @@ import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; import com.craisinlord.antarchy.content.block.state.PotentNyxiteState; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; @@ -502,7 +503,7 @@ public class PotentNyxiteBlockEntity extends BlockEntity { } private static boolean isHypnoticGasFluid(FluidState fluidState) { - return PotentNyxiteBlock.isAntiwater(fluidState); + return AntarchyFluidChecks.isAntiwater(fluidState); } private static boolean haveLineOfSight(Level level, Vec3 from, Vec3 to) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/boss/EntityLinkedServerBossEvent.java b/common/src/main/java/com/craisinlord/antarchy/content/boss/EntityLinkedServerBossEvent.java new file mode 100644 index 00000000..b615c6ef --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/boss/EntityLinkedServerBossEvent.java @@ -0,0 +1,20 @@ +package com.craisinlord.antarchy.content.boss; + +import java.util.UUID; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerBossEvent; +import net.minecraft.world.BossEvent; + +public class EntityLinkedServerBossEvent extends ServerBossEvent { + private final UUID entityId; + + public EntityLinkedServerBossEvent(UUID entityId, Component name, BossEvent.BossBarColor color, BossEvent.BossBarOverlay overlay) { + super(name, color, overlay); + this.entityId = entityId; + } + + @Override + public UUID getId() { + return this.entityId; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/GoopedHudRenderer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/GoopedHudRenderer.java index 4e8a6e36..228dd136 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/GoopedHudRenderer.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/GoopedHudRenderer.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.content.client; -import com.craisinlord.antarchy.content.GoopedEffectHooks; +import com.craisinlord.antarchy.content.effect.GoopedEffectHooks; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.core.Holder; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java index 2de22d11..ec900236 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/HordeHudRenderer.java @@ -30,9 +30,10 @@ public final class HordeHudRenderer { } float pulse = 0.9F + 0.1F * Mth.sin(minecraft.player.tickCount * ((float) Math.PI * 2.0F / 90.0F)); - int alpha = Mth.clamp((int) (intensity * pulse * 0x78), 0, 0x78); + int alpha = Mth.clamp((int) (intensity * pulse * 0x2C), 0, 0x2C); int width = minecraft.getWindow().getGuiScaledWidth(); int height = minecraft.getWindow().getGuiScaledHeight(); - guiGraphics.fill(0, 0, width, height, (alpha << 24) | 0xD84A16); + int color = (alpha << 24) | 0xD84A16; + guiGraphics.fill(0, 0, width, height, color); } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/hud/CustomBossBarRenderer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/hud/CustomBossBarRenderer.java new file mode 100644 index 00000000..aebcd057 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/hud/CustomBossBarRenderer.java @@ -0,0 +1,96 @@ +package com.craisinlord.antarchy.content.client.hud; + +import com.craisinlord.antarchy.Antarchy; +import com.craisinlord.antarchy.content.entity.AlphaMantisEntity; +import com.craisinlord.antarchy.content.entity.EmperorScorpionEntity; +import com.craisinlord.antarchy.content.entity.HerculesBeetleEntity; +import com.craisinlord.antarchy.content.entity.ToreterrorEntity; +import com.craisinlord.antarchy.content.entity.brutalfly.BrutalflyEntity; +import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity; +import java.util.Map; +import java.util.UUID; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.BossEvent; +import net.minecraft.world.entity.Entity; + +public final class CustomBossBarRenderer { + private static final int BAR_WIDTH = 182; + private static final int BAR_HEIGHT = 5; + private static final int GLOBAL_Y_OFFSET = 15; + + private static final Map, Textures> BY_ENTITY_CLASS = Map.of( + KrakenEntity.class, textures("blue", "kraken", 204, 56, 4), + ToreterrorEntity.class, textures("green", "toreterror", 194, 58, 2), + AlphaMantisEntity.class, textures("green", "alpha_mantis", 205, 49, 6), + BrutalflyEntity.class, textures("brutalfly", "brutalfly", 198, 38, 3), + HerculesBeetleEntity.class, textures("beetle", "hercules_beetle", 194, 33, 1), + EmperorScorpionEntity.class, textures("purple", "scorpion", 218, 34, -2) + ); + + private CustomBossBarRenderer() { + } + + public static boolean render(GuiGraphics guiGraphics, int x, int y, BossEvent bossEvent) { + Textures textures = lookup(bossEvent); + if (textures == null) { + return false; + } + + int baseY = y + GLOBAL_Y_OFFSET; + int barY = baseY + textures.barYOffset; + + guiGraphics.blit(textures.background, x, barY, 0, 0, BAR_WIDTH, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + + int filledWidth = Math.round(BAR_WIDTH * Math.max(0.0F, Math.min(1.0F, bossEvent.getProgress()))); + if (filledWidth > 0) { + guiGraphics.blit(textures.progress, x, barY, 0, 0, filledWidth, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + } + + int overlayX = x + (BAR_WIDTH - textures.overlayWidth) / 2; + int overlayY = baseY + (BAR_HEIGHT - textures.overlayHeight) / 2; + guiGraphics.blit(textures.overlay, overlayX, overlayY, 0, 0, textures.overlayWidth, textures.overlayHeight, textures.overlayWidth, textures.overlayHeight); + + return true; + } + + public static boolean isCustomBoss(BossEvent bossEvent) { + return lookup(bossEvent) != null; + } + + private static Textures lookup(BossEvent bossEvent) { + Entity entity = findEntity(bossEvent.getId()); + if (entity == null) { + return null; + } + return BY_ENTITY_CLASS.get(entity.getClass()); + } + + private static Entity findEntity(UUID id) { + Minecraft minecraft = Minecraft.getInstance(); + if (minecraft.level == null) { + return null; + } + for (Entity entity : minecraft.level.entitiesForRendering()) { + if (entity.getUUID().equals(id)) { + return entity; + } + } + return null; + } + + private static Textures textures(String barKey, String overlayKey, int overlayWidth, int overlayHeight, int barYOffset) { + return new Textures( + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/gui/boss_bars/healthbars/" + barKey + "_background.png"), + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/gui/boss_bars/healthbars/" + barKey + "_progress.png"), + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/gui/boss_bars/" + overlayKey + ".png"), + overlayWidth, + overlayHeight, + barYOffset + ); + } + + private record Textures(ResourceLocation background, ResourceLocation progress, ResourceLocation overlay, int overlayWidth, int overlayHeight, int barYOffset) { + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedGeoLayer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedGeoLayer.java index d316413e..a784f295 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedGeoLayer.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedGeoLayer.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.content.client.renderer; -import com.craisinlord.antarchy.content.GoopedEffectHooks; +import com.craisinlord.antarchy.content.effect.GoopedEffectHooks; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import net.minecraft.client.renderer.MultiBufferSource; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedLivingLayer.java b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedLivingLayer.java index 4c05dc9f..22b6cf4a 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedLivingLayer.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/client/renderer/GoopedLivingLayer.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.content.client.renderer; -import com.craisinlord.antarchy.content.GoopedEffectHooks; +import com.craisinlord.antarchy.content.effect.GoopedEffectHooks; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import net.minecraft.client.model.EntityModel; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/RpoLauncherDispenseBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/RpoLauncherDispenseBehavior.java similarity index 93% rename from common/src/main/java/com/craisinlord/antarchy/content/RpoLauncherDispenseBehavior.java rename to common/src/main/java/com/craisinlord/antarchy/content/dispenser/RpoLauncherDispenseBehavior.java index 8b5f0b5e..8adbf352 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/RpoLauncherDispenseBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/RpoLauncherDispenseBehavior.java @@ -1,6 +1,7 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.dispenser; import com.craisinlord.antarchy.config.AntarchySettings; +import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.entity.OctopusBombEntity; import net.minecraft.core.Direction; import net.minecraft.core.Position; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/SizeRayDispenseBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/SizeRayDispenseBehavior.java similarity index 97% rename from common/src/main/java/com/craisinlord/antarchy/content/SizeRayDispenseBehavior.java rename to common/src/main/java/com/craisinlord/antarchy/content/dispenser/SizeRayDispenseBehavior.java index b5f6eb97..b9f043d6 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/SizeRayDispenseBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/SizeRayDispenseBehavior.java @@ -1,4 +1,4 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.dispenser; import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.entity.SizeRayProjectileEntity; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/SquidzookaDispenseBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/SquidzookaDispenseBehavior.java similarity index 93% rename from common/src/main/java/com/craisinlord/antarchy/content/SquidzookaDispenseBehavior.java rename to common/src/main/java/com/craisinlord/antarchy/content/dispenser/SquidzookaDispenseBehavior.java index 271f5d49..96e064c8 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/SquidzookaDispenseBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/SquidzookaDispenseBehavior.java @@ -1,6 +1,7 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.dispenser; import com.craisinlord.antarchy.config.AntarchySettings; +import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.entity.MissileSquidEntity; import net.minecraft.core.Direction; import net.minecraft.core.Position; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/WaterCannonDispenseBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/WaterCannonDispenseBehavior.java similarity index 96% rename from common/src/main/java/com/craisinlord/antarchy/content/WaterCannonDispenseBehavior.java rename to common/src/main/java/com/craisinlord/antarchy/content/dispenser/WaterCannonDispenseBehavior.java index 4f7acb30..ff8b5884 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/WaterCannonDispenseBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/dispenser/WaterCannonDispenseBehavior.java @@ -1,4 +1,4 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.dispenser; import com.craisinlord.antarchy.content.entity.WaterBombEntity; import com.craisinlord.antarchy.content.AntarchyObjects; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/GoopedEffectHooks.java b/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedEffectHooks.java similarity index 94% rename from common/src/main/java/com/craisinlord/antarchy/content/GoopedEffectHooks.java rename to common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedEffectHooks.java index ff72291d..7db57898 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/GoopedEffectHooks.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/effect/GoopedEffectHooks.java @@ -1,4 +1,4 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.effect; import com.craisinlord.antarchy.Antarchy; import net.minecraft.core.Holder; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/StinkyBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java similarity index 98% rename from common/src/main/java/com/craisinlord/antarchy/content/StinkyBehavior.java rename to common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java index 6c0e5d35..879016bb 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/StinkyBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyBehavior.java @@ -1,5 +1,7 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.effect; +import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.AntarchyTags; import net.minecraft.server.level.ServerLevel; import net.minecraft.tags.EntityTypeTags; import net.minecraft.world.effect.MobEffectInstance; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyMobEffect.java b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyMobEffect.java index 13715363..495a325a 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyMobEffect.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/effect/StinkyMobEffect.java @@ -1,6 +1,5 @@ package com.craisinlord.antarchy.content.effect; -import com.craisinlord.antarchy.content.StinkyBehavior; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.entity.LivingEntity; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/AlphaMantisEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/AlphaMantisEntity.java index a1ed6773..11d95b98 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/AlphaMantisEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/AlphaMantisEntity.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.Nullable; public class AlphaMantisEntity extends MantisEntity { private final ServerBossEvent bossEvent = - new ServerBossEvent(Component.translatable("entity.antarchy.alpha_mantis"), BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS); + new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), Component.translatable("entity.antarchy.alpha_mantis"), BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS); private int summonCooldownTicks; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/EmperorScorpionEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/EmperorScorpionEntity.java index b30a6741..69a702fa 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/EmperorScorpionEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/EmperorScorpionEntity.java @@ -101,7 +101,7 @@ public class EmperorScorpionEntity extends Monster implements GeoEntity { private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); private final ServerBossEvent bossEvent = - new ServerBossEvent(this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS); + new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS); private int attackAnimTicks; private int clawCooldownTicks; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java index c124caee..d3f9ddb1 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/HerculesBeetleEntity.java @@ -88,6 +88,8 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl SynchedEntityData.defineId(HerculesBeetleEntity.class, EntityDataSerializers.BOOLEAN); private static final EntityDataAccessor KNOCKED_DOWN = SynchedEntityData.defineId(HerculesBeetleEntity.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor MOUNTED_CHARGE = + SynchedEntityData.defineId(HerculesBeetleEntity.class, EntityDataSerializers.INT); private static final int ANIM_IDLE = 0; private static final int ANIM_WALK = 1; @@ -147,11 +149,13 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl private static final int MAX_BROKEN_BLOCKS = 32; private static final int MAX_SUFFOCATION_BLOCKS = 12; private static final EntityDimensions DEFAULT_DIMENSIONS = EntityDimensions.scalable(3.0F, 4.0F); - private static final double MOUNTED_FLYING_SPEED_MULTIPLIER = 0.06D; + private static final double MOUNTED_FLYING_SPEED_MULTIPLIER = 0.052D; + private static final double MOUNTED_GROUND_BRAKE = 0.6D; + private static final double MOUNTED_FLIGHT_LIFT = 0.36D; private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); private final ServerBossEvent bossEvent = - new ServerBossEvent(Component.translatable("entity.antarchy.hercules_beetle"), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS); + new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), Component.translatable("entity.antarchy.hercules_beetle"), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS); private int actionTicks; private int actionHitTick; @@ -164,8 +168,12 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl private int flightCooldown; private int targetlessTicks; private int groundedTicks; + private int airborneTicks; + private int mountedChargeTicks; private boolean attackDamageApplied; private boolean riderJumpPressed; + private boolean riderJumpPressedLastTick; + private boolean mountedChargeActive; private boolean combatCryDone; private boolean pendingChargeStart; private boolean pendingMountedCharge; @@ -242,14 +250,19 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl builder.define(SADDLED, false); builder.define(FLYING, false); builder.define(KNOCKED_DOWN, false); + builder.define(MOUNTED_CHARGE, 0); } @Override public void registerControllers(AnimatableManager.ControllerRegistrar controllers) { controllers.add(new AnimationController<>(this, "main_controller", 0, this::mainAnimController)); + controllers.add(new AnimationController<>(this, "flying_charge_controller", 0, this::flyingChargeAnimController)); } private PlayState mainAnimController(AnimationState state) { + if (this.isFlying() && (this.getAnimationState() == ANIM_CHARGE_START || this.getAnimationState() == ANIM_CHARGE)) { + return state.setAndContinue(FLY_ANIM); + } return switch (this.getAnimationState()) { case ANIM_WALK -> state.setAndContinue(WALK_ANIM); case ANIM_FLY -> state.setAndContinue(FLY_ANIM); @@ -268,6 +281,22 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl }; } + private PlayState flyingChargeAnimController(AnimationState state) { + if (!this.isFlying()) { + state.resetCurrentAnimation(); + return PlayState.STOP; + } + + return switch (this.getAnimationState()) { + case ANIM_CHARGE_START -> state.setAndContinue(CHARGE_START_ANIM); + case ANIM_CHARGE -> state.setAndContinue(CHARGE_ANIM); + default -> { + state.resetCurrentAnimation(); + yield PlayState.STOP; + } + }; + } + @Override public AnimatableInstanceCache getAnimatableInstanceCache() { return this.geoCache; @@ -305,10 +334,14 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl if (this.onGround()) { this.groundedTicks++; + this.airborneTicks = 0; } else { this.groundedTicks = 0; + this.airborneTicks++; } + this.tickMountedCharge(); + if (this.isDeadOrDying()) { this.noPhysics = false; this.setAnimationState(ANIM_DEATH); @@ -353,7 +386,8 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl private void tickKnockedDown() { this.getNavigation().stop(); - this.setDeltaMovement(Vec3.ZERO); + Vec3 motion = this.getDeltaMovement(); + this.setDeltaMovement(0.0D, Math.min(motion.y, 0.0D), 0.0D); if (this.getAnimationState() == ANIM_KNOCKED_DOWN && this.actionTicks > 0) { this.actionTicks--; if (this.actionTicks <= 0) { @@ -389,6 +423,11 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl switch (state) { case ANIM_OPEN_WINGS -> { this.setFlying(true); + if (this.getControllingPassenger() instanceof Player) { + Vec3 motion = this.getDeltaMovement(); + this.setDeltaMovement(motion.x, Math.max(motion.y, MOUNTED_FLIGHT_LIFT), motion.z); + this.hasImpulse = true; + } if (this.pendingChargeStart) { this.pendingChargeStart = false; this.beginChargeStart(this.chargeDirection, this.pendingChargeDuration, this.pendingMountedCharge); @@ -449,6 +488,7 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl private void tickMountedMotion() { if (!(this.getControllingPassenger() instanceof Player rider) || this.isKnockedDown()) { + this.riderJumpPressedLastTick = false; return; } if (this.chargeTicksRemaining > 0 || this.getAnimationState() == ANIM_CHARGE_START || this.getAnimationState() == ANIM_OPEN_WINGS) { @@ -459,15 +499,36 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl this.yHeadRot = this.getYRot(); this.yBodyRot = this.getYRot(); - if (this.onGround() && this.isFlying()) { - this.requestFlightStop(); + if (this.isFlying() && this.onGround()) { + this.forceMountedFlightStop(); return; } - boolean wantsFlight = this.riderJumpPressed || rider.getXRot() < -5.0F || this.fallDistance > 2.5F; - if (wantsFlight && !this.isFlying() && this.onGround() && this.flightCooldown <= 0) { - this.requestFlightStart(); + if (this.isFlying()) { + this.riderJumpPressedLastTick = this.riderJumpPressed; + return; } + + boolean jumpPressedThisTick = this.riderJumpPressed; + boolean jumpPressedEdge = jumpPressedThisTick && !this.riderJumpPressedLastTick; + + if (jumpPressedEdge && this.onGround()) { + if (this.flightCooldown <= 0) { + this.requestFlightStart(); + } + } + + this.riderJumpPressedLastTick = jumpPressedThisTick; + } + + private void forceMountedFlightStop() { + this.setFlying(false); + this.actionTicks = 0; + this.flightCooldown = 8; + if (this.getAnimationState() == ANIM_OPEN_WINGS || this.getAnimationState() == ANIM_CLOSE_WINGS) { + this.setAnimationState(ANIM_IDLE); + } + this.updateAmbientAnimation(); } private void updateAmbientAnimation() { @@ -480,13 +541,15 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl return; } if (!this.onGround()) { - this.setAnimationState(ANIM_FLY); + this.setAnimationState(ANIM_IDLE); return; } - if (this.getControllingPassenger() instanceof Player rider - && (Math.abs(rider.zza) > 0.05F || Math.abs(rider.xxa) > 0.05F)) { - this.setAnimationState(ANIM_WALK); - return; + if (this.getControllingPassenger() instanceof Player rider) { + boolean riderMoving = Math.abs(rider.zza) > 0.05F || Math.abs(rider.xxa) > 0.05F; + if (riderMoving) { + this.setAnimationState(ANIM_WALK); + return; + } } Vec3 motion = this.getDeltaMovement(); boolean moving = motion.horizontalDistanceSqr() > 0.0025D; @@ -954,6 +1017,10 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl this.riderJumpPressed = riderJumpPressed; } + public int getMountedCharge() { + return this.entityData.get(MOUNTED_CHARGE); + } + public void handleMountedRegularAttack(ServerPlayer player) { if (!this.canPlayerControl(player) || this.attackCooldown > 0 || this.isKnockedDown() || this.isInBusyAnimation() || this.chargeTicksRemaining > 0) { return; @@ -962,14 +1029,29 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl this.startRegularAttack(this.isFlying(), target); } - public void handleMountedCharge(ServerPlayer player, int chargeTicks) { + public void startMountedCharge(ServerPlayer player) { if (!this.canPlayerControl(player) || this.chargeCooldown > 0 || this.isKnockedDown() || this.isInBusyAnimation() || this.chargeTicksRemaining > 0) { + this.resetMountedChargeState(); return; } - int clamped = Mth.clamp(chargeTicks, 0, MAX_PLAYER_CHARGE_TICKS); - if (clamped <= 0) { + this.mountedChargeActive = true; + } + + public void releaseMountedCharge(ServerPlayer player) { + if (!this.canPlayerControl(player)) { + this.resetMountedChargeState(); return; } + if (!this.mountedChargeActive) { + return; + } + + int clamped = Mth.clamp(this.mountedChargeTicks, 0, MAX_PLAYER_CHARGE_TICKS); + this.resetMountedChargeState(); + if (this.chargeCooldown > 0 || this.isKnockedDown() || this.isInBusyAnimation() || this.chargeTicksRemaining > 0 || clamped <= 0) { + return; + } + int duration = MIN_MOUNTED_CHARGE_TICKS + Mth.floor((MAX_CHARGE_TICKS - MIN_MOUNTED_CHARGE_TICKS) * (clamped / (float) MAX_PLAYER_CHARGE_TICKS)); this.startCharge(player.getLookAngle(), duration, true); } @@ -1013,7 +1095,7 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl @Override public void travel(Vec3 travelVector) { - if (!(this.getControllingPassenger() instanceof Player rider) || !this.isVehicle()) { + if (!(this.getControllingPassenger() instanceof Player rider) || !this.isVehicle() || this.isKnockedDown()) { super.travel(travelVector); return; } @@ -1024,11 +1106,25 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl Vec3 riddenInput = this.getRiddenInput(rider, travelVector); this.setSpeed(this.getRiddenSpeed(rider)); - Vec3 motion = new Vec3(0.0D, this.getDeltaMovement().y, 0.0D); - this.moveRelative(this.getSpeed(), new Vec3(riddenInput.x, 0.0D, riddenInput.z)); - motion = motion.add(this.getDeltaMovement().x, riddenInput.y, this.getDeltaMovement().z); - this.setDeltaMovement(motion); - this.move(MoverType.SELF, this.getDeltaMovement()); + + if (!this.isFlying()) { + Vec3 currentMotion = this.getDeltaMovement(); + Vec3 horizontalMotion = new Vec3(currentMotion.x, 0.0D, currentMotion.z).scale(MOUNTED_GROUND_BRAKE); + this.setDeltaMovement(horizontalMotion.x, currentMotion.y, horizontalMotion.z); + this.moveRelative(this.getSpeed(), new Vec3(riddenInput.x, 0.0D, riddenInput.z)); + this.move(MoverType.SELF, this.getDeltaMovement()); + + if (Math.abs(rider.zza) < 0.05F && Math.abs(rider.xxa) < 0.05F && this.onGround()) { + Vec3 dampedMotion = this.getDeltaMovement(); + this.setDeltaMovement(dampedMotion.x * 0.35D, dampedMotion.y, dampedMotion.z * 0.35D); + } + } else { + Vec3 motion = new Vec3(0.0D, this.getDeltaMovement().y, 0.0D); + this.moveRelative(this.getSpeed(), new Vec3(riddenInput.x, 0.0D, riddenInput.z)); + motion = motion.add(this.getDeltaMovement().x, riddenInput.y, this.getDeltaMovement().z); + this.setDeltaMovement(motion); + this.move(MoverType.SELF, this.getDeltaMovement()); + } if (!this.isFlying() && rider.zza > 0.0F && this.horizontalCollision) { Vec3 stepUpPos = this.position().add(0.0D, 1.0D, 0.0D); @@ -1211,7 +1307,38 @@ public class HerculesBeetleEntity extends TamableAnimal implements GeoEntity, Fl @Override protected void playStepSound(BlockPos pos, BlockState state) { - this.playSound(SoundEvents.RAVAGER_STEP, 0.8F, 0.8F); + this.playSound(SoundEvents.RAVAGER_STEP, 0.28F, 0.92F); + } + + private void tickMountedCharge() { + if (this.level().isClientSide) { + return; + } + if (!(this.getControllingPassenger() instanceof ServerPlayer player) || !this.canPlayerControl(player)) { + this.resetMountedChargeState(); + return; + } + if (!this.mountedChargeActive) { + if (this.getMountedCharge() != 0) { + this.entityData.set(MOUNTED_CHARGE, 0); + } + return; + } + if (this.chargeCooldown > 0 || this.isKnockedDown() || this.isInBusyAnimation() || this.chargeTicksRemaining > 0) { + this.resetMountedChargeState(); + return; + } + + this.mountedChargeTicks = Math.min(this.mountedChargeTicks + 1, MAX_PLAYER_CHARGE_TICKS); + this.entityData.set(MOUNTED_CHARGE, Mth.floor((this.mountedChargeTicks / (float) MAX_PLAYER_CHARGE_TICKS) * 100.0F)); + } + + private void resetMountedChargeState() { + this.mountedChargeActive = false; + this.mountedChargeTicks = 0; + if (this.getMountedCharge() != 0) { + this.entityData.set(MOUNTED_CHARGE, 0); + } } @Override diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java index e48ab971..aaa8746e 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/JerryEntity.java @@ -1,6 +1,7 @@ package com.craisinlord.antarchy.content.entity; import com.craisinlord.antarchy.config.AntarchySettings; +import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.horde.CavarynHordeManager; import net.minecraft.nbt.CompoundTag; import net.minecraft.core.registries.BuiltInRegistries; @@ -10,6 +11,7 @@ import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvent; import net.minecraft.util.ByIdMap; import net.minecraft.util.Mth; import net.minecraft.util.StringRepresentable; @@ -220,6 +222,7 @@ public class JerryEntity extends Monster implements GeoEntity { if (++this.attachDamageTicks >= ATTACH_DAMAGE_INTERVAL) { this.attachDamageTicks = 0; Vec3 targetMotion = target.getDeltaMovement(); + this.playSound(this.attackSoundForCurrentStage(), 0.85F, this.voicePitch()); target.hurt(this.damageSources().mobAttack(this), (float) stage.attackDamage()); target.setDeltaMovement(targetMotion); target.hurtMarked = true; @@ -262,6 +265,7 @@ public class JerryEntity extends Monster implements GeoEntity { this.faceTarget(target); this.attackCooldownTicks = 24; this.entityData.set(ATTACK_ANIM_TICKS, ATTACK_ANIM_DURATION); + this.playSound(this.attackSoundForCurrentStage(), 1.0F, this.voicePitch()); target.hurt(this.damageSources().mobAttack(this), (float) stage.attackDamage()); } } @@ -294,11 +298,33 @@ public class JerryEntity extends Monster implements GeoEntity { if (target instanceof LivingEntity living) { this.faceTarget(living); } + this.playSound(this.attackSoundForCurrentStage(), 1.0F, this.voicePitch()); return target instanceof LivingEntity living ? living.hurt(this.damageSources().mobAttack(this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE)) : super.doHurtTarget(target); } + @Override + @Nullable + protected SoundEvent getAmbientSound() { + return this.isAdultStage() ? AntarchySoundEvents.JERRY_ADULT_IDLE.get() : AntarchySoundEvents.JERRY_YOUNG_IDLE.get(); + } + + @Override + protected SoundEvent getHurtSound(DamageSource damageSource) { + return this.isAdultStage() ? AntarchySoundEvents.JERRY_ADULT_HURT.get() : AntarchySoundEvents.JERRY_YOUNG_HURT.get(); + } + + @Override + protected SoundEvent getDeathSound() { + return this.isAdultStage() ? AntarchySoundEvents.JERRY_ADULT_DEATH.get() : AntarchySoundEvents.JERRY_YOUNG_DEATH.get(); + } + + @Override + protected float getSoundVolume() { + return this.isAdultStage() ? 1.0F : 0.8F; + } + @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); @@ -436,6 +462,14 @@ public class JerryEntity extends Monster implements GeoEntity { return stage == Stage.ALPHA || stage == Stage.GAMMA; } + private SoundEvent attackSoundForCurrentStage() { + return this.isAdultStage() ? AntarchySoundEvents.JERRY_ADULT_ATTACK.get() : AntarchySoundEvents.JERRY_YOUNG_ATTACK.get(); + } + + private float voicePitch() { + return this.isAdultStage() ? 0.9F + this.random.nextFloat() * 0.2F : 1.1F + this.random.nextFloat() * 0.25F; + } + private Stage nextGrowthStage() { return switch (this.getStage()) { case INFANT -> Stage.MATURE; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/OctopusBombEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/OctopusBombEntity.java index aa825413..231be56e 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/OctopusBombEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/OctopusBombEntity.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.entity; import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.damage.AntarchyDamageSources; +import net.minecraft.core.particles.DustParticleOptions; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.EntityDataAccessor; @@ -32,6 +33,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; +import org.joml.Vector3f; import org.jetbrains.annotations.Nullable; import software.bernie.geckolib.animatable.GeoEntity; import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache; @@ -44,6 +46,9 @@ import java.util.List; import java.util.Objects; public class OctopusBombEntity extends Monster implements GeoEntity { + private static final DustParticleOptions OCTOPUS_BOMB_INK_PARTICLE = + new DustParticleOptions(new Vector3f(0.02F, 0.02F, 0.02F), 1.2F); + private static final EntityDataAccessor ATTACK_STATE = SynchedEntityData.defineId(OctopusBombEntity.class, EntityDataSerializers.INT); private static final EntityDataAccessor ANIMATION_STATE = SynchedEntityData.defineId(OctopusBombEntity.class, EntityDataSerializers.INT); private static final EntityDataAccessor CAN_FLY = SynchedEntityData.defineId(OctopusBombEntity.class, EntityDataSerializers.BOOLEAN); @@ -405,8 +410,8 @@ public class OctopusBombEntity extends Monster implements GeoEntity { serverLevel.playSound(null, this.getX(), this.getY(), this.getZ(), net.minecraft.sounds.SoundEvents.GENERIC_EXPLODE, net.minecraft.sounds.SoundSource.HOSTILE, 2.0F, 0.9F); - serverLevel.sendParticles(ParticleTypes.SQUID_INK, this.getX(), this.getY(), this.getZ(), 250, radius * 0.5D, radius * 0.5D, radius * 0.5D, 0.1D); - serverLevel.sendParticles(ParticleTypes.SQUID_INK, this.getX(), this.getY(), this.getZ(), 150, radius * 0.2D, radius * 0.2D, radius * 0.2D, 0.2D); + serverLevel.sendParticles(OCTOPUS_BOMB_INK_PARTICLE, this.getX(), this.getY(), this.getZ(), 125, radius * 0.5D, radius * 0.5D, radius * 0.5D, 0.1D); + serverLevel.sendParticles(OCTOPUS_BOMB_INK_PARTICLE, this.getX(), this.getY(), this.getZ(), 75, radius * 0.2D, radius * 0.2D, radius * 0.2D, 0.2D); serverLevel.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(), this.getZ(), 4, 0.5D, 0.5D, 0.5D, 0.0D); this.discard(); } @@ -423,8 +428,8 @@ public class OctopusBombEntity extends Monster implements GeoEntity { double cx = this.getX(); double cy = this.getY() + this.getBbHeight() * 0.5D; double cz = this.getZ(); - serverLevel.sendParticles(ParticleTypes.SQUID_INK, cx, cy, cz, 120, 2.0D, 1.2D, 2.0D, 0.04D); - serverLevel.sendParticles(ParticleTypes.SQUID_INK, cx, cy, cz, 60, 3.5D, 1.8D, 3.5D, 0.02D); + serverLevel.sendParticles(OCTOPUS_BOMB_INK_PARTICLE, cx, cy, cz, 60, 2.0D, 1.2D, 2.0D, 0.04D); + serverLevel.sendParticles(OCTOPUS_BOMB_INK_PARTICLE, cx, cy, cz, 30, 3.5D, 1.8D, 3.5D, 0.02D); } // ------------------------------------------------------------------------- diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/ReverieEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/ReverieEntity.java index e921e142..23fefb81 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/ReverieEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/ReverieEntity.java @@ -2,11 +2,11 @@ package com.craisinlord.antarchy.content.entity; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.config.AntarchySettings; -import com.craisinlord.antarchy.content.AntarchyAdvancements; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchySoundEvents; import com.craisinlord.antarchy.content.AntarchyTags; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; @@ -37,7 +37,6 @@ import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -1022,7 +1021,7 @@ public class ReverieEntity extends PathfinderMob implements FlyingAnimal, GeoEnt for (int y = min.getY(); y <= max.getY(); y++) { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); - if (PotentNyxiteBlock.isAntiwater(this.level().getFluidState(cursor))) { + if (AntarchyFluidChecks.isAntiwater(this.level().getFluidState(cursor))) { return true; } } @@ -1239,4 +1238,3 @@ public class ReverieEntity extends PathfinderMob implements FlyingAnimal, GeoEnt } } } - diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/SizeRayProjectileEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/SizeRayProjectileEntity.java index a54f17a5..93fa25ca 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/SizeRayProjectileEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/SizeRayProjectileEntity.java @@ -2,10 +2,9 @@ package com.craisinlord.antarchy.content.entity; import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.config.AntarchySettings; -import com.craisinlord.antarchy.content.AntarchyAdvancements; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; import com.craisinlord.antarchy.content.AntarchyTags; import net.minecraft.nbt.CompoundTag; -import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugProjectileEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugProjectileEntity.java index 2970bf44..c9fb0798 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugProjectileEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/SpitBugProjectileEntity.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.content.entity; -import com.craisinlord.antarchy.content.GoopedEffectHooks; +import com.craisinlord.antarchy.content.effect.GoopedEffectHooks; import com.craisinlord.antarchy.content.damage.AntarchyDamageSources; import net.minecraft.core.Holder; import net.minecraft.core.particles.ParticleTypes; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/StinkBugEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/StinkBugEntity.java index 7663e78a..46cac86d 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/StinkBugEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/StinkBugEntity.java @@ -2,7 +2,7 @@ package com.craisinlord.antarchy.content.entity; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchySoundEvents; -import com.craisinlord.antarchy.content.StinkyBehavior; +import com.craisinlord.antarchy.content.effect.StinkyBehavior; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/ToreterrorEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/ToreterrorEntity.java index 6bb5a5d0..815b1d84 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/ToreterrorEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/ToreterrorEntity.java @@ -93,7 +93,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { private static final double JUMP_RANGE_SQR = 400.0D; private static final double RANGED_MAX_RANGE_SQR = 625.0D; private static final double SPIN_TRIGGER_RANGE_SQR = 225.0D; - private static final double SPIN_LEASH_RANGE_SQR = 225.0D; + private static final double SPIN_LEASH_RANGE_SQR = 400.0D; private static final double SPIN_RADIUS = 2.5D; private static final double SPIN_MOVE_SPEED = 0.65D; private static final double SPIN_ANIMATION_SPEED = 0.49D; @@ -110,7 +110,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { private static final RawAnimation DEATH_ANIM = RawAnimation.begin().thenPlayAndHold("death"); private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); - private final ServerBossEvent bossEvent = new ServerBossEvent(Component.translatable("entity.antarchy.toreterror"), BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS); + private final ServerBossEvent bossEvent = new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), Component.translatable("entity.antarchy.toreterror"), BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS); private int shootAnimTicks; private int jumpAnimTicks; @@ -509,7 +509,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { } this.updateSpinDirection(target); - if (!this.moveDuringSpin()) { + if (!this.moveDuringSpin(target)) { this.spinStuckTicks++; if (this.spinStuckTicks >= SPIN_STUCK_FAIL_LIMIT) { this.beginSpinEnd(); @@ -566,7 +566,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { this.spinDirection = combined.lengthSqr() > 1.0E-4D ? combined.normalize() : towardTarget; } - private boolean moveDuringSpin() { + private boolean moveDuringSpin(LivingEntity target) { Vec3 direction = this.spinDirection.lengthSqr() > 1.0E-4D ? this.spinDirection.normalize() : Vec3.ZERO; if (direction == Vec3.ZERO) { return false; @@ -577,19 +577,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { } this.playSpinRicochetSound(); - this.spinStrafeSign *= -1; - Vec3 bounced = rotateHorizontal(direction, this.spinStrafeSign * 35.0D); - if (this.trySpinMoves(bounced, true)) { - return true; - } - - Vec3 reversed = direction.scale(-1.0D); - if (this.trySpinMoves(reversed, true)) { - return true; - } - - Vec3 reversedBounce = rotateHorizontal(reversed, this.spinStrafeSign * 25.0D); - return this.trySpinMoves(reversedBounce, true); + return this.trySpinRicochetTowardTarget(target, direction); } private void playSpinRicochetSound() { @@ -600,6 +588,33 @@ public class ToreterrorEntity extends Monster implements GeoEntity { this.playSound(AntarchySoundEvents.TORETERROR_RICOCHET.get(), 1.0F, 0.95F + this.random.nextFloat() * 0.1F); } + private boolean trySpinRicochetTowardTarget(LivingEntity target, Vec3 fallbackDirection) { + this.spinStrafeSign *= -1; + Vec3 towardTarget = horizontalDirectionTo(target.position()); + if (towardTarget.lengthSqr() <= 1.0E-4D) { + towardTarget = fallbackDirection; + } + + if (this.trySpinMoves(towardTarget, true)) { + this.spinDirection = towardTarget.normalize(); + return true; + } + + Vec3 slightRight = rotateHorizontal(towardTarget, 18.0D); + if (this.trySpinMoves(slightRight, true)) { + this.spinDirection = towardTarget.normalize(); + return true; + } + + Vec3 slightLeft = rotateHorizontal(towardTarget, -18.0D); + if (this.trySpinMoves(slightLeft, true)) { + this.spinDirection = towardTarget.normalize(); + return true; + } + + return false; + } + private boolean trySpinMoves(Vec3 baseDirection, boolean bounced) { Vec3[] attempts = new Vec3[]{ baseDirection, @@ -707,6 +722,20 @@ public class ToreterrorEntity extends Monster implements GeoEntity { this.spinProgressTicks = 0; } + private void startSpinSequence(LivingEntity target) { + this.spinStartTicks = SPIN_START_TOTAL_TICKS; + this.spinLoopTotalTicks = SPIN_LOOP_MIN_TICKS + this.random.nextInt(SPIN_LOOP_MAX_TICKS - SPIN_LOOP_MIN_TICKS + 1); + this.spinLoopTicks = this.spinLoopTotalTicks; + this.spinEndTicks = 0; + this.spinStuckTicks = 0; + this.spinProgressAnchor = this.position(); + this.spinProgressTicks = 0; + this.spinStrafeSign = this.random.nextBoolean() ? 1 : -1; + this.spinHitCooldowns.clear(); + this.spinDirection = target == null ? Vec3.ZERO : this.horizontalDirectionTo(target.position()); + this.playSound(AntarchySoundEvents.TORETERROR_SPIN.get(), 0.66F, 0.95F + this.random.nextFloat() * 0.1F); + } + private Vec3 calcLaunchVelocity(Vec3 from, Vec3 to, double minSpeed) { Vec3 diff = to.subtract(from); double dh = Math.sqrt(diff.x * diff.x + diff.z * diff.z); @@ -914,20 +943,7 @@ public class ToreterrorEntity extends Monster implements GeoEntity { @Override public void start() { - LivingEntity target = ToreterrorEntity.this.getTarget(); - ToreterrorEntity.this.spinStartTicks = SPIN_START_TOTAL_TICKS; - ToreterrorEntity.this.spinLoopTotalTicks = SPIN_LOOP_MIN_TICKS + ToreterrorEntity.this.random.nextInt(SPIN_LOOP_MAX_TICKS - SPIN_LOOP_MIN_TICKS + 1); - ToreterrorEntity.this.spinLoopTicks = ToreterrorEntity.this.spinLoopTotalTicks; - ToreterrorEntity.this.spinEndTicks = 0; - ToreterrorEntity.this.spinStuckTicks = 0; - ToreterrorEntity.this.spinProgressAnchor = ToreterrorEntity.this.position(); - ToreterrorEntity.this.spinProgressTicks = 0; - ToreterrorEntity.this.spinStrafeSign = ToreterrorEntity.this.random.nextBoolean() ? 1 : -1; - ToreterrorEntity.this.spinHitCooldowns.clear(); - ToreterrorEntity.this.spinDirection = target == null - ? Vec3.ZERO - : ToreterrorEntity.this.horizontalDirectionTo(target.position()); - ToreterrorEntity.this.playSound(AntarchySoundEvents.TORETERROR_SPIN.get(), 1.1F, 0.95F + ToreterrorEntity.this.random.nextFloat() * 0.1F); + ToreterrorEntity.this.startSpinSequence(ToreterrorEntity.this.getTarget()); } @Override diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/UpwardFallingBlockEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/UpwardFallingBlockEntity.java index 79e97e33..964b09f0 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/UpwardFallingBlockEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/UpwardFallingBlockEntity.java @@ -11,9 +11,11 @@ import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.tags.BlockTags; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.PointedDripstoneBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; @@ -77,6 +79,7 @@ public class UpwardFallingBlockEntity extends Entity { // Move upward directly — noPhysics=true means move() just calls setPos() setPos(getX(), getY() + RISE_SPEED, getZ()); + damageEntitiesAlongPath(blockState); BlockPos headPos = BlockPos.containing(getX(), getY() + getBbHeight(), getZ()); BlockState above = level().getBlockState(headPos); @@ -91,18 +94,40 @@ public class UpwardFallingBlockEntity extends Entity { boolean hitScaffolding = above.getBlock() instanceof AntimetalScaffoldingBlock; if (hitCeiling || hitScaffolding) { - BlockPos placePos = headPos.below(); - BlockState atPlace = level().getBlockState(placePos); - if (atPlace.isAir() || atPlace.canBeReplaced()) { - level().setBlock(placePos, blockState, 3); - } else { - dropAndRemove(blockState); - return; - } - discard(); + dropAndRemove(blockState); + return; } } + private void damageEntitiesAlongPath(BlockState state) { + float damage = getImpactDamage(state); + if (damage <= 0.0F) { + return; + } + + AABB hitBox = getBoundingBox().inflate(0.15D); + for (LivingEntity living : level().getEntitiesOfClass(LivingEntity.class, hitBox, LivingEntity::isAlive)) { + living.hurt(level().damageSources().fallingBlock(this), damage); + } + } + + private float getImpactDamage(BlockState state) { + float travelDistance = (float) this.time * (float) RISE_SPEED; + float baseDamage = Math.max(0.0F, travelDistance - 1.5F); + if (baseDamage <= 0.0F) { + return 0.0F; + } + + float thicknessMultiplier = switch (state.getValue(PointedDripstoneBlock.THICKNESS)) { + case TIP, TIP_MERGE -> 2.0F; + case FRUSTUM -> 1.5F; + case MIDDLE -> 1.25F; + case BASE -> 1.0F; + }; + + return Math.min(baseDamage * thicknessMultiplier, 40.0F); + } + private void dropAndRemove(BlockState state) { if (!level().isClientSide && !state.isAir()) { ItemStack drop = new ItemStack(state.getBlock().asItem()); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/ant/TermiteEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/ant/TermiteEntity.java index db9126ed..21ecc39a 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/ant/TermiteEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/ant/TermiteEntity.java @@ -6,12 +6,17 @@ import com.craisinlord.antarchy.config.AntarchySettings; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BlockTags; import net.minecraft.tags.TagKey; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.level.GameRules; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.RotatedPillarBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.pathfinder.Path; @@ -21,6 +26,7 @@ import software.bernie.geckolib.animatable.GeoEntity; public class TermiteEntity extends BaseAntEntity implements GeoEntity { private static final int WOOD_BITE_ANIMATION_TICKS = 8; + private static final int WOOD_BITE_COOLDOWN_TICKS = 20 * 3; private static final int WOOD_SEARCH_INTERVAL_TICKS = 20; private static final int WOOD_REPATH_INTERVAL_TICKS = 6; private static final int WOOD_SEARCH_RADIUS_HORIZONTAL = 12; @@ -38,6 +44,7 @@ public class TermiteEntity extends BaseAntEntity implements GeoEntity { }; @Nullable private BlockPos targetWoodPos; + private int nextWoodBiteTick; private int nextWoodSearchTick; private int nextWoodRepathTick; @@ -129,20 +136,31 @@ public class TermiteEntity extends BaseAntEntity implements GeoEntity { } private boolean tryEatNearbyWood() { + if (this.tickCount < this.nextWoodBiteTick) { + return false; + } + BlockPos basePos = this.blockPosition(); for (Vec3i offset : IMMEDIATE_WOOD_OFFSETS) { BlockPos targetPos = basePos.offset(offset); BlockState targetState = this.level().getBlockState(targetPos); - if (!targetState.is(AntarchyTags.Blocks.TERMITE_FOODS)) { + if (!this.isTermiteEdible(targetState)) { continue; } - SoundType soundType = targetState.getSoundType(); - this.triggerBiteAnimation(WOOD_BITE_ANIMATION_TICKS); - this.level().destroyBlock(targetPos, false, this); - this.level().playSound(null, targetPos, soundType.getBreakSound(), this.getSoundSource(), 0.7F, 1.1F); - this.playSound(AntarchySoundEvents.ANT_BITE.get(), 0.35F, 0.95F + this.random.nextFloat() * 0.1F); - return true; + if (this.tryStripWood(targetPos, targetState)) { + return true; + } + + if (targetState.is(AntarchyTags.Blocks.TERMITE_FOODS) || this.isStrippedWoodState(targetState)) { + SoundType soundType = targetState.getSoundType(); + this.triggerBiteAnimation(WOOD_BITE_ANIMATION_TICKS); + this.nextWoodBiteTick = this.tickCount + WOOD_BITE_COOLDOWN_TICKS; + this.level().destroyBlock(targetPos, false, this); + this.level().playSound(null, targetPos, soundType.getBreakSound(), this.getSoundSource(), 0.7F, 1.1F); + this.playSound(AntarchySoundEvents.ANT_BITE.get(), 0.35F, 0.95F + this.random.nextFloat() * 0.1F); + return true; + } } return false; @@ -219,7 +237,65 @@ public class TermiteEntity extends BaseAntEntity implements GeoEntity { } private boolean isValidWoodTarget(BlockPos targetPos) { - return this.level().getBlockState(targetPos).is(AntarchyTags.Blocks.TERMITE_FOODS); + return this.isTermiteEdible(this.level().getBlockState(targetPos)); + } + + private boolean isTermiteEdible(BlockState state) { + return state.is(AntarchyTags.Blocks.TERMITE_FOODS) || this.isStrippedWoodState(state); + } + + private boolean tryStripWood(BlockPos targetPos, BlockState targetState) { + BlockState strippedState = this.getStrippedState(targetState); + if (strippedState == null) { + return false; + } + + SoundType soundType = targetState.getSoundType(); + this.triggerBiteAnimation(WOOD_BITE_ANIMATION_TICKS); + this.nextWoodBiteTick = this.tickCount + WOOD_BITE_COOLDOWN_TICKS; + this.level().setBlock(targetPos, strippedState, Block.UPDATE_ALL_IMMEDIATE); + this.level().playSound(null, targetPos, soundType.getBreakSound(), this.getSoundSource(), 0.6F, 1.2F); + this.playSound(AntarchySoundEvents.ANT_BITE.get(), 0.35F, 0.95F + this.random.nextFloat() * 0.1F); + return true; + } + + @Nullable + private BlockState getStrippedState(BlockState state) { + ResourceLocation blockId = BuiltInRegistries.BLOCK.getKey(state.getBlock()); + if (blockId == null || this.isStrippedWoodState(state) || !this.isStripTargetState(state, blockId.getPath())) { + return null; + } + + String path = blockId.getPath(); + if (path.startsWith("mossy_")) { + path = path.substring("mossy_".length()); + } + + ResourceLocation strippedId = ResourceLocation.fromNamespaceAndPath(blockId.getNamespace(), "stripped_" + path); + Block strippedBlock = BuiltInRegistries.BLOCK.getOptional(strippedId).orElse(null); + if (strippedBlock == null) { + return null; + } + + BlockState strippedState = strippedBlock.defaultBlockState(); + if (state.hasProperty(RotatedPillarBlock.AXIS) && strippedState.hasProperty(RotatedPillarBlock.AXIS)) { + strippedState = strippedState.setValue(RotatedPillarBlock.AXIS, state.getValue(RotatedPillarBlock.AXIS)); + } + return strippedState; + } + + private boolean isStripTargetState(BlockState state, String path) { + return state.is(BlockTags.LOGS) || path.endsWith("_wood"); + } + + private boolean isStrippedWoodState(BlockState state) { + ResourceLocation blockId = BuiltInRegistries.BLOCK.getKey(state.getBlock()); + if (blockId == null) { + return false; + } + + String path = blockId.getPath(); + return path.startsWith("stripped_") && (path.endsWith("_log") || path.endsWith("_wood") || path.endsWith("_stem") || path.endsWith("_hyphae")); } private boolean canReachWoodTarget(BlockPos targetPos) { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/brutalfly/BrutalflyEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/brutalfly/BrutalflyEntity.java index d233c67b..b33fa169 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/brutalfly/BrutalflyEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/brutalfly/BrutalflyEntity.java @@ -91,7 +91,7 @@ public class BrutalflyEntity extends Monster implements GeoEntity { private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); private final ServerBossEvent bossEvent = - new ServerBossEvent(this.getDisplayName(), BossEvent.BossBarColor.YELLOW, BossEvent.BossBarOverlay.PROGRESS); + new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), this.getDisplayName(), BossEvent.BossBarColor.YELLOW, BossEvent.BossBarOverlay.PROGRESS); @Nullable private Vec3 patrolTarget; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerElkaBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerElkaBehavior.java index a840fd40..7396c580 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerElkaBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerElkaBehavior.java @@ -7,20 +7,21 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; +import net.minecraft.tags.BlockTags; +import net.minecraft.util.Mth; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.EntityDimensions; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.goal.FloatGoal; -import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal; -import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal; -import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal; import net.minecraft.world.entity.monster.Enemy; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.Projectile; +import net.minecraft.core.BlockPos; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; +import software.bernie.geckolib.animation.RawAnimation; public class GlimmerElkaBehavior implements GlimmerVariantBehavior { private static final int PASSIVE_REFRESH_DURATION = 20 * 4; @@ -30,6 +31,21 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { private static final double SHOCKWAVE_RADIUS = 6.0D; private static final double SHOCKWAVE_KNOCKBACK = 1.3D; private static final float SHOCKWAVE_DAMAGE = 8.0F; + private static final int IDLE_ANIMATION_CYCLE_TICKS = 60; + private static final int QUIRK_ANIMATION_TICKS = 40; + private static final int QUIRK_CHANCE = 60; + private static final int SIT_MIN_TICKS = 20 * 60; + private static final int SIT_MAX_TICKS = 20 * 60 * 3; + private static final int SIT_COOLDOWN_TICKS = 20 * 60 * 6; + private static final int SIT_CHECK_CHANCE_SHADE = 300; + private static final int SIT_CHECK_CHANCE_OPEN = 1200; + private static final double FOLLOW_BREAK_SIT_DISTANCE_SQR = 81.0D; + private static final RawAnimation ELKA_WALK_ANIM = RawAnimation.begin().thenLoop("walk"); + private static final RawAnimation ELKA_IDLE_ANIM = RawAnimation.begin().thenLoop("idle"); + private static final RawAnimation ELKA_SIT_IDLE_ANIM = RawAnimation.begin().thenLoop("sit_idle"); + private static final RawAnimation ELKA_QUIRK_ANIM = RawAnimation.begin().thenPlay("quirk"); + private static final RawAnimation ELKA_QUIRK_2_ANIM = RawAnimation.begin().thenPlay("quirk_2"); + private static final RawAnimation ELKA_QUIRK_3_ANIM = RawAnimation.begin().thenPlay("quirk_3"); private static ResourceLocation rl(String path) { return ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, path); @@ -38,9 +54,6 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { @Override public void registerGoals(GlimmerEntity entity) { entity.addGoal(0, new FloatGoal(entity)); - entity.addGoal(5, new WaterAvoidingRandomStrollGoal(entity, 1.0D)); - entity.addGoal(6, new LookAtPlayerGoal(entity, Player.class, 8.0F)); - entity.addGoal(7, new RandomLookAroundGoal(entity)); } @Override @@ -95,6 +108,8 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { @Override public void tickPassiveEveryTick(GlimmerEntity entity, Player owner) { + this.tickIdleState(entity); + if (!(owner instanceof BloodglassAccess access)) { return; } @@ -110,6 +125,7 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { @Override public void clearPassive(GlimmerEntity entity, Player owner) { entity.setLastOwnerShieldLostCount(-1L); + this.stopSitting(entity); } @Override @@ -117,6 +133,28 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { return ABILITY_COOLDOWN_TICKS; } + @Override + @Nullable + public RawAnimation movingAnimation(GlimmerEntity entity) { + return ELKA_WALK_ANIM; + } + + @Override + @Nullable + public RawAnimation idleAnimation(GlimmerEntity entity) { + if (entity.getElkaIdleQuirkTicks() > 0) { + return switch (entity.getElkaIdleQuirkVariant()) { + case 1 -> ELKA_QUIRK_2_ANIM; + case 2 -> ELKA_QUIRK_3_ANIM; + default -> ELKA_QUIRK_ANIM; + }; + } + if (entity.isElkaIdleSitting()) { + return ELKA_SIT_IDLE_ANIM; + } + return ELKA_IDLE_ANIM; + } + @Override @Nullable public software.bernie.geckolib.animation.RawAnimation abilityAnimation() { @@ -149,4 +187,120 @@ public class GlimmerElkaBehavior implements GlimmerVariantBehavior { this.sendAbilityMessage(owner, Component.translatable("entity.antarchy.glimmer.ability.elka")); entity.startAbilityCooldown(); } + + private void tickIdleState(GlimmerEntity entity) { + int quirkTicks = entity.getElkaIdleQuirkTicks(); + if (quirkTicks > 0) { + entity.setElkaIdleQuirkTicks(quirkTicks - 1); + } + + if (entity.isElkaIdleSitting()) { + if (!this.canRemainSitting(entity)) { + this.stopSitting(entity); + return; + } + + int sitTicks = entity.getElkaIdleSitTicksRemaining(); + if (sitTicks > 0) { + entity.setElkaIdleSitTicksRemaining(sitTicks - 1); + if (sitTicks - 1 <= 0) { + this.stopSitting(entity); + } + } + return; + } + + if (entity.getElkaIdleSitCooldownTicks() > 0) { + entity.setElkaIdleSitCooldownTicks(entity.getElkaIdleSitCooldownTicks() - 1); + } + + if (this.canStartSitting(entity)) { + int chance = this.isNearShade(entity) ? SIT_CHECK_CHANCE_SHADE : SIT_CHECK_CHANCE_OPEN; + if (entity.getElkaIdleSitCooldownTicks() <= 0 && entity.getRandom().nextInt(chance) == 0) { + this.startSitting(entity); + return; + } + } + + this.tickIdleQuirk(entity); + } + + private void tickIdleQuirk(GlimmerEntity entity) { + if (entity.getElkaIdleQuirkTicks() > 0 + || entity.getDeltaMovement().horizontalDistanceSqr() > 1.0E-4D + || entity.getNavigation().isInProgress() + || entity.getTarget() != null + || entity.isFollowingOwner() && entity.getOwner() != null && entity.distanceToSqr(entity.getOwner()) > 9.0D) { + entity.setElkaIdleAnimationCycleTicks(0); + return; + } + + entity.setElkaIdleAnimationCycleTicks(entity.getElkaIdleAnimationCycleTicks() + 1); + if (entity.getElkaIdleAnimationCycleTicks() < IDLE_ANIMATION_CYCLE_TICKS) { + return; + } + entity.setElkaIdleAnimationCycleTicks(0); + + if (entity.getRandom().nextInt(QUIRK_CHANCE) != 0) { + return; + } + + entity.setElkaIdleQuirkTicks(QUIRK_ANIMATION_TICKS); + if (entity.isElkaIdleSitting()) { + entity.setElkaIdleQuirkVariant(2); + } else { + entity.setElkaIdleQuirkVariant(entity.getRandom().nextBoolean() ? 0 : 1); + } + } + + private void startSitting(GlimmerEntity entity) { + entity.setElkaIdleSitting(true); + entity.setElkaIdleSitTicksRemaining(Mth.nextInt(entity.getRandom(), SIT_MIN_TICKS, SIT_MAX_TICKS)); + entity.getNavigation().stop(); + entity.setDeltaMovement(0.0D, entity.getDeltaMovement().y, 0.0D); + entity.setElkaIdleAnimationCycleTicks(0); + } + + private void stopSitting(GlimmerEntity entity) { + if (!entity.isElkaIdleSitting()) { + return; + } + entity.setElkaIdleSitting(false); + entity.setElkaIdleSitTicksRemaining(0); + entity.setElkaIdleSitCooldownTicks(SIT_COOLDOWN_TICKS); + entity.setElkaIdleAnimationCycleTicks(0); + } + + private boolean canStartSitting(GlimmerEntity entity) { + if (entity.isOrderedToSit() || !entity.onGround() || entity.isInWaterOrBubble() || entity.isOnFire()) { + return false; + } + if (entity.getTarget() != null || entity.getNavigation().isInProgress() || entity.getDeltaMovement().horizontalDistanceSqr() > 1.0E-4D) { + return false; + } + if (entity.isFollowingOwner() && entity.getOwner() != null && entity.distanceToSqr(entity.getOwner()) > 9.0D) { + return false; + } + return true; + } + + private boolean canRemainSitting(GlimmerEntity entity) { + if (entity.isOrderedToSit() || !entity.onGround() || entity.isInWaterOrBubble() || entity.isOnFire() || entity.getTarget() != null) { + return false; + } + if (entity.isFollowingOwner() && entity.getOwner() != null && entity.distanceToSqr(entity.getOwner()) > FOLLOW_BREAK_SIT_DISTANCE_SQR) { + return false; + } + return entity.hurtTime <= 0; + } + + private boolean isNearShade(GlimmerEntity entity) { + BlockPos base = entity.blockPosition(); + for (BlockPos pos : BlockPos.betweenClosed(base.offset(-3, -1, -3), base.offset(3, 3, 3))) { + if (entity.level().getBlockState(pos).is(BlockTags.LEAVES)) { + return true; + } + } + return false; + } } diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java index 1d4a423a..c772ec0b 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerEntity.java @@ -2,6 +2,7 @@ package com.craisinlord.antarchy.content.entity.glimmer; import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; import com.craisinlord.antarchy.content.client.particle.GlimmerParticles; import com.craisinlord.antarchy.Antarchy; import net.minecraft.network.chat.Component; @@ -93,6 +94,12 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { SynchedEntityData.defineId(GlimmerEntity.class, EntityDataSerializers.FLOAT); private static final EntityDataAccessor ABILITY_ANIM_TICKS = SynchedEntityData.defineId(GlimmerEntity.class, EntityDataSerializers.INT); + private static final EntityDataAccessor ELKA_IDLE_SITTING = + SynchedEntityData.defineId(GlimmerEntity.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor ELKA_IDLE_QUIRK_TICKS = + SynchedEntityData.defineId(GlimmerEntity.class, EntityDataSerializers.INT); + private static final EntityDataAccessor ELKA_IDLE_QUIRK_VARIANT = + SynchedEntityData.defineId(GlimmerEntity.class, EntityDataSerializers.INT); public static final int FADE_DURATION_TICKS = 40; private static final int PASSIVE_RANGE = 16; @@ -103,11 +110,19 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { private static final String VARIANT_LOCKED_KEY = "VariantLocked"; private static final String FOLLOWING_KEY = "GlimmerFollowing"; private static final String ABILITY_COOLDOWN_KEY = "AbilityCooldown"; + private static final String ELKA_IDLE_SITTING_KEY = "ElkaIdleSitting"; + private static final String ELKA_IDLE_SIT_TICKS_KEY = "ElkaIdleSitTicks"; + private static final String ELKA_IDLE_SIT_COOLDOWN_KEY = "ElkaIdleSitCooldown"; + private static final String ELKA_IDLE_QUIRK_TICKS_KEY = "ElkaIdleQuirkTicks"; + private static final String ELKA_IDLE_QUIRK_VARIANT_KEY = "ElkaIdleQuirkVariant"; private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); private boolean variantLocked; private float lastOwnerExhaustion = -1.0F; private long lastOwnerShieldLostCount = -1L; + private int elkaIdleSitTicksRemaining; + private int elkaIdleSitCooldownTicks = 20 * 60 * 6; + private int elkaIdleAnimationCycleTicks; public GlimmerEntity(EntityType entityType, Level level) { super(entityType, level); @@ -152,6 +167,9 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { builder.define(ABILITY_COOLDOWN, 0); builder.define(GROWTH_SCALE, 1.0F); builder.define(ABILITY_ANIM_TICKS, 0); + builder.define(ELKA_IDLE_SITTING, false); + builder.define(ELKA_IDLE_QUIRK_TICKS, 0); + builder.define(ELKA_IDLE_QUIRK_VARIANT, 0); } public void playAbilityAnimation(int ticks) { @@ -224,6 +242,54 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { this.refreshDimensions(); } + public boolean isElkaIdleSitting() { + return this.entityData.get(ELKA_IDLE_SITTING); + } + + public void setElkaIdleSitting(boolean sitting) { + this.entityData.set(ELKA_IDLE_SITTING, sitting); + } + + public int getElkaIdleQuirkTicks() { + return this.entityData.get(ELKA_IDLE_QUIRK_TICKS); + } + + public void setElkaIdleQuirkTicks(int ticks) { + this.entityData.set(ELKA_IDLE_QUIRK_TICKS, Math.max(0, ticks)); + } + + public int getElkaIdleQuirkVariant() { + return this.entityData.get(ELKA_IDLE_QUIRK_VARIANT); + } + + public void setElkaIdleQuirkVariant(int variant) { + this.entityData.set(ELKA_IDLE_QUIRK_VARIANT, Math.max(0, variant)); + } + + public int getElkaIdleSitTicksRemaining() { + return this.elkaIdleSitTicksRemaining; + } + + public void setElkaIdleSitTicksRemaining(int ticks) { + this.elkaIdleSitTicksRemaining = Math.max(0, ticks); + } + + public int getElkaIdleSitCooldownTicks() { + return this.elkaIdleSitCooldownTicks; + } + + public void setElkaIdleSitCooldownTicks(int ticks) { + this.elkaIdleSitCooldownTicks = Math.max(0, ticks); + } + + public int getElkaIdleAnimationCycleTicks() { + return this.elkaIdleAnimationCycleTicks; + } + + public void setElkaIdleAnimationCycleTicks(int ticks) { + this.elkaIdleAnimationCycleTicks = Math.max(0, ticks); + } + private void cycleMovementState(Player player) { if (this.isOrderedToSit()) { this.setOrderedToSit(false); @@ -366,7 +432,7 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { } if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) { - com.craisinlord.antarchy.content.AntarchyAdvancements.award(serverPlayer, this.getVariant().tameAdvancementId()); + AntarchyAdvancements.award(serverPlayer, this.getVariant().tameAdvancementId()); } return InteractionResult.SUCCESS; @@ -566,6 +632,11 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { tag.putBoolean(VARIANT_LOCKED_KEY, this.variantLocked); tag.putBoolean(FOLLOWING_KEY, this.isFollowingOwner()); tag.putInt(ABILITY_COOLDOWN_KEY, this.entityData.get(ABILITY_COOLDOWN)); + tag.putBoolean(ELKA_IDLE_SITTING_KEY, this.isElkaIdleSitting()); + tag.putInt(ELKA_IDLE_SIT_TICKS_KEY, this.elkaIdleSitTicksRemaining); + tag.putInt(ELKA_IDLE_SIT_COOLDOWN_KEY, this.elkaIdleSitCooldownTicks); + tag.putInt(ELKA_IDLE_QUIRK_TICKS_KEY, this.getElkaIdleQuirkTicks()); + tag.putInt(ELKA_IDLE_QUIRK_VARIANT_KEY, this.getElkaIdleQuirkVariant()); } @Override @@ -578,6 +649,11 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { this.variantLocked = tag.getBoolean(VARIANT_LOCKED_KEY); this.entityData.set(FOLLOWING, !tag.contains(FOLLOWING_KEY) || tag.getBoolean(FOLLOWING_KEY)); this.entityData.set(ABILITY_COOLDOWN, tag.getInt(ABILITY_COOLDOWN_KEY)); + this.entityData.set(ELKA_IDLE_SITTING, tag.getBoolean(ELKA_IDLE_SITTING_KEY)); + this.elkaIdleSitTicksRemaining = tag.getInt(ELKA_IDLE_SIT_TICKS_KEY); + this.elkaIdleSitCooldownTicks = tag.contains(ELKA_IDLE_SIT_COOLDOWN_KEY) ? tag.getInt(ELKA_IDLE_SIT_COOLDOWN_KEY) : 20 * 60 * 6; + this.entityData.set(ELKA_IDLE_QUIRK_TICKS, tag.getInt(ELKA_IDLE_QUIRK_TICKS_KEY)); + this.entityData.set(ELKA_IDLE_QUIRK_VARIANT, tag.getInt(ELKA_IDLE_QUIRK_VARIANT_KEY)); } @Override @@ -611,7 +687,8 @@ public class GlimmerEntity extends TamableAnimal implements GeoEntity { RawAnimation movingAnim = this.getVariant().getBehavior().movingAnimation(this); return state.setAndContinue(movingAnim != null ? movingAnim : WALK_ANIM); } - return state.setAndContinue(IDLE_ANIM); + RawAnimation idleAnim = this.getVariant().getBehavior().idleAnimation(this); + return state.setAndContinue(idleAnim != null ? idleAnim : IDLE_ANIM); } @Override diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerVariantBehavior.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerVariantBehavior.java index 58d673f0..771ec901 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerVariantBehavior.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/glimmer/GlimmerVariantBehavior.java @@ -95,6 +95,15 @@ public interface GlimmerVariantBehavior { return null; } + /** + * Animation to play while idle in place of the default idle loop. Null uses the + * shared Glimmer idle animation. + */ + @Nullable + default software.bernie.geckolib.animation.RawAnimation idleAnimation(GlimmerEntity entity) { + return null; + } + /** * Navigation speed multiplier used while following the owner (see {@link GlimmerFollowOwnerGoal}). */ diff --git a/common/src/main/java/com/craisinlord/antarchy/content/entity/kraken/KrakenEntity.java b/common/src/main/java/com/craisinlord/antarchy/content/entity/kraken/KrakenEntity.java index 327fa364..bbac9700 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/entity/kraken/KrakenEntity.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/entity/kraken/KrakenEntity.java @@ -112,7 +112,7 @@ public class KrakenEntity extends Monster implements GeoEntity, MultipartEntityO private static final Vec3 GRAB_ANCHOR_LOCAL = new Vec3(22.0D / 16.0D, 223.5D / 16.0D, -12.5D / 16.0D); - private final ServerBossEvent bossEvent = new ServerBossEvent(Component.literal("The Kraken"), BossEvent.BossBarColor.BLUE, BossEvent.BossBarOverlay.PROGRESS); + private final ServerBossEvent bossEvent = new com.craisinlord.antarchy.content.boss.EntityLinkedServerBossEvent(this.getUUID(), Component.translatable("entity.antarchy.kraken"), BossEvent.BossBarColor.BLUE, BossEvent.BossBarOverlay.PROGRESS); private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this); @Nullable diff --git a/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java b/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java new file mode 100644 index 00000000..33b2e5c9 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/fluid/AntarchyFluidChecks.java @@ -0,0 +1,44 @@ +package com.craisinlord.antarchy.content.fluid; + +import com.craisinlord.antarchy.Antarchy; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.material.FluidState; + +public final class AntarchyFluidChecks { + private static final ResourceLocation ANTIWATER_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "antiwater"); + private static final ResourceLocation FLOWING_ANTIWATER_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_antiwater"); + private static final ResourceLocation ICHOR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "ichor"); + private static final ResourceLocation FLOWING_ICHOR_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_ichor"); + private static final ResourceLocation LUMEN_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "lumen"); + private static final ResourceLocation FLOWING_LUMEN_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_lumen"); + private static final ResourceLocation BILE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "bile"); + private static final ResourceLocation FLOWING_BILE_ID = ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "flowing_bile"); + + private AntarchyFluidChecks() { + } + + public static boolean isAntiwater(FluidState fluidState) { + ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); + return ANTIWATER_ID.equals(fluidId) || FLOWING_ANTIWATER_ID.equals(fluidId); + } + + public static boolean isIchor(FluidState fluidState) { + ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); + return ICHOR_ID.equals(fluidId) || FLOWING_ICHOR_ID.equals(fluidId); + } + + public static boolean isLumen(FluidState fluidState) { + ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); + return LUMEN_ID.equals(fluidId) || FLOWING_LUMEN_ID.equals(fluidId); + } + + public static boolean isBile(FluidState fluidState) { + ResourceLocation fluidId = BuiltInRegistries.FLUID.getKey(fluidState.getType()); + return BILE_ID.equals(fluidId) || FLOWING_BILE_ID.equals(fluidId); + } + + public static boolean usesWaterLikePhysics(FluidState fluidState) { + return isIchor(fluidState) || isLumen(fluidState) || isBile(fluidState); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java index 60c54757..febaef1e 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/horde/CavarynHordeManager.java @@ -67,7 +67,7 @@ public final class CavarynHordeManager { private static final int HOSTILE_KILL_ATTENTION = 4; private static final int MOB_KILL_ATTENTION = 3; private static final int EGG_OR_NEST_BREAK_ATTENTION = 5; - private static final int BLOCK_BREAK_ATTENTION = 1; + private static final int BLOCK_BREAK_ATTENTION = 0; private static final int STALE_ATTENTION_PRUNE_TICKS = 20 * 60 * 20; private static final int PLAYER_CHECK_INTERVAL = 20; private static final int AREA_ATTENTION_INTERVAL = 20 * 45; @@ -85,6 +85,7 @@ public final class CavarynHordeManager { private static final int MAX_SPAWN_ATTEMPTS_PER_MOB = 18; private static final double MIN_SPAWN_DISTANCE = 18.0D; private static final double MAX_SPAWN_DISTANCE = 36.0D; + private static final int EGG_HATCH_ACCELERATION_MIN_ATTENTION = ATTENTION_THRESHOLD / 2; private CavarynHordeManager() { } @@ -145,6 +146,34 @@ public final class CavarynHordeManager { return attention != null ? attention.attention : 0; } + public static boolean shouldAccelerateNearbyEggHatching(ServerLevel level, BlockPos pos, double playerRadius, RandomSource random) { + if (!level.dimension().equals(CAVARYN) || !isHordeBiome(level, pos)) { + return false; + } + + double radiusSqr = playerRadius * playerRadius; + HordeData data = get(level); + int highestAttention = 0; + for (ServerPlayer player : level.players()) { + if (!isValidHordeTarget(player) || player.blockPosition().distSqr(pos) > radiusSqr) { + continue; + } + PlayerAttention attention = data.players.get(player.getUUID()); + if (attention == null) { + continue; + } + highestAttention = Math.max(highestAttention, attention.attention); + } + + if (highestAttention < EGG_HATCH_ACCELERATION_MIN_ATTENTION) { + return false; + } + + float pressure = highestAttention / (float) ATTENTION_THRESHOLD; + float chance = Mth.lerp(pressure, 0.02F, 0.3F); + return random.nextFloat() < chance; + } + public static int setHordeLevel(ServerPlayer player, int levelValue) { if (!(player.level() instanceof ServerLevel level) || !level.dimension().equals(CAVARYN)) { return -1; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/BigBerthaItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/BigBerthaItem.java index 7a4cd0c2..be8e1bb0 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/item/BigBerthaItem.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/BigBerthaItem.java @@ -160,6 +160,7 @@ public class BigBerthaItem extends SwordItem implements GeoItem { case LUCID -> applyLucidHit(target, player, serverLevel); case NIGHTMARE -> applyNightmareHit(target, serverLevel); case KRAKEN -> applyKrakenHit(player, target, serverLevel); + case HERCULES -> applyHerculesHit(player, target, serverLevel); case MOLEVORE, TORETERROR -> { } } @@ -324,6 +325,31 @@ public class BigBerthaItem extends SwordItem implements GeoItem { com.craisinlord.antarchy.content.entity.kraken.TentacleEntity.spawnAt(level, target.position(), attacker); } + private void applyHerculesHit(Player attacker, LivingEntity target, ServerLevel level) { + float bonusDamage = (float) (attacker.getAttributeValue(Attributes.ATTACK_DAMAGE) * 0.5D); + Vec3 push = target.position().subtract(attacker.position()).multiply(1.0D, 0.0D, 1.0D); + if (push.lengthSqr() < 1.0E-4D) { + push = attacker.getLookAngle().multiply(1.0D, 0.0D, 1.0D); + } + + if (bonusDamage > 0.0F) { + target.invulnerableTime = 0; + target.hurt(attacker.damageSources().playerAttack(attacker), bonusDamage); + } + + if (push.lengthSqr() >= 1.0E-4D) { + Vec3 normalized = push.normalize(); + Vec3 motion = target.getDeltaMovement(); + target.setDeltaMovement(motion.x + normalized.x * 0.55D, Math.max(motion.y, 1.35D), motion.z + normalized.z * 0.55D); + } else { + Vec3 motion = target.getDeltaMovement(); + target.setDeltaMovement(motion.x, Math.max(motion.y, 1.35D), motion.z); + } + target.hurtMarked = true; + level.sendParticles(ParticleTypes.CRIT, target.getX(), target.getY(0.7D), target.getZ(), 12, 0.3D, 0.35D, 0.3D, 0.04D); + level.playSound(null, target.blockPosition(), SoundEvents.IRON_GOLEM_ATTACK, SoundSource.PLAYERS, 1.0F, 0.8F); + } + private void cycleMode(Level level, Player player, ItemStack stack) { BossMode nextMode = getMode(stack).next(); setMode(stack, nextMode); @@ -595,7 +621,8 @@ public class BigBerthaItem extends SwordItem implements GeoItem { KRAKEN(2, "tooltip.antarchy.big_bertha.mode.kraken", "message.antarchy.big_bertha.mode.kraken"), MOLEVORE(3, "tooltip.antarchy.big_bertha.mode.molevore", "message.antarchy.big_bertha.mode.molevore"), LUCID(4, "tooltip.antarchy.big_bertha.mode.lucid", "message.antarchy.big_bertha.mode.lucid"), - TORETERROR(5, "tooltip.antarchy.big_bertha.mode.toreterror", "message.antarchy.big_bertha.mode.toreterror"); + TORETERROR(5, "tooltip.antarchy.big_bertha.mode.toreterror", "message.antarchy.big_bertha.mode.toreterror"), + HERCULES(6, "tooltip.antarchy.big_bertha.mode.hercules", "message.antarchy.big_bertha.mode.hercules"); private final int id; private final String tooltipKey; @@ -612,7 +639,8 @@ public class BigBerthaItem extends SwordItem implements GeoItem { case BASILISK -> LUCID; case LUCID -> NIGHTMARE; case NIGHTMARE -> KRAKEN; - case KRAKEN -> MOLEVORE; + case KRAKEN -> HERCULES; + case HERCULES -> MOLEVORE; case MOLEVORE -> TORETERROR; case TORETERROR -> BASILISK; }; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java index 3d715b05..018f5845 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/GlimmerBottleItem.java @@ -1,6 +1,7 @@ package com.craisinlord.antarchy.content.item; import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.advancement.AntarchyAdvancements; import com.craisinlord.antarchy.content.client.particle.GlimmerParticles; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerCompanionSavedData; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerEntity; @@ -80,7 +81,7 @@ public class GlimmerBottleItem extends Item { level.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.BOTTLE_EMPTY, SoundSource.PLAYERS, 1.0F, 1.0F); if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) { - com.craisinlord.antarchy.content.AntarchyAdvancements.award(serverPlayer, variant.tameAdvancementId()); + AntarchyAdvancements.award(serverPlayer, variant.tameAdvancementId()); } ItemStack result = ItemUtils.createFilledResult(stack, player, new ItemStack(Items.GLASS_BOTTLE)); diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/JerryNucleusItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/JerryNucleusItem.java new file mode 100644 index 00000000..b4c17582 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/JerryNucleusItem.java @@ -0,0 +1,98 @@ +package com.craisinlord.antarchy.content.item; + +import com.craisinlord.antarchy.content.block.BedBugEggBlock; +import com.craisinlord.antarchy.content.block.CreepingHorrorEggBlock; +import com.craisinlord.antarchy.content.block.JerryEggBlock; +import com.craisinlord.antarchy.content.block.JumpyBugEggBlock; +import com.craisinlord.antarchy.content.block.LurkingTerrorEggBlock; +import com.craisinlord.antarchy.content.block.SpitBugEggBlock; +import java.util.List; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.animal.Turtle; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.TurtleEggBlock; +import net.minecraft.world.level.block.state.BlockState; + +public class JerryNucleusItem extends Item { + public JerryNucleusItem(Properties properties) { + super(properties); + } + + @Override + public InteractionResult useOn(UseOnContext context) { + BlockState state = context.getLevel().getBlockState(context.getClickedPos()); + Block block = state.getBlock(); + boolean handled = block instanceof BedBugEggBlock + || block instanceof CreepingHorrorEggBlock + || block instanceof LurkingTerrorEggBlock + || block instanceof JumpyBugEggBlock + || block instanceof SpitBugEggBlock + || block instanceof JerryEggBlock + || block instanceof TurtleEggBlock; + if (!handled) { + return super.useOn(context); + } + + if (!(context.getLevel() instanceof ServerLevel serverLevel)) { + return InteractionResult.SUCCESS; + } + + BlockPos pos = context.getClickedPos(); + if (block instanceof BedBugEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos, state); + } else if (block instanceof CreepingHorrorEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos, state); + } else if (block instanceof LurkingTerrorEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos, state); + } else if (block instanceof JumpyBugEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos); + } else if (block instanceof SpitBugEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos); + } else if (block instanceof JerryEggBlock eggBlock) { + eggBlock.hatchWithNucleus(serverLevel, pos); + } else if (block instanceof TurtleEggBlock) { + hatchTurtleEggs(serverLevel, pos, state); + } + + if (context.getPlayer() == null || !context.getPlayer().getAbilities().instabuild) { + context.getItemInHand().shrink(1); + } + return InteractionResult.CONSUME; + } + + private static void hatchTurtleEggs(ServerLevel level, BlockPos pos, BlockState state) { + int eggs = state.getValue(TurtleEggBlock.EGGS); + level.removeBlock(pos, false); + level.playSound(null, pos, SoundEvents.TURTLE_EGG_HATCH, SoundSource.BLOCKS, 0.75F, 0.95F + level.random.nextFloat() * 0.1F); + + for (int i = 0; i < eggs; i++) { + Turtle turtle = EntityType.TURTLE.create(level); + if (turtle == null) { + continue; + } + turtle.setAge(-24000); + turtle.setHomePos(pos); + double spawnX = pos.getX() + 0.3D + level.random.nextDouble() * 0.4D; + double spawnZ = pos.getZ() + 0.3D + level.random.nextDouble() * 0.4D; + turtle.moveTo(spawnX, pos.getY() + 0.1D, spawnZ, level.random.nextFloat() * 360.0F, 0.0F); + level.addFreshEntity(turtle); + } + } + + @Override + public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { + tooltipComponents.add(Component.translatable("tooltip.antarchy.jerry_nucleus.hatch").withStyle(ChatFormatting.GRAY)); + super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/item/MantisClawItem.java b/common/src/main/java/com/craisinlord/antarchy/content/item/MantisClawItem.java new file mode 100644 index 00000000..818d39cd --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/content/item/MantisClawItem.java @@ -0,0 +1,31 @@ +package com.craisinlord.antarchy.content.item; + +import java.util.List; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.SwordItem; +import net.minecraft.world.item.Tier; +import net.minecraft.world.item.TooltipFlag; + +public class MantisClawItem extends SwordItem { + public static final double WALL_CLING_FALL_SPEED = -0.02D; + public static final double WALL_CLIMB_JUMP_VELOCITY = 0.42D; + + public MantisClawItem(Tier tier, Item.Properties properties) { + super(tier, properties); + } + + public static boolean isDualWielding(LivingEntity entity) { + return entity.getMainHandItem().getItem() instanceof MantisClawItem + && entity.getOffhandItem().getItem() instanceof MantisClawItem; + } + + @Override + public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { + tooltipComponents.add(Component.translatable("tooltip.antarchy.mantis_claw.wall_cling").withStyle(ChatFormatting.GRAY)); + super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/content/network/HerculesBeetleMountedChargePayload.java b/common/src/main/java/com/craisinlord/antarchy/content/network/HerculesBeetleMountedChargePayload.java index 292532ef..36731826 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/network/HerculesBeetleMountedChargePayload.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/network/HerculesBeetleMountedChargePayload.java @@ -7,11 +7,14 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; -public record HerculesBeetleMountedChargePayload(int chargeTicks) implements CustomPacketPayload { +public record HerculesBeetleMountedChargePayload(boolean pressing) implements CustomPacketPayload { public static final Type TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hercules_beetle_mounted_charge")); public static final StreamCodec STREAM_CODEC = - ByteBufCodecs.VAR_INT.map(HerculesBeetleMountedChargePayload::new, HerculesBeetleMountedChargePayload::chargeTicks); + StreamCodec.composite( + ByteBufCodecs.BOOL, HerculesBeetleMountedChargePayload::pressing, + HerculesBeetleMountedChargePayload::new + ); @Override public Type type() { diff --git a/common/src/main/java/com/craisinlord/antarchy/content/AmericanizeRecipe.java b/common/src/main/java/com/craisinlord/antarchy/content/recipe/AmericanizeRecipe.java similarity index 95% rename from common/src/main/java/com/craisinlord/antarchy/content/AmericanizeRecipe.java rename to common/src/main/java/com/craisinlord/antarchy/content/recipe/AmericanizeRecipe.java index f8cf9dfb..7f55ca45 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/AmericanizeRecipe.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/recipe/AmericanizeRecipe.java @@ -1,6 +1,8 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.recipe; import com.craisinlord.antarchy.config.AntarchySettings; +import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.AntarchyTags; import net.minecraft.core.HolderLookup; import net.minecraft.core.NonNullList; import net.minecraft.core.component.DataComponents; diff --git a/common/src/main/java/com/craisinlord/antarchy/content/CustomBrewingRecipes.java b/common/src/main/java/com/craisinlord/antarchy/content/recipe/CustomBrewingRecipes.java similarity index 96% rename from common/src/main/java/com/craisinlord/antarchy/content/CustomBrewingRecipes.java rename to common/src/main/java/com/craisinlord/antarchy/content/recipe/CustomBrewingRecipes.java index 8f4ea530..99a3f87d 100644 --- a/common/src/main/java/com/craisinlord/antarchy/content/CustomBrewingRecipes.java +++ b/common/src/main/java/com/craisinlord/antarchy/content/recipe/CustomBrewingRecipes.java @@ -1,8 +1,9 @@ -package com.craisinlord.antarchy.content; +package com.craisinlord.antarchy.content.recipe; +import com.craisinlord.antarchy.content.AntarchyObjects; +import com.craisinlord.antarchy.content.AntarchyTags; import com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant; import com.craisinlord.antarchy.content.item.GlimmerBottleItem; -import net.minecraft.core.Holder; import net.minecraft.core.component.DataComponents; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/GoopedStepSoundMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/GoopedStepSoundMixin.java index d384ce8f..edc84ae7 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/GoopedStepSoundMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/GoopedStepSoundMixin.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.mixins; -import com.craisinlord.antarchy.content.GoopedEffectHooks; +import com.craisinlord.antarchy.content.effect.GoopedEffectHooks; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.sounds.SoundEvents; diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/MantisClawWallClimbMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/MantisClawWallClimbMixin.java new file mode 100644 index 00000000..63c1acc3 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/MantisClawWallClimbMixin.java @@ -0,0 +1,71 @@ +package com.craisinlord.antarchy.mixins; + +import com.craisinlord.antarchy.content.item.MantisClawItem; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Player.class) +public abstract class MantisClawWallClimbMixin extends LivingEntity { + @Unique + private boolean antarchy$mantisClinging; + @Unique + private int antarchy$mantisWallJumpCooldown; + + protected MantisClawWallClimbMixin(EntityType entityType, Level level) { + super(entityType, level); + } + + @Inject(method = "tick", at = @At("TAIL")) + private void antarchy$tickMantisWallCling(CallbackInfo ci) { + if (this.antarchy$mantisWallJumpCooldown > 0) { + this.antarchy$mantisWallJumpCooldown--; + } + + if (!this.antarchy$canMantisCling()) { + this.antarchy$mantisClinging = false; + return; + } + + if (!this.antarchy$mantisClinging && !this.level().isClientSide()) { + this.playSound( + SoundEvents.STONE_BREAK, + 0.45F, + 0.9F + this.getRandom().nextFloat() * 0.1F + ); + } + + Vec3 motion = this.getDeltaMovement(); + double clampedY = motion.y < MantisClawItem.WALL_CLING_FALL_SPEED ? MantisClawItem.WALL_CLING_FALL_SPEED : motion.y; + if (this.jumping && this.antarchy$mantisWallJumpCooldown <= 0) { + clampedY = Math.max(clampedY, MantisClawItem.WALL_CLIMB_JUMP_VELOCITY); + this.antarchy$mantisWallJumpCooldown = 6; + } + + this.setDeltaMovement(motion.x, clampedY, motion.z); + this.hasImpulse = true; + this.fallDistance = 0.0F; + this.antarchy$mantisClinging = true; + } + + @Unique + private boolean antarchy$canMantisCling() { + Player player = (Player) (Object) this; + return MantisClawItem.isDualWielding(player) + && this.horizontalCollision + && !this.onGround() + && !this.isInWaterOrBubble() + && !this.isPassenger() + && !this.isFallFlying() + && !player.getAbilities().flying + && !player.isSpectator(); + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/PotionBrewingMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/PotionBrewingMixin.java index a5510c83..f8e77b0a 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/PotionBrewingMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/PotionBrewingMixin.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.mixins; -import com.craisinlord.antarchy.content.CustomBrewingRecipes; +import com.craisinlord.antarchy.content.recipe.CustomBrewingRecipes; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.alchemy.PotionBrewing; import org.spongepowered.asm.mixin.Mixin; diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/StinkyLivingEntityMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/StinkyLivingEntityMixin.java index 33d18b90..8cd675a7 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/StinkyLivingEntityMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/StinkyLivingEntityMixin.java @@ -1,7 +1,7 @@ package com.craisinlord.antarchy.mixins; import com.craisinlord.antarchy.content.AntarchyObjects; -import com.craisinlord.antarchy.content.StinkyBehavior; +import com.craisinlord.antarchy.content.effect.StinkyBehavior; import net.minecraft.world.entity.LivingEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/client/CustomBossBarMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/client/CustomBossBarMixin.java new file mode 100644 index 00000000..02939a73 --- /dev/null +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/client/CustomBossBarMixin.java @@ -0,0 +1,43 @@ +package com.craisinlord.antarchy.mixins.client; + +import com.craisinlord.antarchy.content.client.hud.CustomBossBarRenderer; +import com.llamalad7.mixinextras.sugar.Local; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.BossHealthOverlay; +import net.minecraft.client.gui.components.LerpingBossEvent; +import net.minecraft.network.chat.Component; +import net.minecraft.world.BossEvent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyConstant; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(BossHealthOverlay.class) +public abstract class CustomBossBarMixin { + @Inject( + method = "drawBar(Lnet/minecraft/client/gui/GuiGraphics;IILnet/minecraft/world/BossEvent;)V", + at = @At("HEAD"), + cancellable = true + ) + private void antarchy$drawCustomBossBar(GuiGraphics guiGraphics, int x, int y, BossEvent bossEvent, CallbackInfo ci) { + if (CustomBossBarRenderer.render(guiGraphics, x, y, bossEvent)) { + ci.cancel(); + } + } + + @Redirect( + method = "render", + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/LerpingBossEvent;getName()Lnet/minecraft/network/chat/Component;") + ) + private Component antarchy$hideNameForCustomBossBar(LerpingBossEvent bossEvent) { + return CustomBossBarRenderer.isCustomBoss(bossEvent) ? Component.empty() : bossEvent.getName(); + } + + @ModifyConstant(method = "render", constant = @Constant(intValue = 9, ordinal = 1)) + private int antarchy$doubleGapForCustomBossBar(int original, @Local LerpingBossEvent bossEvent) { + return CustomBossBarRenderer.isCustomBoss(bossEvent) ? original + 19 : original; + } +} diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityGravityMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityGravityMixin.java index 68116a82..d13fde07 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityGravityMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityGravityMixin.java @@ -239,7 +239,7 @@ public abstract class EntityGravityMixin implements AntarchyGravityAccess { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (com.craisinlord.antarchy.content.block.PotentNyxiteBlock.isAntiwater(fluidState)) { + if (com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityMoveMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityMoveMixin.java index d756591e..a8c7401b 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityMoveMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/EntityMoveMixin.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.mixins.gravity; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; @@ -160,7 +160,7 @@ public abstract class EntityMoveMixin { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/LivingEntityMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/LivingEntityMixin.java index 5e92df94..5e78fa97 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/LivingEntityMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/LivingEntityMixin.java @@ -3,7 +3,7 @@ package com.craisinlord.antarchy.mixins.gravity; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; @@ -115,7 +115,7 @@ public abstract class LivingEntityMixin { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/ServerPlayerGravityMixin.java b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/ServerPlayerGravityMixin.java index 28f44868..70629df2 100644 --- a/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/ServerPlayerGravityMixin.java +++ b/common/src/main/java/com/craisinlord/antarchy/mixins/gravity/ServerPlayerGravityMixin.java @@ -1,6 +1,6 @@ package com.craisinlord.antarchy.mixins.gravity; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; @@ -105,7 +105,7 @@ public abstract class ServerPlayerGravityMixin { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = player.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/common/src/main/resources/antarchy-common.mixins.json b/common/src/main/resources/antarchy-common.mixins.json index 899ada7f..ecf4cd68 100644 --- a/common/src/main/resources/antarchy-common.mixins.json +++ b/common/src/main/resources/antarchy-common.mixins.json @@ -20,6 +20,7 @@ "FrogVariantBootstrapMixin", "GlowSquidLumenSpawnMixin", "GlowVinesUnderLeavesMixin", + "MantisClawWallClimbMixin", "MilkBucketSizeResetMixin", "GoopedStepSoundMixin", "ExperimentalSettingsLevelSummaryMixin", @@ -63,6 +64,7 @@ "multipart.EntityMultipartLifecycleMixin" ], "client": [ + "client.CustomBossBarMixin", "client.CavarynSkyMixin", "client.CavarynHordeFogMixin", "client.CavarynHordeLightTextureMixin", diff --git a/common/src/main/resources/assets/antarchy/animations/hercules_beetle.animation.json b/common/src/main/resources/assets/antarchy/animations/hercules_beetle.animation.json index 57b4d3f2..7a4fde8d 100644 --- a/common/src/main/resources/assets/antarchy/animations/hercules_beetle.animation.json +++ b/common/src/main/resources/assets/antarchy/animations/hercules_beetle.animation.json @@ -2373,26 +2373,6 @@ } } }, - "right_wing": { - "scale": { - "0.0": { - "post": { - "vector": [0, 0, 0] - }, - "lerp_mode": "catmullrom" - } - } - }, - "left_wing": { - "scale": { - "0.0": { - "post": { - "vector": [0, 0, 0] - }, - "lerp_mode": "catmullrom" - } - } - }, "Hercules_beetle": { "position": { "0.0": { @@ -2661,26 +2641,6 @@ } } }, - "right_wing": { - "scale": { - "0.0": { - "post": { - "vector": [0, 0, 0] - }, - "lerp_mode": "catmullrom" - } - } - }, - "left_wing": { - "scale": { - "0.0": { - "post": { - "vector": [0, 0, 0] - }, - "lerp_mode": "catmullrom" - } - } - }, "Hercules_beetle": { "position": { "0.0": { @@ -5183,4 +5143,4 @@ } } } -} \ No newline at end of file +} diff --git a/common/src/main/resources/assets/antarchy/lang/de_de.json b/common/src/main/resources/assets/antarchy/lang/de_de.json index 170f9ebd..fdee7c26 100644 --- a/common/src/main/resources/assets/antarchy/lang/de_de.json +++ b/common/src/main/resources/assets/antarchy/lang/de_de.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Schleudert dich bei einem Treffer nach vorn.", "tooltip.antarchy.blood_crystal_katana.trail": "Hinterlässt eine karmesinrote Spur.", "item.antarchy.mantis_claw": "Gottesanbeterin-Klaue", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "König-Schuppe", "item.antarchy.queen_scale": "Königin-Schuppe", "item.antarchy.jumpy_bug_leg": "Sprungkäfer-Bein", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "Die kleine Raupe Nimmersatt", "advancements.antarchy.very_hungry_caterpillar.description": "Hilf einer Raupe beim Wachsen.", "effect.antarchy.dread": "Grauen", + "effect.antarchy.dread.description": "Verursacht visuelle und akustische Halluzinationen.", "effect.antarchy.paralyzed": "Gelähmt", + "effect.antarchy.paralyzed.description": "Verhindert, dass sich Ziele bewegen.", "effect.antarchy.inverted": "Umgekehrt", + "effect.antarchy.inverted.description": "Kehrt die Schwerkraft des Ziels um.", "effect.antarchy.stinky": "Stinkend", + "effect.antarchy.stinky.description": "Vertreibt passive und neutrale Kreaturen und zieht Gliederfüßer an.", + "effect.antarchy.gooped.description": "Verlangsamt Bewegung und Angriffsgeschwindigkeit.", "effect.antarchy.shrinking": "Schrumpfung", "effect.antarchy.growth": "Wachstum", "effect.antarchy.bloodglass_ward": "Blutglasbarriere", + "effect.antarchy.bloodglass_ward.description": "Verleiht Herzen, die zersplittern und einen gesamten Treffer absorbieren. Sie regenerieren sich mit der Zeit.", "death.attack.triffid_mauling": "%1$s wurde von einer Pflanze zu Tode zerfleischt", "death.attack.triffid_mauling.player": "%1$s wurde von einer Pflanze zu Tode zerfleischt", "death.attack.triffid_swallow": "%1$s wurde von einem Triffid verschlungen", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "Herkuleskäfer brüllt", "subtitles.antarchy.hercules_beetle_charge_start": "Herkuleskäfer lädt einen Angriff auf", "subtitles.antarchy.hercules_beetle_knocked_down": "Herkuleskäfer wird zu Boden geworfen", + "subtitles.antarchy.jerry_idle": "Jerry schwatzt", + "subtitles.antarchy.jerry_hurt": "Jerry wird verletzt", + "subtitles.antarchy.jerry_death": "Jerry stirbt", + "subtitles.antarchy.jerry_attack": "Jerry greift an", "subtitles.antarchy.jumpy_bug_idle": "Sprungkäfer ist zu hören", "subtitles.antarchy.spit_bug_idle": "Spuckkäfer ist zu hören", "subtitles.antarchy.jumpy_bug_hurt": "Sprungkäfer wird verletzt", diff --git a/common/src/main/resources/assets/antarchy/lang/en_us.json b/common/src/main/resources/assets/antarchy/lang/en_us.json index 07f89612..eb0f7ab8 100644 --- a/common/src/main/resources/assets/antarchy/lang/en_us.json +++ b/common/src/main/resources/assets/antarchy/lang/en_us.json @@ -349,9 +349,13 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Launches you forward on hit.", "tooltip.antarchy.blood_crystal_katana.trail": "Leaves a crimson trail behind you.", "item.antarchy.mantis_claw": "Mantis Claw", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "King Scale", "item.antarchy.queen_scale": "Queen Scale", "item.antarchy.jerry_nucleus": "Jerry Nucleus", + "tooltip.antarchy.jerry_nucleus.hatch": "Right-click any bug egg or turtle egg to hatch it instantly.", + "key.antarchy.dorrie_charge_jump": "Dorrie Charge Jump", + "key.antarchy.hercules_beetle_charge": "Hercules Beetle Charge", "item.antarchy.carapace": "Carapace", "item.antarchy.jumpy_bug_leg": "Jumpy Bug Leg", "item.antarchy.jumpy_boots": "Jumpy Boots", @@ -521,6 +525,7 @@ "message.antarchy.big_bertha.mode.lucid": "Lucid", "message.antarchy.big_bertha.mode.nightmare": "Nightmare", "message.antarchy.big_bertha.mode.kraken": "Kraken", + "message.antarchy.big_bertha.mode.hercules": "Hercules", "message.antarchy.big_bertha.mode.molevore": "Molevore", "message.antarchy.big_bertha.mode.toreterror": "Toreterror", "message.antarchy.ultimate_tool.mode_3x3": "Switched to 3x3 Mining", @@ -530,13 +535,19 @@ "advancements.antarchy.very_hungry_caterpillar.title": "Very Hungry Caterpillar", "advancements.antarchy.very_hungry_caterpillar.description": "Help a caterpillar grow.", "effect.antarchy.dread": "Dread", + "effect.antarchy.dread.description": "Gives visual and audio hallucinations.", "effect.antarchy.paralyzed": "Paralyzed", + "effect.antarchy.paralyzed.description": "Prevents targets from moving.", "effect.antarchy.inverted": "Inverted", + "effect.antarchy.inverted.description": "Inverts the target's gravity.", "effect.antarchy.stinky": "Stinky", + "effect.antarchy.stinky.description": "Repels passive and neutral mobs, attracts arthropods.", "effect.antarchy.gooped": "Gooped", + "effect.antarchy.gooped.description": "Slows movement and attack speed.", "effect.antarchy.shrinking": "Shrinking", "effect.antarchy.growth": "Growth", "effect.antarchy.bloodglass_ward": "Bloodglass Ward", + "effect.antarchy.bloodglass_ward.description": "Gives hearts that shatter, absorbing an entire hit of damage. They regenerate over time.", "death.attack.triffid_mauling": "%1$s was mauled to death by a plant", "death.attack.triffid_mauling.player": "%1$s was mauled to death by a plant", "death.attack.triffid_swallow": "%1$s was swallowed by a triffid", @@ -549,6 +560,7 @@ "tooltip.antarchy.big_bertha.mode.lucid": "Hits invert targets for a few seconds. Hits deal more damage while you are inverted.", "tooltip.antarchy.big_bertha.mode.nightmare": "Players suffer Dread; hits inflict weakness.", "tooltip.antarchy.big_bertha.mode.kraken": "Hits slam targets back and call lightning.", + "tooltip.antarchy.big_bertha.mode.hercules": "Hits deal bonus damage and launch targets high into the air.", "tooltip.antarchy.big_bertha.mode.molevore": "Right-click to spin forward and drill through Molevore blocks.", "tooltip.antarchy.big_bertha.mode.toreterror": "Right-click to launch into the air and crash down with an AOE shockwave.", "tooltip.antarchy.ultimate_tools_3x3": "Shift-right-click to toggle 3x3 Mining.", @@ -957,6 +969,10 @@ "subtitles.antarchy.spit_bug_hurt": "Spit Bug hurts", "subtitles.antarchy.spit_bug_spit": "Spit Bug spits", "subtitles.antarchy.brutalfly_spit": "Brutalfly spits", + "subtitles.antarchy.jerry_idle": "Jerry chatters", + "subtitles.antarchy.jerry_hurt": "Jerry hurts", + "subtitles.antarchy.jerry_death": "Jerry dies", + "subtitles.antarchy.jerry_attack": "Jerry attacks", "advancements.antarchy.bug_apetit.title": "Bug Apétit", "advancements.antarchy.bug_apetit.description": "Eat Cooked Bug Meat.", "advancements.antarchy.behavioral_correction.title": "Behavioral Correction", diff --git a/common/src/main/resources/assets/antarchy/lang/es_es.json b/common/src/main/resources/assets/antarchy/lang/es_es.json index 8d98cae7..8d6efdf1 100644 --- a/common/src/main/resources/assets/antarchy/lang/es_es.json +++ b/common/src/main/resources/assets/antarchy/lang/es_es.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Te impulsa hacia delante al golpear.", "tooltip.antarchy.blood_crystal_katana.trail": "Deja un rastro carmesí tras de ti.", "item.antarchy.mantis_claw": "Garra de Mantis", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "Escama de Rey", "item.antarchy.queen_scale": "Escama de Reina", "item.antarchy.jumpy_bug_leg": "Pata de Bicho saltarín", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "La oruga muy hambrienta", "advancements.antarchy.very_hungry_caterpillar.description": "Ayuda a crecer a una oruga.", "effect.antarchy.dread": "Pavor", + "effect.antarchy.dread.description": "Provoca alucinaciones visuales y auditivas.", "effect.antarchy.paralyzed": "Paralizado", + "effect.antarchy.paralyzed.description": "Impide que los objetivos se muevan.", "effect.antarchy.inverted": "Invertido", + "effect.antarchy.inverted.description": "Invierte la gravedad del objetivo.", "effect.antarchy.stinky": "Apestoso", + "effect.antarchy.stinky.description": "Ahuyenta a las criaturas pasivas y neutrales, y atrae a los artrópodos.", + "effect.antarchy.gooped.description": "Reduce la velocidad de movimiento y de ataque.", "effect.antarchy.shrinking": "Reducción", "effect.antarchy.growth": "Crecimiento", "effect.antarchy.bloodglass_ward": "Guardia de Cristalsangre", + "effect.antarchy.bloodglass_ward.description": "Otorga corazones que se hacen añicos y absorben un golpe completo de daño. Se regeneran con el tiempo.", "death.attack.triffid_mauling": "Una planta despedazó a %1$s", "death.attack.triffid_mauling.player": "Una planta despedazó a %1$s", "death.attack.triffid_swallow": "Un Triffid se tragó a %1$s", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "Escarabajo hércules ruge", "subtitles.antarchy.hercules_beetle_charge_start": "Escarabajo hércules carga un ataque", "subtitles.antarchy.hercules_beetle_knocked_down": "Escarabajo hércules cae derribado", + "subtitles.antarchy.jerry_idle": "Jerry parlotea", + "subtitles.antarchy.jerry_hurt": "Jerry sufre daño", + "subtitles.antarchy.jerry_death": "Jerry muere", + "subtitles.antarchy.jerry_attack": "Jerry ataca", "subtitles.antarchy.jumpy_bug_idle": "Bicho saltarín hace ruido", "subtitles.antarchy.spit_bug_idle": "Bicho escupidor hace ruido", "subtitles.antarchy.jumpy_bug_hurt": "Bicho saltarín recibe daño", diff --git a/common/src/main/resources/assets/antarchy/lang/fr_fr.json b/common/src/main/resources/assets/antarchy/lang/fr_fr.json index 3bec1a97..92426d80 100644 --- a/common/src/main/resources/assets/antarchy/lang/fr_fr.json +++ b/common/src/main/resources/assets/antarchy/lang/fr_fr.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Vous propulse vers l’avant lorsque vous touchez une cible.", "tooltip.antarchy.blood_crystal_katana.trail": "Laisse une traînée cramoisie derrière vous.", "item.antarchy.mantis_claw": "Griffe de Mante religieuse", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "Écaille de Roi", "item.antarchy.queen_scale": "Écaille de Reine", "item.antarchy.jumpy_bug_leg": "Patte de Insecte sauteur", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "La chenille qui fait des trous", "advancements.antarchy.very_hungry_caterpillar.description": "Aidez une chenille à grandir.", "effect.antarchy.dread": "Effroi", + "effect.antarchy.dread.description": "Provoque des hallucinations visuelles et sonores.", "effect.antarchy.paralyzed": "Paralysé", + "effect.antarchy.paralyzed.description": "Empêche les cibles de se déplacer.", "effect.antarchy.inverted": "Inversé", + "effect.antarchy.inverted.description": "Inverse la gravité de la cible.", "effect.antarchy.stinky": "Puant", + "effect.antarchy.stinky.description": "Repousse les créatures passives et neutres, et attire les arthropodes.", + "effect.antarchy.gooped.description": "Ralentit la vitesse de déplacement et d'attaque.", "effect.antarchy.shrinking": "Rétrécissement", "effect.antarchy.growth": "Croissance", "effect.antarchy.bloodglass_ward": "Égide de verre-sang", + "effect.antarchy.bloodglass_ward.description": "Accorde des cœurs qui se brisent et absorbent un coup entier de dégâts. Ils se régénèrent avec le temps.", "death.attack.triffid_mauling": "%1$s a été déchiqueté par une plante", "death.attack.triffid_mauling.player": "%1$s a été déchiqueté par une plante", "death.attack.triffid_swallow": "%1$s a été avalé par un Triffid", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "Scarabée Hercule rugir", "subtitles.antarchy.hercules_beetle_charge_start": "Scarabée Hercule charge une attaque", "subtitles.antarchy.hercules_beetle_knocked_down": "Scarabée Hercule est renversé", + "subtitles.antarchy.jerry_idle": "Jerry bavarde", + "subtitles.antarchy.jerry_hurt": "Jerry souffre", + "subtitles.antarchy.jerry_death": "Jerry meurt", + "subtitles.antarchy.jerry_attack": "Jerry attaque", "subtitles.antarchy.jumpy_bug_idle": "Insecte sauteur se fait entendre", "subtitles.antarchy.spit_bug_idle": "Insecte cracheur se fait entendre", "subtitles.antarchy.jumpy_bug_hurt": "Insecte sauteur est blessé", diff --git a/common/src/main/resources/assets/antarchy/lang/it_it.json b/common/src/main/resources/assets/antarchy/lang/it_it.json index e8d39feb..00b59863 100644 --- a/common/src/main/resources/assets/antarchy/lang/it_it.json +++ b/common/src/main/resources/assets/antarchy/lang/it_it.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Ti scaglia in avanti quando colpisci.", "tooltip.antarchy.blood_crystal_katana.trail": "Lascia una scia cremisi dietro di te.", "item.antarchy.mantis_claw": "Artiglio di Mantide", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "Scaglia di Re", "item.antarchy.queen_scale": "Scaglia di Regina", "item.antarchy.jumpy_bug_leg": "Zampa di Insetto saltatore", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "Il bruco molto affamato", "advancements.antarchy.very_hungry_caterpillar.description": "Aiuta un bruco a crescere.", "effect.antarchy.dread": "Terrore", + "effect.antarchy.dread.description": "Provoca allucinazioni visive e sonore.", "effect.antarchy.paralyzed": "Paralizzato", + "effect.antarchy.paralyzed.description": "Impedisce ai bersagli di muoversi.", "effect.antarchy.inverted": "Invertito", + "effect.antarchy.inverted.description": "Inverte la gravità del bersaglio.", "effect.antarchy.stinky": "Puzzolente", + "effect.antarchy.stinky.description": "Respinge le creature passive e neutrali e attira gli artropodi.", + "effect.antarchy.gooped.description": "Riduce la velocità di movimento e di attacco.", "effect.antarchy.shrinking": "Restringimento", "effect.antarchy.growth": "Crescita", "effect.antarchy.bloodglass_ward": "Protezione di vetrosangue", + "effect.antarchy.bloodglass_ward.description": "Conferisce cuori che si frantumano assorbendo un colpo intero di danno. Si rigenerano col tempo.", "death.attack.triffid_mauling": "%1$s è stato sbranato a morte da una pianta", "death.attack.triffid_mauling.player": "%1$s è stato sbranato a morte da una pianta", "death.attack.triffid_swallow": "%1$s è stato inghiottito da un Triffid", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "Lo scarabeo Ercole ruggisce", "subtitles.antarchy.hercules_beetle_charge_start": "Lo scarabeo Ercole si carica", "subtitles.antarchy.hercules_beetle_knocked_down": "Lo scarabeo Ercole viene abbattuto", + "subtitles.antarchy.jerry_idle": "Jerry chiacchiera", + "subtitles.antarchy.jerry_hurt": "Jerry soffre", + "subtitles.antarchy.jerry_death": "Jerry muore", + "subtitles.antarchy.jerry_attack": "Jerry attacca", "subtitles.antarchy.jumpy_bug_idle": "L’insetto saltatore emette un verso", "subtitles.antarchy.spit_bug_idle": "L’insetto sputatore emette un verso", "subtitles.antarchy.jumpy_bug_hurt": "L’insetto saltatore si ferisce", diff --git a/common/src/main/resources/assets/antarchy/lang/ja_jp.json b/common/src/main/resources/assets/antarchy/lang/ja_jp.json index 64e2d44a..7ac05450 100644 --- a/common/src/main/resources/assets/antarchy/lang/ja_jp.json +++ b/common/src/main/resources/assets/antarchy/lang/ja_jp.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "攻撃命中時に前方へ突進します。", "tooltip.antarchy.blood_crystal_katana.trail": "背後に深紅の軌跡を残します。", "item.antarchy.mantis_claw": "カマキリの爪", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "王の鱗", "item.antarchy.queen_scale": "女王の鱗", "item.antarchy.jumpy_bug_leg": "ジャンピーバグの脚", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "はらぺこあおむし", "advancements.antarchy.very_hungry_caterpillar.description": "イモムシの成長を手伝う。", "effect.antarchy.dread": "恐怖", + "effect.antarchy.dread.description": "視覚と聴覚の幻覚を引き起こします。", "effect.antarchy.paralyzed": "麻痺", + "effect.antarchy.paralyzed.description": "対象が動けなくなります。", "effect.antarchy.inverted": "重力反転", + "effect.antarchy.inverted.description": "対象の重力を反転させます。", "effect.antarchy.stinky": "悪臭", + "effect.antarchy.stinky.description": "友好的および中立のMobを遠ざけ、節足動物を引き寄せます。", + "effect.antarchy.gooped.description": "移動速度と攻撃速度を低下させます。", "effect.antarchy.shrinking": "縮小", "effect.antarchy.growth": "成長", "effect.antarchy.bloodglass_ward": "血晶の守護", + "effect.antarchy.bloodglass_ward.description": "砕けるハートを与え、1回分のダメージを丸ごと吸収します。時間経過で再生します。", "death.attack.triffid_mauling": "%1$sは植物に噛み殺された", "death.attack.triffid_mauling.player": "%1$sは植物に噛み殺された", "death.attack.triffid_swallow": "%1$sはトリフィドに飲み込まれた", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "ヘラクレスオオカブトが咆哮する", "subtitles.antarchy.hercules_beetle_charge_start": "ヘラクレスオオカブトが攻撃を溜める", "subtitles.antarchy.hercules_beetle_knocked_down": "ヘラクレスオオカブトが転倒する", + "subtitles.antarchy.jerry_idle": "ジェリーが鳴く", + "subtitles.antarchy.jerry_hurt": "ジェリーが傷つく", + "subtitles.antarchy.jerry_death": "ジェリーが死ぬ", + "subtitles.antarchy.jerry_attack": "ジェリーが攻撃する", "subtitles.antarchy.jumpy_bug_idle": "ジャンピーバグが鳴く", "subtitles.antarchy.spit_bug_idle": "スピットバグが鳴く", "subtitles.antarchy.jumpy_bug_hurt": "ジャンピーバグが傷つく", diff --git a/common/src/main/resources/assets/antarchy/lang/ko_kr.json b/common/src/main/resources/assets/antarchy/lang/ko_kr.json index 3b14981c..bb5facc5 100644 --- a/common/src/main/resources/assets/antarchy/lang/ko_kr.json +++ b/common/src/main/resources/assets/antarchy/lang/ko_kr.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "명중 시 앞으로 돌진합니다.", "tooltip.antarchy.blood_crystal_katana.trail": "뒤에 진홍빛 흔적을 남깁니다.", "item.antarchy.mantis_claw": "사마귀 발톱", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "왕 비늘", "item.antarchy.queen_scale": "여왕 비늘", "item.antarchy.jumpy_bug_leg": "점피 벌레 다리", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "배고픈 애벌레", "advancements.antarchy.very_hungry_caterpillar.description": "애벌레가 자라도록 도와주세요.", "effect.antarchy.dread": "공포", + "effect.antarchy.dread.description": "시각 및 청각 환각을 일으킵니다.", "effect.antarchy.paralyzed": "마비", + "effect.antarchy.paralyzed.description": "대상이 움직이지 못하게 합니다.", "effect.antarchy.inverted": "반전", + "effect.antarchy.inverted.description": "대상의 중력을 반전시킵니다.", "effect.antarchy.stinky": "악취", + "effect.antarchy.stinky.description": "수동적 및 중립적 몹을 쫓아내고 절지동물을 끌어들입니다.", + "effect.antarchy.gooped.description": "이동 속도와 공격 속도를 늦춥니다.", "effect.antarchy.shrinking": "축소", "effect.antarchy.growth": "성장", "effect.antarchy.bloodglass_ward": "혈유리 수호", + "effect.antarchy.bloodglass_ward.description": "산산이 부서지는 하트를 부여해 피해 한 번을 통째로 흡수합니다. 시간이 지나면 다시 재생됩니다.", "death.attack.triffid_mauling": "%1$s이(가) 식물에게 물어뜯겨 죽었습니다", "death.attack.triffid_mauling.player": "%1$s이(가) 식물에게 물어뜯겨 죽었습니다", "death.attack.triffid_swallow": "%1$s이(가) 트리피드에게 삼켜졌습니다", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "헤라클레스장수풍뎅이 포효합니다", "subtitles.antarchy.hercules_beetle_charge_start": "헤라클레스장수풍뎅이 힘을 모읍니다", "subtitles.antarchy.hercules_beetle_knocked_down": "헤라클레스장수풍뎅이 쓰러집니다", + "subtitles.antarchy.jerry_idle": "제리가 재잘거립니다", + "subtitles.antarchy.jerry_hurt": "제리가 다칩니다", + "subtitles.antarchy.jerry_death": "제리가 죽습니다", + "subtitles.antarchy.jerry_attack": "제리가 공격합니다", "subtitles.antarchy.jumpy_bug_idle": "점피 벌레 소리를 냅니다", "subtitles.antarchy.spit_bug_idle": "스핏 벌레 소리를 냅니다", "subtitles.antarchy.jumpy_bug_hurt": "점피 벌레 다칩니다", diff --git a/common/src/main/resources/assets/antarchy/lang/pt_br.json b/common/src/main/resources/assets/antarchy/lang/pt_br.json index 1ab826af..ef307900 100644 --- a/common/src/main/resources/assets/antarchy/lang/pt_br.json +++ b/common/src/main/resources/assets/antarchy/lang/pt_br.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Impulsiona você para a frente ao acertar.", "tooltip.antarchy.blood_crystal_katana.trail": "Deixa um rastro carmesim atrás de você.", "item.antarchy.mantis_claw": "Garra de Louva-a-deus", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "Escama de Rei", "item.antarchy.queen_scale": "Escama de Rainha", "item.antarchy.jumpy_bug_leg": "Perna de Inseto Saltador", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "A Lagarta Muito Faminta", "advancements.antarchy.very_hungry_caterpillar.description": "Ajude uma lagarta a crescer.", "effect.antarchy.dread": "Pavor", + "effect.antarchy.dread.description": "Provoca alucinações visuais e auditivas.", "effect.antarchy.paralyzed": "Paralisado", + "effect.antarchy.paralyzed.description": "Impede que os alvos se movam.", "effect.antarchy.inverted": "Invertido", + "effect.antarchy.inverted.description": "Inverte a gravidade do alvo.", "effect.antarchy.stinky": "Fedido", + "effect.antarchy.stinky.description": "Afasta mobs passivos e neutros e atrai artrópodes.", + "effect.antarchy.gooped.description": "Reduz a velocidade de movimento e de ataque.", "effect.antarchy.shrinking": "Encolhimento", "effect.antarchy.growth": "Crescimento", "effect.antarchy.bloodglass_ward": "Guarda de Vidro de Sangue", + "effect.antarchy.bloodglass_ward.description": "Concede corações que se estilhaçam, absorvendo um golpe inteiro de dano. Eles se regeneram com o tempo.", "death.attack.triffid_mauling": "%1$s foi dilacerado até a morte por uma planta", "death.attack.triffid_mauling.player": "%1$s foi dilacerado até a morte por uma planta", "death.attack.triffid_swallow": "%1$s foi engolido por um Triffid", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "Besouro-hércules ruge", "subtitles.antarchy.hercules_beetle_charge_start": "Besouro-hércules carrega um ataque", "subtitles.antarchy.hercules_beetle_knocked_down": "Besouro-hércules é derrubado", + "subtitles.antarchy.jerry_idle": "Jerry tagarela", + "subtitles.antarchy.jerry_hurt": "Jerry se machuca", + "subtitles.antarchy.jerry_death": "Jerry morre", + "subtitles.antarchy.jerry_attack": "Jerry ataca", "subtitles.antarchy.jumpy_bug_idle": "Inseto Saltador faz barulho", "subtitles.antarchy.spit_bug_idle": "Inseto Cuspidor faz barulho", "subtitles.antarchy.jumpy_bug_hurt": "Inseto Saltador se machuca", diff --git a/common/src/main/resources/assets/antarchy/lang/ru_ru.json b/common/src/main/resources/assets/antarchy/lang/ru_ru.json index 6ceee79f..9b32c051 100644 --- a/common/src/main/resources/assets/antarchy/lang/ru_ru.json +++ b/common/src/main/resources/assets/antarchy/lang/ru_ru.json @@ -326,6 +326,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "Толкает вас вперёд при ударе.", "tooltip.antarchy.blood_crystal_katana.trail": "Оставляет за вами багровый след.", "item.antarchy.mantis_claw": "Клешня богомола", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "Чешуйка короля", "item.antarchy.queen_scale": "Чешуйка королевы", "item.antarchy.jumpy_bug_leg": "Ножка прыгучего жука", @@ -498,12 +499,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "Очень голодная гусеница", "advancements.antarchy.very_hungry_caterpillar.description": "Помогите гусенице вырасти.", "effect.antarchy.dread": "Ужас", + "effect.antarchy.dread.description": "Вызывает зрительные и звуковые галлюцинации.", "effect.antarchy.paralyzed": "Паралич", + "effect.antarchy.paralyzed.description": "Не дает целям двигаться.", "effect.antarchy.inverted": "Инверсия", + "effect.antarchy.inverted.description": "Инвертирует гравитацию цели.", "effect.antarchy.stinky": "Вонючесть", + "effect.antarchy.stinky.description": "Отпугивает мирных и нейтральных мобов, но притягивает членистоногих.", + "effect.antarchy.gooped.description": "Замедляет движение и скорость атаки.", "effect.antarchy.shrinking": "Уменьшение", "effect.antarchy.growth": "Увеличение", "effect.antarchy.bloodglass_ward": "Защита кровавого стекла", + "effect.antarchy.bloodglass_ward.description": "Дает сердца, которые разбиваются и полностью поглощают один удар. Со временем они восстанавливаются.", "death.attack.triffid_mauling": "%1$s был растерзан растением", "death.attack.triffid_mauling.player": "%1$s был растерзан растением", "death.attack.triffid_swallow": "%1$s был проглочен триффидом", @@ -734,6 +741,10 @@ "subtitles.antarchy.toreterror_jump_up": "Тортеррор прыгает", "subtitles.antarchy.toreterror_jump_land": "Тортеррор приземляется", "subtitles.antarchy.stinky_fly": "Вонючие мухи жужжат", + "subtitles.antarchy.jerry_idle": "Джерри стрекочет", + "subtitles.antarchy.jerry_hurt": "Джерри ранен", + "subtitles.antarchy.jerry_death": "Джерри умирает", + "subtitles.antarchy.jerry_attack": "Джерри атакует", "item.minecraft.potion.effect.inversion": "Зелье инверсии", "item.minecraft.potion.effect.long_inversion": "Зелье инверсии", "item.minecraft.splash_potion.effect.inversion": "Взрывное зелье инверсии", diff --git a/common/src/main/resources/assets/antarchy/lang/zh_cn.json b/common/src/main/resources/assets/antarchy/lang/zh_cn.json index ff9ccc93..03490d88 100644 --- a/common/src/main/resources/assets/antarchy/lang/zh_cn.json +++ b/common/src/main/resources/assets/antarchy/lang/zh_cn.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "命中时将你向前推进。", "tooltip.antarchy.blood_crystal_katana.trail": "在身后留下猩红轨迹。", "item.antarchy.mantis_claw": "螳螂利爪", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "国王鳞片", "item.antarchy.queen_scale": "女王鳞片", "item.antarchy.jumpy_bug_leg": "跳跳虫腿", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "好饿的毛毛虫", "advancements.antarchy.very_hungry_caterpillar.description": "帮助一只毛毛虫成长。", "effect.antarchy.dread": "恐惧", + "effect.antarchy.dread.description": "会产生视觉和听觉幻觉。", "effect.antarchy.paralyzed": "麻痹", + "effect.antarchy.paralyzed.description": "阻止目标移动。", "effect.antarchy.inverted": "反转", + "effect.antarchy.inverted.description": "反转目标的重力。", "effect.antarchy.stinky": "臭气", + "effect.antarchy.stinky.description": "驱赶被动和中立生物,吸引节肢生物。", + "effect.antarchy.gooped.description": "减缓移动速度和攻击速度。", "effect.antarchy.shrinking": "缩小", "effect.antarchy.growth": "生长", "effect.antarchy.bloodglass_ward": "血晶守护", + "effect.antarchy.bloodglass_ward.description": "给予会破碎的心,能吸收整整一次伤害。它们会随时间恢复。", "death.attack.triffid_mauling": "%1$s被一株植物撕咬致死", "death.attack.triffid_mauling.player": "%1$s被一株植物撕咬致死", "death.attack.triffid_swallow": "%1$s被特里菲德吞下了", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "赫拉克勒斯甲虫咆哮", "subtitles.antarchy.hercules_beetle_charge_start": "赫拉克勒斯甲虫开始蓄力", "subtitles.antarchy.hercules_beetle_knocked_down": "赫拉克勒斯甲虫被击倒", + "subtitles.antarchy.jerry_idle": "杰瑞喋喋不休", + "subtitles.antarchy.jerry_hurt": "杰瑞受伤", + "subtitles.antarchy.jerry_death": "杰瑞死亡", + "subtitles.antarchy.jerry_attack": "杰瑞攻击", "subtitles.antarchy.jumpy_bug_idle": "跳跳虫发出动静", "subtitles.antarchy.spit_bug_idle": "喷吐虫发出动静", "subtitles.antarchy.jumpy_bug_hurt": "跳跳虫受伤", diff --git a/common/src/main/resources/assets/antarchy/lang/zh_tw.json b/common/src/main/resources/assets/antarchy/lang/zh_tw.json index b30ef25d..a9ca7ebe 100644 --- a/common/src/main/resources/assets/antarchy/lang/zh_tw.json +++ b/common/src/main/resources/assets/antarchy/lang/zh_tw.json @@ -349,6 +349,7 @@ "tooltip.antarchy.blood_crystal_katana.launch": "命中時將你向前推進。", "tooltip.antarchy.blood_crystal_katana.trail": "在身後留下猩紅軌跡。", "item.antarchy.mantis_claw": "螳螂利爪", + "tooltip.antarchy.mantis_claw.wall_cling": "Dual wield to cling to walls and jump upward.", "item.antarchy.king_scale": "國王鱗片", "item.antarchy.queen_scale": "女王鱗片", "item.antarchy.jumpy_bug_leg": "跳跳蟲腿", @@ -527,12 +528,18 @@ "advancements.antarchy.very_hungry_caterpillar.title": "好餓的毛毛蟲", "advancements.antarchy.very_hungry_caterpillar.description": "幫助一隻毛毛蟲成長。", "effect.antarchy.dread": "恐懼", + "effect.antarchy.dread.description": "會產生視覺與聽覺幻覺。", "effect.antarchy.paralyzed": "麻痺", + "effect.antarchy.paralyzed.description": "阻止目標移動。", "effect.antarchy.inverted": "反轉", + "effect.antarchy.inverted.description": "反轉目標的重力。", "effect.antarchy.stinky": "臭氣", + "effect.antarchy.stinky.description": "驅趕被動與中立生物,吸引節肢生物。", + "effect.antarchy.gooped.description": "降低移動速度與攻擊速度。", "effect.antarchy.shrinking": "縮小", "effect.antarchy.growth": "生長", "effect.antarchy.bloodglass_ward": "血晶守護", + "effect.antarchy.bloodglass_ward.description": "給予會破碎的心,能吸收完整一次傷害。它們會隨時間恢復。", "death.attack.triffid_mauling": "%1$s被一株植物撕咬致死", "death.attack.triffid_mauling.player": "%1$s被一株植物撕咬致死", "death.attack.triffid_swallow": "%1$s被特里菲德吞下了", @@ -934,6 +941,10 @@ "subtitles.antarchy.hercules_beetle_cry": "赫拉克勒斯甲蟲咆哮", "subtitles.antarchy.hercules_beetle_charge_start": "赫拉克勒斯甲蟲開始蓄力", "subtitles.antarchy.hercules_beetle_knocked_down": "赫拉克勒斯甲蟲被擊倒", + "subtitles.antarchy.jerry_idle": "傑瑞喋喋不休", + "subtitles.antarchy.jerry_hurt": "傑瑞受傷", + "subtitles.antarchy.jerry_death": "傑瑞死亡", + "subtitles.antarchy.jerry_attack": "傑瑞攻擊", "subtitles.antarchy.jumpy_bug_idle": "跳跳蟲發出動靜", "subtitles.antarchy.spit_bug_idle": "噴吐蟲發出動靜", "subtitles.antarchy.jumpy_bug_hurt": "跳跳蟲受傷", diff --git a/common/src/main/resources/assets/antarchy/sounds.json b/common/src/main/resources/assets/antarchy/sounds.json index 3636e670..9c31a672 100644 --- a/common/src/main/resources/assets/antarchy/sounds.json +++ b/common/src/main/resources/assets/antarchy/sounds.json @@ -539,16 +539,20 @@ "subtitle": "subtitles.antarchy.water_cannon_fire", "sounds": [ { - "name": "antarchy:mob/toreterror/water_cannon1" + "name": "antarchy:mob/toreterror/water_cannon1", + "attenuation_distance": 28 }, { - "name": "antarchy:mob/toreterror/water_cannon2" + "name": "antarchy:mob/toreterror/water_cannon2", + "attenuation_distance": 28 }, { - "name": "antarchy:mob/toreterror/water_cannon3" + "name": "antarchy:mob/toreterror/water_cannon3", + "attenuation_distance": 28 }, { - "name": "antarchy:mob/toreterror/water_cannon4" + "name": "antarchy:mob/toreterror/water_cannon4", + "attenuation_distance": 28 } ] }, @@ -2131,5 +2135,96 @@ "name": "antarchy:mob/brutalfly/spit4" } ] + }, + "jerry_young_idle": { + "subtitle": "subtitles.antarchy.jerry_idle", + "sounds": [ + { + "name": "antarchy:mob/jerry/young_idle1" + }, + { + "name": "antarchy:mob/jerry/young_idle2" + }, + { + "name": "antarchy:mob/jerry/young_idle3" + } + ] + }, + "jerry_young_hurt": { + "subtitle": "subtitles.antarchy.jerry_hurt", + "sounds": [ + { + "name": "antarchy:mob/jerry/young_hurt1" + } + ] + }, + "jerry_young_death": { + "subtitle": "subtitles.antarchy.jerry_death", + "sounds": [ + { + "name": "antarchy:mob/jerry/young_death1" + } + ] + }, + "jerry_young_attack": { + "subtitle": "subtitles.antarchy.jerry_attack", + "sounds": [ + { + "name": "antarchy:mob/jerry/young_attack1" + }, + { + "name": "antarchy:mob/jerry/young_attack2" + } + ] + }, + "jerry_adult_idle": { + "subtitle": "subtitles.antarchy.jerry_idle", + "sounds": [ + { + "name": "antarchy:mob/jerry/adult_idle1" + }, + { + "name": "antarchy:mob/jerry/adult_idle2" + }, + { + "name": "antarchy:mob/jerry/adult_idle3" + }, + { + "name": "antarchy:mob/jerry/adult_idle4" + } + ] + }, + "jerry_adult_hurt": { + "subtitle": "subtitles.antarchy.jerry_hurt", + "sounds": [ + { + "name": "antarchy:mob/jerry/adult_hurt1" + } + ] + }, + "jerry_adult_death": { + "subtitle": "subtitles.antarchy.jerry_death", + "sounds": [ + { + "name": "antarchy:mob/jerry/adult_death1" + }, + { + "name": "antarchy:mob/jerry/adult_death2" + } + ] + }, + "jerry_adult_attack": { + "subtitle": "subtitles.antarchy.jerry_attack", + "sounds": [ + { + "name": "antarchy:mob/jerry/adult_attack1" + }, + { + "name": "antarchy:mob/jerry/adult_attack2" + }, + { + "name": "antarchy:mob/jerry/adult_attack3" + } + ] } } diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack1.ogg new file mode 100644 index 00000000..4d089019 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack2.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack2.ogg new file mode 100644 index 00000000..332b90aa Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack2.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack3.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack3.ogg new file mode 100644 index 00000000..4d91a765 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_attack3.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death1.ogg new file mode 100644 index 00000000..5a6a336b Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death2.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death2.ogg new file mode 100644 index 00000000..465a4c07 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_death2.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_hurt1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_hurt1.ogg new file mode 100644 index 00000000..a14a5bcc Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_hurt1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle1.ogg new file mode 100644 index 00000000..50b72063 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle2.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle2.ogg new file mode 100644 index 00000000..0edab0b5 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle2.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle3.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle3.ogg new file mode 100644 index 00000000..31c62cec Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle3.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle4.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle4.ogg new file mode 100644 index 00000000..5a8a53c7 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/adult_idle4.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack1.ogg new file mode 100644 index 00000000..3aef7b21 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack2.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack2.ogg new file mode 100644 index 00000000..edff5df5 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_attack2.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_death1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_death1.ogg new file mode 100644 index 00000000..bbb2ef82 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_death1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_hurt1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_hurt1.ogg new file mode 100644 index 00000000..63e72099 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_hurt1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle1.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle1.ogg new file mode 100644 index 00000000..ed16b6a3 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle1.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle2.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle2.ogg new file mode 100644 index 00000000..08492c09 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle2.ogg differ diff --git a/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle3.ogg b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle3.ogg new file mode 100644 index 00000000..8d230a68 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/sounds/mob/jerry/young_idle3.ogg differ diff --git a/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png new file mode 100644 index 00000000..2307b613 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png.mcmeta b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png.mcmeta new file mode 100644 index 00000000..1fd02729 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_side.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 9 + } +} diff --git a/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png new file mode 100644 index 00000000..73985873 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png.mcmeta b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png.mcmeta new file mode 100644 index 00000000..1fd02729 --- /dev/null +++ b/common/src/main/resources/assets/antarchy/textures/block/unstable_ant_nest/unstable_ant_nest_top.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 9 + } +} diff --git a/common/src/main/resources/assets/antarchy/textures/entity/frog/frog_elythia.png b/common/src/main/resources/assets/antarchy/textures/entity/frog/frog_elythia.png index e5c4f394..25f9f839 100644 Binary files a/common/src/main/resources/assets/antarchy/textures/entity/frog/frog_elythia.png and b/common/src/main/resources/assets/antarchy/textures/entity/frog/frog_elythia.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/alpha_mantis.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/alpha_mantis.png new file mode 100644 index 00000000..092738fc Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/alpha_mantis.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/brutalfly.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/brutalfly.png new file mode 100644 index 00000000..df38548a Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/brutalfly.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_background.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_background.png new file mode 100644 index 00000000..2c5d01c6 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_background.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_progress.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_progress.png new file mode 100644 index 00000000..d29ee2ea Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/beetle_progress.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_background.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_background.png new file mode 100644 index 00000000..1816fe8b Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_background.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_progress.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_progress.png new file mode 100644 index 00000000..2c084740 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/blue_progress.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_background.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_background.png new file mode 100644 index 00000000..0c623a87 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_background.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_progress.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_progress.png new file mode 100644 index 00000000..2139e76f Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/brutalfly_progress.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_background.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_background.png new file mode 100644 index 00000000..c70c5402 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_background.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_progress.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_progress.png new file mode 100644 index 00000000..2f6aff89 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/green_progress.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_background.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_background.png new file mode 100644 index 00000000..9f2be61b Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_background.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_progress.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_progress.png new file mode 100644 index 00000000..54b993e4 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/healthbars/purple_progress.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/hercules_beetle.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/hercules_beetle.png new file mode 100644 index 00000000..ac9ce74c Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/hercules_beetle.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/kraken.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/kraken.png new file mode 100644 index 00000000..cbce9159 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/kraken.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/scorpion.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/scorpion.png new file mode 100644 index 00000000..3be621ba Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/scorpion.png differ diff --git a/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/toreterror.png b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/toreterror.png new file mode 100644 index 00000000..905e4f10 Binary files /dev/null and b/common/src/main/resources/assets/antarchy/textures/gui/boss_bars/toreterror.png differ diff --git a/common/src/main/resources/data/antarchy/loot_table/entities/alpha_mantis.json b/common/src/main/resources/data/antarchy/loot_table/entities/alpha_mantis.json index b8b41c39..851328fc 100644 --- a/common/src/main/resources/data/antarchy/loot_table/entities/alpha_mantis.json +++ b/common/src/main/resources/data/antarchy/loot_table/entities/alpha_mantis.json @@ -9,13 +9,18 @@ "name": "antarchy:mantis_claw" } ], + "conditions": [ + { + "condition": "minecraft:killed_by_player" + } + ], "functions": [ { "function": "minecraft:set_count", "count": { "type": "minecraft:uniform", - "min": 3.0, - "max": 4.0 + "min": 1.0, + "max": 2.0 } }, { @@ -24,7 +29,7 @@ "count": { "type": "minecraft:uniform", "min": 0.0, - "max": 2.0 + "max": 1.0 } } ] diff --git a/common/src/main/resources/data/antarchy/loot_table/entities/mantis.json b/common/src/main/resources/data/antarchy/loot_table/entities/mantis.json index 3e426059..b24b2ee3 100644 --- a/common/src/main/resources/data/antarchy/loot_table/entities/mantis.json +++ b/common/src/main/resources/data/antarchy/loot_table/entities/mantis.json @@ -12,6 +12,10 @@ "conditions": [ { "condition": "minecraft:killed_by_player" + }, + { + "condition": "minecraft:random_chance", + "chance": 0.35 } ], "functions": [ diff --git a/common/src/main/resources/data/antarchy/tags/block/biowart_tendrils_plantable.json b/common/src/main/resources/data/antarchy/tags/block/biowart_tendrils_plantable.json new file mode 100644 index 00000000..3629673d --- /dev/null +++ b/common/src/main/resources/data/antarchy/tags/block/biowart_tendrils_plantable.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:biomite_turf" + ] +} diff --git a/common/src/main/resources/data/antarchy/worldgen/biome/elythia_ocean.json b/common/src/main/resources/data/antarchy/worldgen/biome/elythia_ocean.json index 04189bf4..da6adc89 100644 --- a/common/src/main/resources/data/antarchy/worldgen/biome/elythia_ocean.json +++ b/common/src/main/resources/data/antarchy/worldgen/biome/elythia_ocean.json @@ -54,7 +54,6 @@ [ "minecraft:sea_pickle", "minecraft:warm_ocean_vegetation", - "antarchy:star_coral_patch", "minecraft:kelp_warm", "antarchy:giant_lily_pad_patch_common" ], diff --git a/common/src/main/resources/data/antarchy/worldgen/biome/lucid_pools.json b/common/src/main/resources/data/antarchy/worldgen/biome/lucid_pools.json index ff5ead29..2d2e9e65 100644 --- a/common/src/main/resources/data/antarchy/worldgen/biome/lucid_pools.json +++ b/common/src/main/resources/data/antarchy/worldgen/biome/lucid_pools.json @@ -32,7 +32,7 @@ "spawn_costs": { "antarchy:lucid": { "energy_budget": 0.10, - "charge": 10.0 + "charge": 15.0 } }, "features": [ diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json index cef0c67f..358a6bdf 100644 --- a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_titanium_ore.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:rarity_filter", - "chance": 6 + "chance": 2 }, { "type": "minecraft:in_square" diff --git a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json index ac0d13bd..b222410c 100644 --- a/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json +++ b/common/src/main/resources/data/antarchy/worldgen/placed_feature/broodstone_uranium_ore.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:rarity_filter", - "chance": 5 + "chance": 2 }, { "type": "minecraft:in_square" diff --git a/common/src/main/resources/data/minecraft/tags/block/coral_blocks.json b/common/src/main/resources/data/minecraft/tags/block/coral_blocks.json new file mode 100644 index 00000000..731c04f2 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/block/coral_blocks.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:star_coral_block" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/block/coral_plants.json b/common/src/main/resources/data/minecraft/tags/block/coral_plants.json new file mode 100644 index 00000000..964b717d --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/block/coral_plants.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:star_coral" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/block/corals.json b/common/src/main/resources/data/minecraft/tags/block/corals.json new file mode 100644 index 00000000..c806e535 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/block/corals.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:star_coral_fan" + ] +} diff --git a/common/src/main/resources/data/minecraft/tags/block/wall_corals.json b/common/src/main/resources/data/minecraft/tags/block/wall_corals.json new file mode 100644 index 00000000..a42a8397 --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/block/wall_corals.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "antarchy:star_coral_wall_fan" + ] +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java index 7faeb08a..be974c55 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabric.java @@ -137,14 +137,6 @@ public final class AntarchyFabric implements ModInitializer { Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "seashell_patch_rare") ); - private static final TagKey HAS_STAR_CORAL = TagKey.create( - Registries.BIOME, - ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "has_star_coral") - ); - private static final ResourceKey STAR_CORAL_PATCH = ResourceKey.create( - Registries.PLACED_FEATURE, - ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "star_coral_patch") - ); @Override public void onInitialize() { AntarchyFabricNetworking.register(); @@ -284,11 +276,6 @@ public final class AntarchyFabric implements ModInitializer { GenerationStep.Decoration.VEGETAL_DECORATION, SEASHELL_PATCH_RARE ); - BiomeModifications.addFeature( - BiomeSelectors.tag(HAS_STAR_CORAL), - GenerationStep.Decoration.VEGETAL_DECORATION, - STAR_CORAL_PATCH - ); BiomeModifications.addSpawn( BiomeSelectors.tag(APPLE_COW_SPAWN_BIOMES), net.minecraft.world.entity.MobCategory.CREATURE, diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricContent.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricContent.java index e527a004..1b3f2159 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricContent.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricContent.java @@ -274,7 +274,15 @@ public final class AntarchyFabricContent { AntarchyFabricSounds.BRUTALFLY_SPIT, AntarchyFabricSounds.ROLLY_POLLY_WHEEL_MODE, AntarchyFabricSounds.ROLLY_POLLY_NORMAL_MODE, - AntarchyFabricSounds.ROLLY_POLLY_ROLL + AntarchyFabricSounds.ROLLY_POLLY_ROLL, + AntarchyFabricSounds.JERRY_YOUNG_IDLE, + AntarchyFabricSounds.JERRY_YOUNG_HURT, + AntarchyFabricSounds.JERRY_YOUNG_DEATH, + AntarchyFabricSounds.JERRY_YOUNG_ATTACK, + AntarchyFabricSounds.JERRY_ADULT_IDLE, + AntarchyFabricSounds.JERRY_ADULT_HURT, + AntarchyFabricSounds.JERRY_ADULT_DEATH, + AntarchyFabricSounds.JERRY_ADULT_ATTACK ); AntarchyObjects.setOctopusBomb(AntarchyFabricEntities.OCTOPUS_BOMB); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java index cb196200..f0def78a 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/AntarchyFabricEvents.java @@ -8,7 +8,7 @@ import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.block.DuctTapeBlock; import com.craisinlord.antarchy.content.item.AttitudeAdjusterItem; import com.craisinlord.antarchy.content.item.AttitudeAdjusterSlamManager; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.entity.MissileSquidEntity; import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; @@ -26,10 +26,10 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.fabricmc.fabric.api.event.player.AttackEntityCallback; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.minecraft.server.level.ServerPlayer; -import com.craisinlord.antarchy.content.SquidzookaDispenseBehavior; -import com.craisinlord.antarchy.content.RpoLauncherDispenseBehavior; -import com.craisinlord.antarchy.content.SizeRayDispenseBehavior; -import com.craisinlord.antarchy.content.WaterCannonDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.SquidzookaDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.RpoLauncherDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.SizeRayDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.WaterCannonDispenseBehavior; import net.minecraft.world.level.block.ComposterBlock; import net.minecraft.world.level.block.DispenserBlock; import net.minecraft.core.BlockPos; @@ -245,7 +245,7 @@ public final class AntarchyFabricEvents { for (int y = min.getY(); y <= max.getY(); y++) { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); - if (PotentNyxiteBlock.isIchor(entity.level().getFluidState(cursor))) { + if (AntarchyFluidChecks.isIchor(entity.level().getFluidState(cursor))) { return true; } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java index 03b06feb..320d2335 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/AntarchyFabricClientBootstrap.java @@ -214,10 +214,10 @@ public final class AntarchyFabricClientBootstrap { AntarchyFabricMisc.ICHOR.get(), AntarchyFabricMisc.FLOWING_ICHOR.get(), new SimpleFluidRenderHandler( - ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "block/antiwater_still"), - ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "block/antiwater_flow"), + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "block/bile/bile_still"), + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "block/bile/bile_flowing"), ResourceLocation.withDefaultNamespace("block/water_overlay"), - 0xFF2A0306 + 0xFF3D0408 ) ); @@ -476,6 +476,7 @@ public final class AntarchyFabricClientBootstrap { JumpyBootsHudRenderer.render(guiGraphics); TriffidGooHudRenderer.render(guiGraphics); DorrieJumpHudRenderer.render(guiGraphics); + HerculesBeetleChargeHudRenderer.render(guiGraphics); }); WorldRenderEvents.AFTER_TRANSLUCENT.register(context -> { diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleChargeHudRenderer.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleChargeHudRenderer.java new file mode 100644 index 00000000..42eb0f77 --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleChargeHudRenderer.java @@ -0,0 +1,50 @@ +package com.craisinlord.antarchy.fabric.client; + +import com.craisinlord.antarchy.content.entity.HerculesBeetleEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.player.Player; + +public final class HerculesBeetleChargeHudRenderer { + private static final ResourceLocation CHARGE_BAR_BACKGROUND = + ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_background.png"); + private static final ResourceLocation CHARGE_BAR_PROGRESS = + ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_progress.png"); + private static final int BAR_WIDTH = 182; + private static final int BAR_HEIGHT = 5; + + private HerculesBeetleChargeHudRenderer() { + } + + public static void render(GuiGraphics guiGraphics) { + Minecraft mc = Minecraft.getInstance(); + Player player = mc.player; + if (player == null || mc.screen != null || player.isDeadOrDying()) { + return; + } + if (!(player.getVehicle() instanceof HerculesBeetleEntity beetle)) { + return; + } + + int charge = beetle.getMountedCharge(); + if (charge <= 0) { + return; + } + + int width = mc.getWindow().getGuiScaledWidth(); + int height = mc.getWindow().getGuiScaledHeight(); + int x0 = width / 2 - BAR_WIDTH / 2; + int y0 = height - 39; + float chargeRatio = Mth.clamp(charge / 100.0F, 0.0F, 1.0F); + int filledWidth = Mth.clamp((int) (chargeRatio * BAR_WIDTH), 0, BAR_WIDTH); + + guiGraphics.blit(CHARGE_BAR_BACKGROUND, x0, y0, 0, 0, BAR_WIDTH, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + if (filledWidth > 0) { + guiGraphics.setColor(1.0F, 0.78F, 0.2F, 0.45F + chargeRatio * 0.55F); + guiGraphics.blit(CHARGE_BAR_PROGRESS, x0, y0, 0, 0, filledWidth, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + guiGraphics.setColor(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleClientHandler.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleClientHandler.java index 53a34842..cfe07b58 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleClientHandler.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/client/HerculesBeetleClientHandler.java @@ -9,12 +9,9 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; public final class HerculesBeetleClientHandler { - private static final int MAX_CHARGE_TICKS = 40; - private static boolean wasPressingJump; private static boolean wasPressingAttack; private static boolean wasCharging; - private static int chargeTicks; private HerculesBeetleClientHandler() { } @@ -45,11 +42,8 @@ public final class HerculesBeetleClientHandler { wasPressingAttack = pressingAttack; boolean charging = AntarchyKeyBindings.isHerculesBeetleChargePressed(); - if (charging) { - chargeTicks = Math.min(chargeTicks + 1, MAX_CHARGE_TICKS); - } else if (wasCharging && chargeTicks > 0) { - ClientPlayNetworking.send(new HerculesBeetleMountedChargePayload(chargeTicks)); - chargeTicks = 0; + if (charging != wasCharging) { + ClientPlayNetworking.send(new HerculesBeetleMountedChargePayload(charging)); } wasCharging = charging; } @@ -61,6 +55,5 @@ public final class HerculesBeetleClientHandler { } wasPressingAttack = false; wasCharging = false; - chargeTicks = 0; } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterItemEntityMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterItemEntityMixin.java index 7355d77a..44148469 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterItemEntityMixin.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterItemEntityMixin.java @@ -1,6 +1,7 @@ package com.craisinlord.antarchy.fabric.mixin; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; +import com.craisinlord.antarchy.fabric.util.CustomFluidPhysicsChecks; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.level.material.FluidState; @@ -20,10 +21,12 @@ public abstract class AntiwaterItemEntityMixin { } Vec3 motion = entity.getDeltaMovement(); + Vec3 antiwaterFlow = CustomFluidPhysicsChecks.getAntiwaterFlow(entity); + Vec3 push = antiwaterFlow.lengthSqr() > 1.0E-6D ? antiwaterFlow.normalize().scale(0.02D) : Vec3.ZERO; entity.setDeltaMovement( - motion.x * 0.99D, - motion.y + (motion.y < 0.06D ? 5.0E-4D : 0.0D), - motion.z * 0.99D + motion.x * 0.99D + push.x, + motion.y * 0.8D + 0.025D + push.y, + motion.z * 0.99D + push.z ); } @@ -36,7 +39,7 @@ public abstract class AntiwaterItemEntityMixin { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterLivingEntityMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterLivingEntityMixin.java index b750f6df..b5229227 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterLivingEntityMixin.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/AntiwaterLivingEntityMixin.java @@ -1,10 +1,11 @@ package com.craisinlord.antarchy.fabric.mixin; import com.craisinlord.antarchy.content.AntarchyObjects; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi; import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection; import com.craisinlord.antarchy.content.gravity.AntarchyGravityRotationUtil; +import com.craisinlord.antarchy.fabric.util.CustomFluidPhysicsChecks; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.MoverType; @@ -32,6 +33,11 @@ public abstract class AntiwaterLivingEntityMixin { entity.move(MoverType.SELF, entity.getDeltaMovement()); Vec3 motion = entity.getDeltaMovement(); + double verticalInput = travelVector.y; + if (verticalInput == 0.0D && entity instanceof Player player) { + verticalInput = player.isShiftKeyDown() ? -1.0D : ((LivingEntityJumpingAccessor) entity).antarchy$isJumping() ? 1.0D : 0.0D; + } + if (entity.horizontalCollision && entity.onClimbable()) { motion = new Vec3(motion.x, 0.2D, motion.z); } @@ -43,9 +49,13 @@ public abstract class AntiwaterLivingEntityMixin { double drag = entity.isSwimming() ? 0.9D : 0.8D; worldMotion = worldMotion.scale(drag); + Vec3 antiwaterFlow = CustomFluidPhysicsChecks.getAntiwaterFlow(entity); + if (antiwaterFlow.lengthSqr() > 1.0E-6D) { + worldMotion = worldMotion.add(antiwaterFlow.normalize().scale(0.02D)); + } boolean flying = entity instanceof Player player && player.getAbilities().flying; if (!flying) { - worldMotion = worldMotion.add(0.0D, 0.005D, 0.0D); + worldMotion = worldMotion.add(0.0D, 0.005D + verticalInput * 0.04D, 0.0D); } entity.setDeltaMovement( @@ -89,7 +99,7 @@ public abstract class AntiwaterLivingEntityMixin { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/DreamSandMovementMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/DreamSandMovementMixin.java index 66f9f874..17c6896a 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/DreamSandMovementMixin.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/DreamSandMovementMixin.java @@ -23,14 +23,7 @@ public abstract class DreamSandMovementMixin { if (!AntarchySettings.dreamSandEnabled() || antarchy$isDreamSandLowGravityBlacklisted(self)) { access.antarchy$clearDreamSandLowGravity(); } else if (antarchy$isStandingOnDreamSand(self)) { - self.setDeltaMovement( - self.getDeltaMovement().x, - self.getDeltaMovement().y * AntarchySettings.dreamSandJumpVelocityMultiplier(), - self.getDeltaMovement().z - ); - access.antarchy$setDreamSandLowGravityActive(true); - access.antarchy$setDreamSandLowGravityTicksRemaining((int) Math.max(1L, Math.round(AntarchySettings.dreamSandEffectDurationSeconds() * 20.0D))); - access.antarchy$setDreamSandLandingGraceTicks(0); + antarchy$startDreamSandLowGravity(self, access); } } @@ -45,7 +38,17 @@ public abstract class DreamSandMovementMixin { access.antarchy$setDreamSandLandingGraceTicks(landingGraceTicks - 1); } - if (!AntarchySettings.dreamSandEnabled() || antarchy$isDreamSandLowGravityBlacklisted(self) || !access.antarchy$isDreamSandLowGravityActive()) { + if (!AntarchySettings.dreamSandEnabled() || antarchy$isDreamSandLowGravityBlacklisted(self)) { + return; + } + + if (!access.antarchy$isDreamSandLowGravityActive() + && !self.onGround() + && antarchy$isStandingOnDreamSand(self)) { + antarchy$startDreamSandLowGravity(self, access); + } + + if (!access.antarchy$isDreamSandLowGravityActive()) { return; } @@ -90,7 +93,18 @@ public abstract class DreamSandMovementMixin { } private static boolean antarchy$isStandingOnDreamSand(LivingEntity livingEntity) { - return livingEntity.level().getBlockState(livingEntity.getOnPosLegacy()).is(AntarchyFabricBlocks.DREAM_SAND.get()); + return livingEntity.getBlockStateOn().is(AntarchyFabricBlocks.DREAM_SAND.get()); + } + + private static void antarchy$startDreamSandLowGravity(LivingEntity self, DreamSandLowGravityAccess access) { + self.setDeltaMovement( + self.getDeltaMovement().x, + self.getDeltaMovement().y * AntarchySettings.dreamSandJumpVelocityMultiplier(), + self.getDeltaMovement().z + ); + access.antarchy$setDreamSandLowGravityActive(true); + access.antarchy$setDreamSandLowGravityTicksRemaining((int) Math.max(1L, Math.round(AntarchySettings.dreamSandEffectDurationSeconds() * 20.0D))); + access.antarchy$setDreamSandLandingGraceTicks(0); } private static boolean antarchy$isDreamSandLowGravityBlacklisted(LivingEntity livingEntity) { diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/LivingEntityJumpingAccessor.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/LivingEntityJumpingAccessor.java new file mode 100644 index 00000000..0414928c --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/LivingEntityJumpingAccessor.java @@ -0,0 +1,11 @@ +package com.craisinlord.antarchy.fabric.mixin; + +import net.minecraft.world.entity.LivingEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(LivingEntity.class) +public interface LivingEntityJumpingAccessor { + @Accessor("jumping") + boolean antarchy$isJumping(); +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidItemEntityMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidItemEntityMixin.java new file mode 100644 index 00000000..ef635f22 --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidItemEntityMixin.java @@ -0,0 +1,29 @@ +package com.craisinlord.antarchy.fabric.mixin; + +import com.craisinlord.antarchy.fabric.util.CustomFluidPhysicsChecks; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(value = ItemEntity.class, priority = 900) +public abstract class WaterlikeFluidItemEntityMixin { + @Inject(method = "tick", at = @At("TAIL")) + private void antarchy$applyWaterlikeFluidItemMovement(CallbackInfo ci) { + ItemEntity entity = (ItemEntity) (Object) this; + if (CustomFluidPhysicsChecks.isTouchingAntiwater(entity) || !CustomFluidPhysicsChecks.isTouchingWaterlikeFluid(entity)) { + return; + } + + Vec3 motion = entity.getDeltaMovement(); + Vec3 fluidFlow = CustomFluidPhysicsChecks.getWaterlikeFlow(entity); + Vec3 push = fluidFlow.lengthSqr() > 1.0E-6D ? fluidFlow.normalize().scale(0.03D) : Vec3.ZERO; + entity.setDeltaMovement( + motion.x * 0.99D + push.x, + motion.y + (motion.y < 0.06D ? 5.0E-4D : 0.0D) + push.y, + motion.z * 0.99D + push.z + ); + } +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidLivingEntityMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidLivingEntityMixin.java new file mode 100644 index 00000000..c87a514a --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/WaterlikeFluidLivingEntityMixin.java @@ -0,0 +1,64 @@ +package com.craisinlord.antarchy.fabric.mixin; + +import com.craisinlord.antarchy.fabric.util.CustomFluidPhysicsChecks; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.MoverType; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(value = LivingEntity.class, priority = 900) +public abstract class WaterlikeFluidLivingEntityMixin { + @Inject(method = "travel", at = @At("HEAD"), cancellable = true) + private void antarchy$moveInCustomWaterlikeFluid(Vec3 travelVector, CallbackInfo ci) { + LivingEntity entity = (LivingEntity) (Object) this; + if (CustomFluidPhysicsChecks.isTouchingAntiwater(entity) || !CustomFluidPhysicsChecks.isTouchingWaterlikeFluid(entity)) { + return; + } + + double prevY = entity.getY(); + float swimSpeed = entity.isSprinting() ? 0.024F : 0.02F; + entity.moveRelative(swimSpeed, travelVector); + entity.move(MoverType.SELF, entity.getDeltaMovement()); + + Vec3 motion = entity.getDeltaMovement(); + double verticalInput = travelVector.y; + if (verticalInput == 0.0D && entity instanceof Player player) { + verticalInput = player.isShiftKeyDown() ? -1.0D : ((LivingEntityJumpingAccessor) entity).antarchy$isJumping() ? 1.0D : 0.0D; + } + + if (entity.horizontalCollision && entity.onClimbable()) { + motion = new Vec3(motion.x, 0.2D, motion.z); + } + + boolean flying = entity instanceof Player player && player.getAbilities().flying; + double verticalDrift = verticalInput * 0.04D; + if (!flying) { + verticalDrift -= 0.004D; + } + + Vec3 nextMotion = new Vec3( + motion.x * 0.8D, + motion.y * 0.8D + verticalDrift, + motion.z * 0.8D + ); + Vec3 fluidFlow = CustomFluidPhysicsChecks.getWaterlikeFlow(entity); + if (fluidFlow.lengthSqr() > 1.0E-6D) { + nextMotion = nextMotion.add(fluidFlow.normalize().scale(0.014D)); + } + entity.setDeltaMovement(nextMotion); + + if (entity.horizontalCollision && entity.isFree( + nextMotion.x, + nextMotion.y + 0.6D - entity.getY() + prevY, + nextMotion.z + )) { + entity.setDeltaMovement(nextMotion.x, 0.3D, nextMotion.z); + } + + ci.cancel(); + } +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/AntiwaterFogMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/AntiwaterFogMixin.java deleted file mode 100644 index 06585ef6..00000000 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/AntiwaterFogMixin.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.craisinlord.antarchy.fabric.mixin.client; - -import com.craisinlord.antarchy.content.fluid.BileLiquidBlock; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.shaders.FogShape; -import net.minecraft.client.Camera; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.FogRenderer; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.material.FluidState; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(FogRenderer.class) -public abstract class AntiwaterFogMixin { - @Inject(method = "setupColor", at = @At("TAIL")) - private static void antarchy$overrideBileColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, CallbackInfo ci) { - if (!antarchy$isInBile(camera)) { - return; - } - - RenderSystem.clearColor(0.38F, 0.42F, 0.10F, 0.0F); - } - - @Inject(method = "setupFog", at = @At("TAIL")) - private static void antarchy$overrideBileFog(Camera camera, FogRenderer.FogMode mode, float renderDistance, boolean thickFog, float partialTick, CallbackInfo ci) { - if (!antarchy$isInBile(camera)) { - return; - } - - RenderSystem.setShaderFogStart(0.25F); - RenderSystem.setShaderFogEnd(Math.min(renderDistance, 4.0F)); - RenderSystem.setShaderFogShape(FogShape.CYLINDER); - } - - private static boolean antarchy$isInBile(Camera camera) { - Entity entity = camera.getEntity(); - if (entity == null || entity.level() == null) { - return false; - } - - BlockPos pos = BlockPos.containing(camera.getPosition()); - FluidState fluidState = entity.level().getFluidState(pos); - return BileLiquidBlock.isBile(fluidState); - } -} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/LiquidFogMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/LiquidFogMixin.java new file mode 100644 index 00000000..7080bafd --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/client/LiquidFogMixin.java @@ -0,0 +1,89 @@ +package com.craisinlord.antarchy.fabric.mixin.client; + +import com.craisinlord.antarchy.content.fluid.BileLiquidBlock; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.shaders.FogShape; +import net.minecraft.client.Camera; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.FogRenderer; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.material.FluidState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(FogRenderer.class) +public abstract class LiquidFogMixin { + private static final int FLUID_NONE = 0; + private static final int FLUID_BILE = 1; + private static final int FLUID_ANTIWATER = 2; + private static final int FLUID_ICHOR = 3; + private static final int FLUID_LUMEN = 4; + + @Inject(method = "setupColor", at = @At("TAIL")) + private static void antarchy$overrideBileColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, CallbackInfo ci) { + int fluidKind = antarchy$getFluidKind(camera); + if (fluidKind == FLUID_NONE) { + return; + } + + if (fluidKind == FLUID_BILE) { + RenderSystem.clearColor(0.52F, 0.58F, 0.08F, 0.0F); + } else if (fluidKind == FLUID_ANTIWATER) { + RenderSystem.clearColor(0.48F, 0.06F, 0.06F, 0.0F); + } else if (fluidKind == FLUID_ICHOR) { + RenderSystem.clearColor(0.18F, 0.01F, 0.02F, 0.0F); + } else if (fluidKind == FLUID_LUMEN) { + RenderSystem.clearColor(0.42F, 0.82F, 1.0F, 0.0F); + } + } + + @Inject(method = "setupFog", at = @At("TAIL")) + private static void antarchy$overrideBileFog(Camera camera, FogRenderer.FogMode mode, float renderDistance, boolean thickFog, float partialTick, CallbackInfo ci) { + int fluidKind = antarchy$getFluidKind(camera); + if (fluidKind == FLUID_NONE) { + return; + } + + if (fluidKind == FLUID_BILE) { + RenderSystem.setShaderFogStart(0.2F); + RenderSystem.setShaderFogEnd(Math.min(renderDistance, 4.5F)); + } else if (fluidKind == FLUID_ANTIWATER) { + RenderSystem.setShaderFogStart(0.18F); + RenderSystem.setShaderFogEnd(Math.min(renderDistance, 3.5F)); + } else if (fluidKind == FLUID_ICHOR) { + RenderSystem.setShaderFogStart(0.08F); + RenderSystem.setShaderFogEnd(Math.min(renderDistance, 2.25F)); + } else if (fluidKind == FLUID_LUMEN) { + RenderSystem.setShaderFogStart(0.3F); + RenderSystem.setShaderFogEnd(Math.min(renderDistance, 6.0F)); + } + RenderSystem.setShaderFogShape(FogShape.CYLINDER); + } + + private static int antarchy$getFluidKind(Camera camera) { + Entity entity = camera.getEntity(); + if (entity == null || entity.level() == null) { + return FLUID_NONE; + } + + BlockPos pos = BlockPos.containing(camera.getPosition()); + FluidState fluidState = entity.level().getFluidState(pos); + if (BileLiquidBlock.isBile(fluidState)) { + return FLUID_BILE; + } + if (AntarchyFluidChecks.isAntiwater(fluidState)) { + return FLUID_ANTIWATER; + } + if (AntarchyFluidChecks.isIchor(fluidState)) { + return FLUID_ICHOR; + } + if (AntarchyFluidChecks.isLumen(fluidState)) { + return FLUID_LUMEN; + } + return FLUID_NONE; + } +} diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/infinity/PortalCreatorMixin.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/infinity/PortalCreatorMixin.java index 1d55001f..cbebd3a4 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/infinity/PortalCreatorMixin.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/mixin/infinity/PortalCreatorMixin.java @@ -3,30 +3,29 @@ package com.craisinlord.antarchy.fabric.mixin.infinity; import com.craisinlord.antarchy.config.AntarchySettings; import net.minecraft.core.BlockPos; import net.minecraft.core.component.DataComponents; -import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.NetherPortalBlock; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(value = NetherPortalBlock.class, priority = 2000) -public abstract class PortalCreatorMixin { +import net.lerariemann.infinity.util.teleport.PortalCreator; +import net.minecraft.server.level.ServerLevel; + +@Mixin(PortalCreator.class) +public interface PortalCreatorMixin { @Inject( - method = "entityInside", + method = "tryCreatePortalFromItem(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/item/ItemEntity;)V", at = @At("HEAD"), cancellable = true ) - private void antarchy$blockInfinityBookActivation(BlockState state, Level level, BlockPos pos, Entity entity, CallbackInfo ci) { + private static void antarchy$blockInfinityBookActivation(ServerLevel level, BlockPos pos, ItemEntity itemEntity, CallbackInfo ci) { if (!AntarchySettings.disableInfinityBookPortalCreation()) { return; } - if (!(entity instanceof ItemEntity itemEntity) || itemEntity.isRemoved()) { + if (itemEntity.isRemoved()) { return; } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/network/AntarchyFabricNetworking.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/network/AntarchyFabricNetworking.java index 97b9de03..f478e3b4 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/network/AntarchyFabricNetworking.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/network/AntarchyFabricNetworking.java @@ -391,7 +391,11 @@ public final class AntarchyFabricNetworking { private static void handleHerculesBeetleMountedCharge(ServerPlayer player, HerculesBeetleMountedChargePayload payload) { if (player.getVehicle() instanceof HerculesBeetleEntity beetle) { - beetle.handleMountedCharge(player, payload.chargeTicks()); + if (payload.pressing()) { + beetle.startMountedCharge(player); + } else { + beetle.releaseMountedCharge(player); + } } } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java index 2602b2e7..dc6f5b10 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricCreativeModeTabs.java @@ -4,6 +4,7 @@ import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.compat.infinity.InfinityCompat; import com.craisinlord.antarchy.compat.infinity.InfinityCompatVersion; import com.craisinlord.antarchy.config.AntarchySettings; +import com.craisinlord.antarchy.content.CreativeTabContents; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.CreativeTabOrder; import com.craisinlord.antarchy.content.block.*; @@ -270,73 +271,17 @@ public final class AntarchyFabricCreativeModeTabs { private static void populateCreativeTab(CreativeModeTab.Output output) { - ArrayList sortedItems = new ArrayList<>(); - for (var holder : AntarchyFabricItems.ITEMS.getEntries()) { - Item item = holder.get(); - if (item != Items.AIR) { - sortedItems.add(item); - } - } - sortedItems.sort(CreativeTabOrder.COMPARATOR); - sortedItems.forEach(item -> { - if (item == AntarchyFabricItems.GLIMMER_BOTTLE.get()) { - addGlimmerBottleVariants(output); - } else { + CreativeTabContents.populateAntarchyTab(new CreativeTabContents.AntarchyTabOutput() { + @Override + public void accept(net.minecraft.world.level.ItemLike item) { output.accept(item); } + + @Override + public void accept(ItemStack stack) { + output.accept(stack); + } }); - addPotionVariants(output); - } - - - - private static void addGlimmerBottleVariants(CreativeModeTab.Output output) { - for (com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant variant : com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant.values()) { - output.accept(com.craisinlord.antarchy.content.item.GlimmerBottleItem.create(variant)); - } - } - - - - private static void addPotionVariants(CreativeModeTab.Output output) { - acceptPotionFamily(output, AntarchyFabricMisc.DREAD_POTION); - acceptPotionFamily(output, AntarchyFabricMisc.LONG_DREAD); - acceptPotionFamily(output, AntarchyFabricMisc.INVERSION); - acceptPotionFamily(output, AntarchyFabricMisc.LONG_INVERSION); - acceptPotionFamily(output, AntarchyFabricMisc.STINKY_POTION); - acceptPotionFamily(output, AntarchyFabricMisc.LONG_STINKY); - acceptPotionFamily(output, AntarchyFabricMisc.PARALYSIS); - acceptPotionFamily(output, AntarchyFabricMisc.LONG_PARALYSIS); - acceptPotionFamily(output, AntarchyFabricMisc.HASTE); - acceptPotionFamily(output, AntarchyFabricMisc.STRONG_HASTE); - acceptPotionFamily(output, AntarchyFabricMisc.SHRINKING); - acceptPotionFamily(output, AntarchyFabricMisc.STRONG_SHRINKING); - acceptPotionFamily(output, AntarchyFabricMisc.EXTREME_SHRINKING); - acceptPotionFamily(output, AntarchyFabricMisc.GROWING); - acceptPotionFamily(output, AntarchyFabricMisc.STRONG_GROWING); - acceptPotionFamily(output, AntarchyFabricMisc.EXTREME_GROWING); - } - - - - private static void acceptPotionFamily(CreativeModeTab.Output output, DeferredHolder potion) { - Holder holder = AntarchyFabricContent.potionHolder(potion); - output.accept(PotionContents.createItemStack(Items.POTION, holder)); - output.accept(PotionContents.createItemStack(Items.SPLASH_POTION, holder)); - output.accept(PotionContents.createItemStack(Items.LINGERING_POTION, holder)); - output.accept(PotionContents.createItemStack(Items.TIPPED_ARROW, holder)); - } - - - - private static int creativeTabGroup(Item item) { - return CreativeTabOrder.group(item); - } - - - - private static int creativeTabSubOrder(Item item) { - return CreativeTabOrder.subOrder(item); } diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java index 1c97fcb1..a0b0d800 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricItems.java @@ -105,6 +105,7 @@ import com.craisinlord.antarchy.fabric.item.AntimetalScaffoldingItem; import com.craisinlord.antarchy.content.item.CloudSharkFinSoupItem; import com.craisinlord.antarchy.content.item.CorneaEarItem; import com.craisinlord.antarchy.content.item.GravityGunItem; +import com.craisinlord.antarchy.content.item.MantisClawItem; import com.craisinlord.antarchy.content.item.MinersDreamItem; import com.craisinlord.antarchy.content.item.DuctTapeBlockItem; import com.craisinlord.antarchy.content.item.BrutalflyElytraItem; @@ -610,7 +611,8 @@ public final class AntarchyFabricItems { public static final DeferredItem DEAD_STAR_CORAL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.DEAD_STAR_CORAL); - public static final DeferredItem DEAD_STAR_CORAL_FAN_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.DEAD_STAR_CORAL_FAN); + public static final DeferredItem DEAD_STAR_CORAL_FAN_ITEM = ITEMS.register("dead_star_coral_fan", + () -> new StandingAndWallBlockItem(AntarchyFabricBlocks.DEAD_STAR_CORAL_FAN.get(), AntarchyFabricBlocks.DEAD_STAR_CORAL_WALL_FAN.get(), new Item.Properties(), Direction.UP)); public static final DeferredItem STAR_CORAL_BLOCK_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.STAR_CORAL_BLOCK); @@ -619,7 +621,8 @@ public final class AntarchyFabricItems { public static final DeferredItem STAR_CORAL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.STAR_CORAL); - public static final DeferredItem STAR_CORAL_FAN_ITEM = ITEMS.registerSimpleBlockItem(AntarchyFabricBlocks.STAR_CORAL_FAN); + public static final DeferredItem STAR_CORAL_FAN_ITEM = ITEMS.register("star_coral_fan", + () -> new StandingAndWallBlockItem(AntarchyFabricBlocks.STAR_CORAL_FAN.get(), AntarchyFabricBlocks.STAR_CORAL_WALL_FAN.get(), new Item.Properties(), Direction.UP)); public static final DeferredItem DUCT_TAPE_ITEM = ITEMS.register("duct_tape", @@ -872,7 +875,8 @@ public final class AntarchyFabricItems { )); - public static final DeferredItem MANTIS_CLAW = ITEMS.registerSimpleItem("mantis_claw", new Item.Properties().rarity(Rarity.UNCOMMON)); + public static final DeferredItem MANTIS_CLAW = ITEMS.register("mantis_claw", + () -> new MantisClawItem(Tiers.IRON, new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON))); public static final DeferredItem HERCULES_HORN = ITEMS.registerSimpleItem("hercules_horn", new Item.Properties().rarity(Rarity.UNCOMMON)); @@ -887,11 +891,12 @@ public final class AntarchyFabricItems { public static final DeferredItem CHITEN = ITEMS.registerSimpleItem("chiten", new Item.Properties().rarity(Rarity.UNCOMMON)); - public static final DeferredItem JERRY_NUCLEUS = ITEMS.registerSimpleItem("jerry_nucleus", new Item.Properties().rarity(Rarity.UNCOMMON) - .food(new FoodProperties.Builder() - .nutrition(2) - .saturationModifier(0.1F) - .build())); + public static final DeferredItem JERRY_NUCLEUS = ITEMS.register("jerry_nucleus", + () -> new com.craisinlord.antarchy.content.item.JerryNucleusItem(new Item.Properties().rarity(Rarity.UNCOMMON) + .food(new FoodProperties.Builder() + .nutrition(2) + .saturationModifier(0.1F) + .build()))); public static final DeferredItem CARAPACE = ITEMS.registerSimpleItem("carapace", new Item.Properties().rarity(Rarity.UNCOMMON)); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricMisc.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricMisc.java index ed57aaa0..a039eb50 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricMisc.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricMisc.java @@ -1,23 +1,8 @@ package com.craisinlord.antarchy.fabric.registry; import com.craisinlord.antarchy.Antarchy; -import com.craisinlord.antarchy.compat.infinity.InfinityCompat; -import com.craisinlord.antarchy.compat.infinity.InfinityCompatVersion; import com.craisinlord.antarchy.config.AntarchySettings; -import com.craisinlord.antarchy.content.AntarchyObjects; -import com.craisinlord.antarchy.content.CreativeTabOrder; -import com.craisinlord.antarchy.content.block.*; -import com.craisinlord.antarchy.content.AntarchySoundEvents; -import com.craisinlord.antarchy.content.item.BloodCrystalArmorItem; -import com.craisinlord.antarchy.content.item.BloodCrystalAppleItem; -import com.craisinlord.antarchy.content.item.BloodCrystalKatanaItem; -import com.craisinlord.antarchy.content.block.entity.AntNestBlockEntity; -import com.craisinlord.antarchy.content.block.entity.DreamCampfireBlockEntity; -import com.craisinlord.antarchy.content.block.entity.HushweedBlockEntity; -import com.craisinlord.antarchy.content.block.entity.PotentNyxiteBlockEntity; -import com.craisinlord.antarchy.content.block.entity.WaspNestBlockEntity; -import com.craisinlord.antarchy.content.fluid.BileLiquidBlock; -import com.craisinlord.antarchy.content.fluid.LumenLiquidBlock; +import com.craisinlord.antarchy.content.recipe.AmericanizeRecipe; import com.craisinlord.antarchy.content.worldgen.ants.BrownAntNestFeature; import com.craisinlord.antarchy.content.worldgen.ants.RainbowAntNestFeature; import com.craisinlord.antarchy.content.worldgen.ants.RedAntNestFeature; @@ -36,13 +21,6 @@ import com.craisinlord.antarchy.content.worldgen.thoraxis.AntiwaterSpringsFeatur import com.craisinlord.antarchy.content.worldgen.thoraxis.NyxiteSpikeFeature; import com.craisinlord.antarchy.content.worldgen.thoraxis.PotentNyxiteFeature; import com.craisinlord.antarchy.fabric.content.fluid.AntiwaterFluid; -import com.craisinlord.antarchy.fabric.content.fluid.AntiwaterLiquidBlock; -import com.craisinlord.antarchy.fabric.item.DeferredSpawnEggItem; -import com.craisinlord.antarchy.fabric.network.AntarchyFabricNetworking; -import com.craisinlord.antarchy.fabric.registry.DeferredBlock; -import com.craisinlord.antarchy.fabric.registry.DeferredHolder; -import com.craisinlord.antarchy.fabric.registry.DeferredItem; -import com.craisinlord.antarchy.fabric.registry.DeferredRegister; import com.craisinlord.antarchy.content.effect.DreadMobEffect; import com.craisinlord.antarchy.content.effect.GoopedMobEffect; import com.craisinlord.antarchy.content.effect.GrowthMobEffect; @@ -50,88 +28,6 @@ import com.craisinlord.antarchy.content.effect.InvertedMobEffect; import com.craisinlord.antarchy.content.effect.ParalyzedMobEffect; import com.craisinlord.antarchy.content.effect.ShrinkMobEffect; import com.craisinlord.antarchy.content.effect.StinkyMobEffect; -import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.AppleCow; -import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.EnchantedGoldenAppleCow; -import com.craisinlord.antarchy.content.entity.AppleCowEntityVariants.GoldenAppleCow; -import com.craisinlord.antarchy.content.entity.cloud_shark.CloudSharkEntity; -import com.craisinlord.antarchy.content.entity.BedBugEntity; -import com.craisinlord.antarchy.content.entity.ButterflyEntity; -import com.craisinlord.antarchy.content.entity.CaterpillarEntity; -import com.craisinlord.antarchy.content.entity.DiamondMinecartEntity; -import com.craisinlord.antarchy.content.entity.DrTrayaurusEntity; -import com.craisinlord.antarchy.content.entity.brutalfly.BrutalflyEntity; -import com.craisinlord.antarchy.content.entity.brutalfly.BrutalflyOrbEntity; -import com.craisinlord.antarchy.content.entity.EasterBunnyEntity; -import com.craisinlord.antarchy.content.entity.flying_squirrel.FlyingSquirrelEntity; -import com.craisinlord.antarchy.content.entity.ReverieEntity; -import com.craisinlord.antarchy.content.entity.MissileSquidEntity; -import com.craisinlord.antarchy.content.entity.lucid.LucidEntity; -import com.craisinlord.antarchy.content.entity.lucid.LucidBoltEntity; -import com.craisinlord.antarchy.content.entity.lucid.LucidEyeProjectileEntity; -import com.craisinlord.antarchy.content.entity.HushProjectileEntity; -import com.craisinlord.antarchy.content.entity.JumpyBugEntity; -import com.craisinlord.antarchy.content.entity.StinkBugEntity; -import com.craisinlord.antarchy.content.entity.OuranwoodBoatEntity; -import com.craisinlord.antarchy.content.entity.OuranwoodChestBoatEntity; -import com.craisinlord.antarchy.content.entity.AlphaMantisEntity; -import com.craisinlord.antarchy.content.entity.MantisEntity; -import com.craisinlord.antarchy.content.entity.RollyPollyEntity; -import com.craisinlord.antarchy.content.entity.basilisk.BasiliskEntity; -import com.craisinlord.antarchy.content.entity.EmperorScorpionEntity; -import com.craisinlord.antarchy.content.entity.ScorpionEntity; -import com.craisinlord.antarchy.content.item.LucidEyeItem; -import com.craisinlord.antarchy.content.item.LucidPearlItem; -import com.craisinlord.antarchy.content.entity.nightmare.NightmareEntity; -import com.craisinlord.antarchy.content.entity.ToreterrorEntity; -import com.craisinlord.antarchy.content.entity.WaterBombEntity; -import com.craisinlord.antarchy.content.item.PrimordialArmorItem; -import com.craisinlord.antarchy.content.item.WaterCannonItem; -import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity; -import com.craisinlord.antarchy.content.entity.OctopusBombEntity; -import com.craisinlord.antarchy.content.entity.MolevoreEntity; -import com.craisinlord.antarchy.content.entity.MolewormEntity; -import com.craisinlord.antarchy.content.entity.BomberEntity; -import com.craisinlord.antarchy.content.entity.SizeRayProjectileEntity; -import com.craisinlord.antarchy.content.entity.TriffidEntity; -import com.craisinlord.antarchy.content.entity.WaspEntity; -import com.craisinlord.antarchy.content.entity.ant.BaseAntEntity; -import com.craisinlord.antarchy.content.entity.ant.BrownAntEntity; -import com.craisinlord.antarchy.content.entity.ant.RainbowAntEntity; -import com.craisinlord.antarchy.content.entity.ant.RedAntEntity; -import com.craisinlord.antarchy.content.item.BattleAxeItem; -import com.craisinlord.antarchy.content.item.BasiliskDaggerItem; -import com.craisinlord.antarchy.content.item.BigBerthaItem; -import com.craisinlord.antarchy.content.item.AntimetalBlockItem; -import com.craisinlord.antarchy.fabric.item.AntimetalScaffoldingItem; -import com.craisinlord.antarchy.content.item.CloudSharkFinSoupItem; -import com.craisinlord.antarchy.content.item.CorneaEarItem; -import com.craisinlord.antarchy.content.item.GravityGunItem; -import com.craisinlord.antarchy.content.item.MinersDreamItem; -import com.craisinlord.antarchy.content.item.DuctTapeBlockItem; -import com.craisinlord.antarchy.content.item.BrutalflyElytraItem; -import com.craisinlord.antarchy.content.item.MobComingSoonTooltipItem; -import com.craisinlord.antarchy.content.item.MogglesItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimateAxeItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimateHoeItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimatePickaxeItem; -import com.craisinlord.antarchy.content.item.ultimate.UtlimateShovelItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimateSwordItem; -import com.craisinlord.antarchy.content.item.DiamondMinecartItem; -import com.craisinlord.antarchy.content.item.ReverieBottleItem; -import com.craisinlord.antarchy.content.item.ScorpionWhipItem; -import com.craisinlord.antarchy.content.item.ScorpionWhipTetherSync; -import com.craisinlord.antarchy.content.network.HerculesBeetleImpactShakeSync; -import com.craisinlord.antarchy.content.item.SizeRayItem; -import com.craisinlord.antarchy.content.item.SquidzookaItem; -import com.craisinlord.antarchy.content.item.SimpleToolTier; -import com.craisinlord.antarchy.content.item.ultimate.UltimateArmorItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimateBowItem; -import com.craisinlord.antarchy.content.item.ultimate.UltimateCrossbowItem; -import com.craisinlord.antarchy.content.item.NightmareArmorItem; -import com.craisinlord.antarchy.content.item.NightmareSwordItem; -import com.craisinlord.antarchy.content.item.OuranwoodBoatOnlyItem; -import com.craisinlord.antarchy.content.item.OuranwoodChestBoatItem; -import com.craisinlord.antarchy.content.item.RainbowSugarItem; import com.craisinlord.antarchy.content.worldgen.elythia.CoralSpikeFeature; import com.craisinlord.antarchy.content.worldgen.elythia.ElythiaBiomeSource; import com.craisinlord.antarchy.content.worldgen.elythia.ElythiaRiverCarveFunction; @@ -181,82 +77,36 @@ import com.craisinlord.antarchy.content.worldgen.thoraxis.ThoraxisSpikeConfigura import com.craisinlord.antarchy.content.worldgen.thoraxis.ThoraxisSpikeFeature; import com.craisinlord.antarchy.content.client.particle.InvertedGeyserBaseParticleOptions; import com.craisinlord.antarchy.content.client.particle.InvertedGeyserParticleOptions; -import com.craisinlord.antarchy.content.portal.PermanentPortalType; + import java.util.List; -import java.util.ArrayList; -import java.util.Comparator; + import com.mojang.serialization.MapCodec; -import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; -import net.fabricmc.fabric.api.registry.FabricBrewingRecipeRegistryBuilder; import net.minecraft.advancements.critereon.EntitySubPredicate; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; -import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.item.alchemy.Potion; -import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.tags.TagKey; import net.minecraft.world.damagesource.DamageType; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.ai.attributes.Attribute; -import net.minecraft.world.entity.ai.attributes.AttributeSupplier; -import net.minecraft.world.entity.ai.attributes.Attributes; -import net.minecraft.world.entity.animal.Cow; -import net.minecraft.world.entity.animal.Rabbit; -import net.minecraft.world.entity.SpawnPlacementTypes; -import net.minecraft.world.entity.SpawnPlacements; -import net.minecraft.world.entity.npc.Villager; -import net.minecraft.world.entity.monster.Monster; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.StandingAndWallBlockItem; -import net.minecraft.world.food.FoodProperties; -import net.minecraft.world.item.Tier; -import net.minecraft.world.item.Tiers; -import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.flag.FeatureFlags; -import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.SimpleParticleType; -import net.minecraft.util.valueproviders.UniformInt; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.AmethystClusterBlock; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.DropExperienceBlock; -import net.minecraft.world.level.block.GlowLichenBlock; -import net.minecraft.world.level.block.HorizontalDirectionalBlock; -import net.minecraft.world.level.block.LiquidBlock; -import net.minecraft.world.level.block.RotatedPillarBlock; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.VineBlock; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.biome.BiomeSource; import net.minecraft.world.level.levelgen.DensityFunction; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; -import net.minecraft.world.level.levelgen.Heightmap; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.item.context.BlockPlaceContext; -import net.minecraft.world.level.block.Mirror; -import net.minecraft.world.level.block.Rotation; import com.craisinlord.antarchy.fabric.AntarchyFabricContent; public final class AntarchyFabricMisc { @@ -350,8 +200,8 @@ public final class AntarchyFabricMisc { .build()); - public static final DeferredHolder, net.minecraft.world.item.crafting.RecipeSerializer> AMERICANIZE_SERIALIZER = - RECIPE_SERIALIZERS.register("americanize", () -> com.craisinlord.antarchy.content.AmericanizeRecipe.SERIALIZER); + public static final DeferredHolder, net.minecraft.world.item.crafting.RecipeSerializer> AMERICANIZE_SERIALIZER = + RECIPE_SERIALIZERS.register("americanize", () -> AmericanizeRecipe.SERIALIZER); public static final DeferredHolder ULTIMATE_ARMOR_MATERIAL = ARMOR_MATERIALS.register("ultimate", diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSounds.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSounds.java index ae94c7d8..1fce3bf4 100644 --- a/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSounds.java +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/registry/AntarchyFabricSounds.java @@ -641,6 +641,14 @@ public final class AntarchyFabricSounds { public static final DeferredHolder ROLLY_POLLY_WHEEL_MODE = registerSoundEvent("rolly_polly_wheel_mode"); public static final DeferredHolder ROLLY_POLLY_NORMAL_MODE = registerSoundEvent("rolly_polly_normal_mode"); public static final DeferredHolder ROLLY_POLLY_ROLL = registerSoundEvent("rolly_polly_roll"); + public static final DeferredHolder JERRY_YOUNG_IDLE = registerSoundEvent("jerry_young_idle"); + public static final DeferredHolder JERRY_YOUNG_HURT = registerSoundEvent("jerry_young_hurt"); + public static final DeferredHolder JERRY_YOUNG_DEATH = registerSoundEvent("jerry_young_death"); + public static final DeferredHolder JERRY_YOUNG_ATTACK = registerSoundEvent("jerry_young_attack"); + public static final DeferredHolder JERRY_ADULT_IDLE = registerSoundEvent("jerry_adult_idle"); + public static final DeferredHolder JERRY_ADULT_HURT = registerSoundEvent("jerry_adult_hurt"); + public static final DeferredHolder JERRY_ADULT_DEATH = registerSoundEvent("jerry_adult_death"); + public static final DeferredHolder JERRY_ADULT_ATTACK = registerSoundEvent("jerry_adult_attack"); public static final DeferredHolder CREEPING_HORROR_GROWL = registerSoundEvent("creeping_horror_growl"); diff --git a/fabric/src/main/java/com/craisinlord/antarchy/fabric/util/CustomFluidPhysicsChecks.java b/fabric/src/main/java/com/craisinlord/antarchy/fabric/util/CustomFluidPhysicsChecks.java new file mode 100644 index 00000000..e25839d3 --- /dev/null +++ b/fabric/src/main/java/com/craisinlord/antarchy/fabric/util/CustomFluidPhysicsChecks.java @@ -0,0 +1,91 @@ +package com.craisinlord.antarchy.fabric.util; + +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; + +public final class CustomFluidPhysicsChecks { + private CustomFluidPhysicsChecks() { + } + + public static boolean isTouchingAntiwater(Entity entity) { + AABB box = entity.getBoundingBox().inflate(0.05D); + BlockPos min = BlockPos.containing(box.minX, box.minY, box.minZ); + BlockPos max = BlockPos.containing(box.maxX, box.maxY, box.maxZ); + BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(); + for (int x = min.getX(); x <= max.getX(); x++) { + for (int y = min.getY(); y <= max.getY(); y++) { + for (int z = min.getZ(); z <= max.getZ(); z++) { + cursor.set(x, y, z); + FluidState fluidState = entity.level().getFluidState(cursor); + if (AntarchyFluidChecks.isAntiwater(fluidState)) { + return true; + } + } + } + } + return false; + } + + public static boolean isTouchingWaterlikeFluid(Entity entity) { + AABB box = entity.getBoundingBox().inflate(0.05D); + BlockPos min = BlockPos.containing(box.minX, box.minY, box.minZ); + BlockPos max = BlockPos.containing(box.maxX, box.maxY, box.maxZ); + BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(); + for (int x = min.getX(); x <= max.getX(); x++) { + for (int y = min.getY(); y <= max.getY(); y++) { + for (int z = min.getZ(); z <= max.getZ(); z++) { + cursor.set(x, y, z); + FluidState fluidState = entity.level().getFluidState(cursor); + if (AntarchyFluidChecks.usesWaterLikePhysics(fluidState)) { + return true; + } + } + } + } + return false; + } + + public static Vec3 getAntiwaterFlow(Entity entity) { + return getAverageFlow(entity, true); + } + + public static Vec3 getWaterlikeFlow(Entity entity) { + return getAverageFlow(entity, false); + } + + private static Vec3 getAverageFlow(Entity entity, boolean antiwater) { + AABB box = entity.getBoundingBox().inflate(0.05D); + BlockPos min = BlockPos.containing(box.minX, box.minY, box.minZ); + BlockPos max = BlockPos.containing(box.maxX, box.maxY, box.maxZ); + BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(); + Vec3 totalFlow = Vec3.ZERO; + int matches = 0; + for (int x = min.getX(); x <= max.getX(); x++) { + for (int y = min.getY(); y <= max.getY(); y++) { + for (int z = min.getZ(); z <= max.getZ(); z++) { + cursor.set(x, y, z); + FluidState fluidState = entity.level().getFluidState(cursor); + boolean matchesFluid = antiwater + ? AntarchyFluidChecks.isAntiwater(fluidState) + : AntarchyFluidChecks.usesWaterLikePhysics(fluidState); + if (!matchesFluid) { + continue; + } + + totalFlow = totalFlow.add(fluidState.getFlow(entity.level(), cursor)); + matches++; + } + } + } + + if (matches == 0 || totalFlow.lengthSqr() < 1.0E-6D) { + return Vec3.ZERO; + } + + return totalFlow.scale(1.0D / matches); + } +} diff --git a/fabric/src/main/resources/antarchy-fabric.mixins.json b/fabric/src/main/resources/antarchy-fabric.mixins.json index a40c15d4..2085e64c 100644 --- a/fabric/src/main/resources/antarchy-fabric.mixins.json +++ b/fabric/src/main/resources/antarchy-fabric.mixins.json @@ -6,6 +6,9 @@ "mixins": [ "AntiwaterLivingEntityMixin", "AntiwaterItemEntityMixin", + "LivingEntityJumpingAccessor", + "WaterlikeFluidLivingEntityMixin", + "WaterlikeFluidItemEntityMixin", "AntimetalInversionMixin", "AntimetalScaffoldingMixin", "ElytraStartFlyingMixin", @@ -25,7 +28,7 @@ "client.BrutalflyElytraExperienceBarMixin", "client.BloodglassChatOrderMixin", "client.DuctTapeInputMixin", - "client.AntiwaterFogMixin", + "client.LiquidFogMixin", "client.GravityGunMouseScrollMixin", "client.KeybindingConflictFixMixin", "client.CrossbowArmPoseMixin", diff --git a/fabric/src/main/resources/data/minecraft/tags/fluid/water.json b/fabric/src/main/resources/data/minecraft/tags/fluid/water.json index eef10539..86dde3df 100644 --- a/fabric/src/main/resources/data/minecraft/tags/fluid/water.json +++ b/fabric/src/main/resources/data/minecraft/tags/fluid/water.json @@ -1,10 +1,3 @@ { - "values": [ - "antarchy:ichor", - "antarchy:flowing_ichor", - "antarchy:lumen", - "antarchy:flowing_lumen", - "antarchy:bile", - "antarchy:flowing_bile" - ] + "values": [] } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java index df8cc612..c098d1d1 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/AntarchyNeoforge.java @@ -177,7 +177,15 @@ public class AntarchyNeoforge { AntarchyNeoforgeSounds.BRUTALFLY_SPIT, AntarchyNeoforgeSounds.ROLLY_POLLY_WHEEL_MODE, AntarchyNeoforgeSounds.ROLLY_POLLY_NORMAL_MODE, - AntarchyNeoforgeSounds.ROLLY_POLLY_ROLL + AntarchyNeoforgeSounds.ROLLY_POLLY_ROLL, + AntarchyNeoforgeSounds.JERRY_YOUNG_IDLE, + AntarchyNeoforgeSounds.JERRY_YOUNG_HURT, + AntarchyNeoforgeSounds.JERRY_YOUNG_DEATH, + AntarchyNeoforgeSounds.JERRY_YOUNG_ATTACK, + AntarchyNeoforgeSounds.JERRY_ADULT_IDLE, + AntarchyNeoforgeSounds.JERRY_ADULT_HURT, + AntarchyNeoforgeSounds.JERRY_ADULT_DEATH, + AntarchyNeoforgeSounds.JERRY_ADULT_ATTACK ); bindCommonObjects(); ScorpionWhipTetherSync.setSink((player, targetId) -> PacketDistributor.sendToPlayersTrackingEntityAndSelf( diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java index e6f4185e..15a3d345 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/AntarchyNeoForgeClient.java @@ -330,6 +330,10 @@ public final class AntarchyNeoForgeClient { ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "dorrie_jump"), (guiGraphics, partialTick) -> DorrieJumpHudRenderer.render(guiGraphics) ); + event.registerAboveAll( + ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "hercules_beetle_charge"), + (guiGraphics, partialTick) -> HerculesBeetleChargeHudRenderer.render(guiGraphics) + ); } @SubscribeEvent diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleChargeHudRenderer.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleChargeHudRenderer.java new file mode 100644 index 00000000..e2601cbb --- /dev/null +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleChargeHudRenderer.java @@ -0,0 +1,50 @@ +package com.craisinlord.antarchy.neoforge.client; + +import com.craisinlord.antarchy.content.entity.HerculesBeetleEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.player.Player; + +public final class HerculesBeetleChargeHudRenderer { + private static final ResourceLocation CHARGE_BAR_BACKGROUND = + ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_background.png"); + private static final ResourceLocation CHARGE_BAR_PROGRESS = + ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_progress.png"); + private static final int BAR_WIDTH = 182; + private static final int BAR_HEIGHT = 5; + + private HerculesBeetleChargeHudRenderer() { + } + + public static void render(GuiGraphics guiGraphics) { + Minecraft mc = Minecraft.getInstance(); + Player player = mc.player; + if (player == null || mc.screen != null || player.isDeadOrDying()) { + return; + } + if (!(player.getVehicle() instanceof HerculesBeetleEntity beetle)) { + return; + } + + int charge = beetle.getMountedCharge(); + if (charge <= 0) { + return; + } + + int width = mc.getWindow().getGuiScaledWidth(); + int height = mc.getWindow().getGuiScaledHeight(); + int x0 = width / 2 - BAR_WIDTH / 2; + int y0 = height - 39; + float chargeRatio = Mth.clamp(charge / 100.0F, 0.0F, 1.0F); + int filledWidth = Mth.clamp((int) (chargeRatio * BAR_WIDTH), 0, BAR_WIDTH); + + guiGraphics.blit(CHARGE_BAR_BACKGROUND, x0, y0, 0, 0, BAR_WIDTH, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + if (filledWidth > 0) { + guiGraphics.setColor(1.0F, 0.78F, 0.2F, 0.45F + chargeRatio * 0.55F); + guiGraphics.blit(CHARGE_BAR_PROGRESS, x0, y0, 0, 0, filledWidth, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT); + guiGraphics.setColor(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleClientHandler.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleClientHandler.java index 3d3d00f5..c48d3b0a 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleClientHandler.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/client/HerculesBeetleClientHandler.java @@ -18,12 +18,9 @@ import net.neoforged.neoforge.network.PacketDistributor; @EventBusSubscriber(modid = Antarchy.MODID, value = Dist.CLIENT) public final class HerculesBeetleClientHandler { - private static final int MAX_CHARGE_TICKS = 40; - private static boolean wasPressingJump; private static boolean wasPressingAttack; private static boolean wasCharging; - private static int chargeTicks; private HerculesBeetleClientHandler() { } @@ -59,11 +56,8 @@ public final class HerculesBeetleClientHandler { wasPressingAttack = pressingAttack; boolean charging = AntarchyKeyBindings.HERCULES_BEETLE_CHARGE.isDown(); - if (charging) { - chargeTicks = Math.min(chargeTicks + 1, MAX_CHARGE_TICKS); - } else if (wasCharging && chargeTicks > 0) { - PacketDistributor.sendToServer(new HerculesBeetleMountedChargePayload(chargeTicks)); - chargeTicks = 0; + if (charging != wasCharging) { + PacketDistributor.sendToServer(new HerculesBeetleMountedChargePayload(charging)); } wasCharging = charging; } @@ -75,6 +69,5 @@ public final class HerculesBeetleClientHandler { } wasPressingAttack = false; wasCharging = false; - chargeTicks = 0; } } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/network/HerculesBeetleNetworking.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/network/HerculesBeetleNetworking.java index 867cca1e..ad4716da 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/network/HerculesBeetleNetworking.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/network/HerculesBeetleNetworking.java @@ -62,7 +62,11 @@ public final class HerculesBeetleNetworking { return; } if (player.getVehicle() instanceof HerculesBeetleEntity beetle) { - beetle.handleMountedCharge(player, payload.chargeTicks()); + if (payload.pressing()) { + beetle.startMountedCharge(player); + } else { + beetle.releaseMountedCharge(player); + } } }); } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoForgeEvents.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoForgeEvents.java index 9c76dc97..a95724df 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoForgeEvents.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoForgeEvents.java @@ -4,9 +4,13 @@ import com.craisinlord.antarchy.Antarchy; import com.craisinlord.antarchy.config.AntarchySettings; import com.craisinlord.antarchy.content.AntarchyObjects; import com.craisinlord.antarchy.content.AntarchySoundEvents; -import com.craisinlord.antarchy.content.CustomBrewingRecipes; +import com.craisinlord.antarchy.content.recipe.CustomBrewingRecipes; import com.craisinlord.antarchy.content.block.DuctTapeBlock; -import com.craisinlord.antarchy.content.block.PotentNyxiteBlock; +import com.craisinlord.antarchy.content.dispenser.RpoLauncherDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.SizeRayDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.SquidzookaDispenseBehavior; +import com.craisinlord.antarchy.content.dispenser.WaterCannonDispenseBehavior; +import com.craisinlord.antarchy.content.fluid.AntarchyFluidChecks; import com.craisinlord.antarchy.content.bloodglass.BloodglassAccess; import com.craisinlord.antarchy.content.entity.*; import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity; @@ -1027,7 +1031,7 @@ public final class AntarchyNeoForgeEvents { for (int z = min.getZ(); z <= max.getZ(); z++) { cursor.set(x, y, z); FluidState fluidState = entity.level().getFluidState(cursor); - if (PotentNyxiteBlock.isAntiwater(fluidState)) { + if (AntarchyFluidChecks.isAntiwater(fluidState)) { return true; } } @@ -1225,11 +1229,11 @@ public final class AntarchyNeoForgeEvents { static void onCommonSetup(FMLCommonSetupEvent event) { BloodCrystalShardItem.SYNC_BLOODGLASS = AntarchyNeoForgeEvents::syncBloodglass; event.enqueueWork(() -> { - DispenserBlock.registerBehavior(AntarchyNeoforgeItems.SHRINK_RAY.get(), new com.craisinlord.antarchy.content.SizeRayDispenseBehavior()); - DispenserBlock.registerBehavior(AntarchyNeoforgeItems.GROWTH_RAY.get(), new com.craisinlord.antarchy.content.SizeRayDispenseBehavior()); - DispenserBlock.registerBehavior(AntarchyNeoforgeItems.SQUIDZOOKA.get(), new com.craisinlord.antarchy.content.SquidzookaDispenseBehavior()); - DispenserBlock.registerBehavior(AntarchyNeoforgeItems.RPO_LAUNCHER.get(), new com.craisinlord.antarchy.content.RpoLauncherDispenseBehavior()); - DispenserBlock.registerBehavior(AntarchyNeoforgeItems.WATER_CANNON.get(), new com.craisinlord.antarchy.content.WaterCannonDispenseBehavior()); + DispenserBlock.registerBehavior(AntarchyNeoforgeItems.SHRINK_RAY.get(), new SizeRayDispenseBehavior()); + DispenserBlock.registerBehavior(AntarchyNeoforgeItems.GROWTH_RAY.get(), new SizeRayDispenseBehavior()); + DispenserBlock.registerBehavior(AntarchyNeoforgeItems.SQUIDZOOKA.get(), new SquidzookaDispenseBehavior()); + DispenserBlock.registerBehavior(AntarchyNeoforgeItems.RPO_LAUNCHER.get(), new RpoLauncherDispenseBehavior()); + DispenserBlock.registerBehavior(AntarchyNeoforgeItems.WATER_CANNON.get(), new WaterCannonDispenseBehavior()); LucidEyeProjectileEntity.defaultItemSupplier = () -> AntarchyNeoforgeItems.LUCID_PEARL.get(); LucidEntity.invertedEffectSupplier = () -> AntarchyNeoforgeMisc.INVERTED; FluidInteractionRegistry.addInteraction( diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java index 9542860f..cbd85362 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeCreativeModeTabs.java @@ -1,12 +1,10 @@ package com.craisinlord.antarchy.neoforge.registry; import com.craisinlord.antarchy.Antarchy; -import com.craisinlord.antarchy.content.item.ultimate.UltimateGearHelper; +import com.craisinlord.antarchy.content.CreativeTabContents; import com.craisinlord.antarchy.content.CreativeTabOrder; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.world.item.*; -import net.minecraft.world.item.alchemy.PotionContents; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.registries.DeferredHolder; @@ -32,402 +30,35 @@ public class AntarchyNeoforgeCreativeModeTabs { static void buildCreativeTabs(BuildCreativeModeTabContentsEvent event) { if (event.getTabKey() == ANTARCHY_TAB.getKey()) { - java.util.ArrayList sortedItems = new java.util.ArrayList<>(); - for (var holder : AntarchyNeoforgeItems.ITEMS.getEntries()) { - Item item = holder.get(); - if (item != Items.AIR) sortedItems.add(item); - } - sortedItems.sort(CreativeTabOrder.COMPARATOR); - sortedItems.forEach(item -> { - if (item == AntarchyNeoforgeItems.GLIMMER_BOTTLE.get()) { - for (com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant variant : com.craisinlord.antarchy.content.entity.glimmer.GlimmerVariant.values()) { - event.accept(com.craisinlord.antarchy.content.item.GlimmerBottleItem.create(variant)); - } - } else { + CreativeTabContents.populateAntarchyTab(new CreativeTabContents.AntarchyTabOutput() { + @Override + public void accept(net.minecraft.world.level.ItemLike item) { event.accept(item); } + + @Override + public void accept(ItemStack stack) { + event.accept(stack); + } }); + return; } + CreativeTabContents.populateNeoForgeVanillaTab(event.getTabKey(), event.getParameters().holders(), + new CreativeTabContents.NeoForgeVanillaTabOutput() { + @Override + public void accept(net.minecraft.world.level.ItemLike item) { + event.accept(item); + } - if (event.getTabKey() == CreativeModeTabs.SPAWN_EGGS) { - event.accept(AntarchyNeoforgeItems.EASTER_BUNNY_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.FLYING_SQUIRREL_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.CATERPILLAR_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BUTTERFLY_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.REVERIE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BRUTALFLY_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.RED_ANT_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BROWN_ANT_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.RAINBOW_ANT_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.TERMITE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.MOLEWORM_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.MANTIS_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.ALPHA_MANTIS_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.ROLLY_POLLY_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.MOLEVORE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.TRIFFID_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.APPLE_COW_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.GOLDEN_APPLE_COW_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.ENCHANTED_GOLDEN_APPLE_COW_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.DR_TRAYAURUS_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.WASP_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BOMBER_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.JUMPY_BUG_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.SPIT_BUG_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.STINK_BUG_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.CLOUD_SHARK_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.KRAKEN_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.MISSILE_SQUID_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.OCTOPUS_BOMB_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BED_BUG_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.LUCID_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.SCORPION_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.BASILISK_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.EMPEROR_SCORPION_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.TORETERROR_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.CREEPING_HORROR_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.LURKING_TERROR_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.HERCULES_BEETLE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.JERRY_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.DORRIE_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_DEER_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.GLIMMER_SPAWN_EGG.get()); - event.accept(AntarchyNeoforgeItems.ELKA_SPAWN_EGG.get()); - } + @Override + public void accept(ItemStack stack) { + event.accept(stack); + } - if (event.getTabKey() == CreativeModeTabs.NATURAL_BLOCKS) { - event.accept(AntarchyNeoforgeItems.OURANWOOD_LEAVES_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_ACORN.get()); - event.accept(AntarchyNeoforgeItems.PEACH_LEAVES_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_SAPLING_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DUPLICATOR_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DUPLICATOR_SAPLING_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ORANGE_MILKWEED_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PINK_MILKWEED_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CAMELLIA_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SPIDER_LILY_ITEM.get()); - event.accept(AntarchyNeoforgeItems.LOTUS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.GIANT_LILY_PAD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SEASHELL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.HUSHWEED_ITEM.get()); - event.accept(AntarchyNeoforgeItems.AMBER_LICHEN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CREEPVINE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.HANGING_CREEPROOTS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOLTING_VINES_ITEM.get()); - event.accept(AntarchyNeoforgeItems.GLOWCAP_MUSHROOM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.GLOWCAP_MUSHROOM_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.INFESTED_ROOTED_DIRT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.INFESTED_COARSE_DIRT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TRIFFID_GOO_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BED_BUG_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CREEPING_HORROR_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.LURKING_TERROR_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.JUMPY_BUG_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SPIT_BUG_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.JERRY_EGG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.WASP_NEST_ITEM.get()); - event.accept(AntarchyNeoforgeItems.RED_ANT_NEST_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROWN_ANT_NEST_ITEM.get()); - event.accept(AntarchyNeoforgeItems.RAINBOW_ANT_NEST_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TERMITE_NEST_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DEEPSLATE_URANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DEEPSLATE_TITANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.LUMEN_FROGLIGHT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ROSEATE_FROGLIGHT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CORN_SEEDS.get()); - event.accept(AntarchyNeoforgeItems.STAR_CORAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STAR_CORAL_FAN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STAR_CORAL_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DEAD_STAR_CORAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DEAD_STAR_CORAL_FAN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DEAD_STAR_CORAL_BLOCK_ITEM.get()); - } - - if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) { - event.insertAfter(new ItemStack(Items.SHEARS), new ItemStack(AntarchyNeoforgeItems.DUCT_TAPE_ITEM.get()), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); - event.insertAfter(new ItemStack(Items.MINECART), new ItemStack(AntarchyNeoforgeItems.DIAMOND_MINECART_ITEM.get()), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); - event.accept(AntarchyNeoforgeItems.BILE_BUCKET.get()); - event.accept(AntarchyNeoforgeItems.ICHOR_BUCKET.get()); - event.accept(AntarchyNeoforgeItems.ANTIWATER_BUCKET.get()); - event.accept(AntarchyNeoforgeItems.LUMEN_BUCKET.get()); - event.accept(AntarchyNeoforgeItems.CLOUD_BUCKET.get()); - event.accept(AntarchyNeoforgeItems.REVERIE_BOTTLE.get()); - event.accept(AntarchyNeoforgeItems.GLIMMER_BOTTLE.get()); - event.accept(AntarchyNeoforgeItems.CRITTER_CAGE.get()); - event.accept(AntarchyNeoforgeItems.ULTIMATE_PICKAXE.get()); - event.accept(AntarchyNeoforgeItems.ULTIMATE_AXE.get()); - event.accept(AntarchyNeoforgeItems.ULTIMATE_SHOVEL.get()); - event.accept(AntarchyNeoforgeItems.ULTIMATE_HOE.get()); - } - - if (event.getTabKey() == CreativeModeTabs.INGREDIENTS) { - event.accept(AntarchyNeoforgeItems.RAW_URANIUM_SCRAP.get()); - event.accept(AntarchyNeoforgeItems.RAW_TITANIUM_SCRAP.get()); - event.accept(AntarchyNeoforgeItems.RAW_URANIUM.get()); - event.accept(AntarchyNeoforgeItems.RAW_TITANIUM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_NUGGET.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_NUGGET.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_INGOT.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_INGOT.get()); - event.accept(AntarchyNeoforgeItems.CLOUD_SHARK_FIN.get()); - event.accept(AntarchyNeoforgeItems.CLOUD_SHARK_FIN_SOUP.get()); - event.accept(AntarchyNeoforgeItems.BASILISK_FANG.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_SCALE.get()); - event.accept(AntarchyNeoforgeItems.MOLEVORE_NOSE.get()); - event.accept(AntarchyNeoforgeItems.MOLEWORM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MUD_PIE.get()); - event.accept(AntarchyNeoforgeItems.LUCID_EYE.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_SHARD.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_APPLE.get()); - event.accept(AntarchyNeoforgeItems.SPIRIT_APPLE.get()); - event.accept(AntarchyNeoforgeItems.MANTIS_CLAW.get()); - event.accept(AntarchyNeoforgeItems.HERCULES_HORN.get()); - event.accept(AntarchyNeoforgeItems.KING_SCALE.get()); - event.accept(AntarchyNeoforgeItems.QUEEN_SCALE.get()); - event.accept(AntarchyNeoforgeItems.CHITEN.get()); - event.accept(AntarchyNeoforgeItems.JERRY_NUCLEUS.get()); - event.accept(AntarchyNeoforgeItems.CARAPACE.get()); - event.accept(AntarchyNeoforgeItems.STINK_BUG.get()); - event.accept(AntarchyNeoforgeItems.BRUTALFLY_WING.get()); - event.accept(AntarchyNeoforgeItems.PRIMORDIAL_SCUTE.get()); - event.accept(AntarchyNeoforgeItems.TRIFFID_GOO.get()); - event.accept(AntarchyNeoforgeItems.VORTEX_EYE.get()); - event.accept(AntarchyNeoforgeItems.EMPEROR_SCORPION_STINGER.get()); - event.accept(AntarchyNeoforgeItems.KRAKEN_TOOTH.get()); - event.accept(AntarchyNeoforgeItems.KRAKEN_TENTACLE.get()); - event.accept(AntarchyNeoforgeItems.JUMPY_BUG_LEG.get()); - event.accept(AntarchyNeoforgeItems.CORNEA_EAR.get()); - event.accept(AntarchyNeoforgeItems.CORN.get()); - event.accept(AntarchyNeoforgeItems.HIGH_FRUCTOSE_CORN_SYRUP.get()); - event.accept(AntarchyNeoforgeItems.PEACH.get()); - event.accept(AntarchyNeoforgeItems.PEACH_PIE.get()); - event.accept(AntarchyNeoforgeItems.CORNBREAD.get()); - event.accept(AntarchyNeoforgeItems.POPCORN.get()); - event.accept(AntarchyNeoforgeItems.RAW_CORNDOG.get()); - event.accept(AntarchyNeoforgeItems.COOKED_CORNDOG.get()); - event.accept(AntarchyNeoforgeItems.RAW_VENISON.get()); - event.accept(AntarchyNeoforgeItems.COOKED_VENISON.get()); - event.accept(AntarchyNeoforgeItems.RAW_BUG_MEAT.get()); - event.accept(AntarchyNeoforgeItems.COOKED_BUG_MEAT.get()); - event.accept(AntarchyNeoforgeItems.BROODFRUIT.get()); - event.accept(AntarchyNeoforgeItems.CHEEP_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ROOT_BEER.get()); - event.accept(AntarchyNeoforgeItems.RAINBOW_SUGAR.get()); - event.accept(AntarchyNeoforgeItems.BIG_BERTHA_BLADE.get()); - event.accept(AntarchyNeoforgeItems.BIG_BERTHA_HANDLE.get()); - event.accept(AntarchyNeoforgeItems.BIG_BERTHA_HILT.get()); - } - - if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS) { - event.accept(AntarchyNeoforgeItems.OURANWOOD_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_WOOD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_OURANWOOD_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_OURANWOOD_WOOD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STRIPPED_OURANWOOD_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STRIPPED_OURANWOOD_WOOD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_PLANKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_FENCE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_FENCE_GATE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_BOAT.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_CHEST_BOAT.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_DOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_TRAPDOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_PRESSURE_PLATE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_BUTTON_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_SIGN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.OURANWOOD_HANGING_SIGN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_WOOD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STRIPPED_PEACH_LOG_ITEM.get()); - event.accept(AntarchyNeoforgeItems.STRIPPED_PEACH_WOOD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_PLANKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_FENCE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_FENCE_GATE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_BOAT.get()); - event.accept(AntarchyNeoforgeItems.PEACH_CHEST_BOAT.get()); - event.accept(AntarchyNeoforgeItems.PEACH_DOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_TRAPDOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_PRESSURE_PLATE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_BUTTON_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_SIGN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PEACH_HANGING_SIGN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_SHELLSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_SHELLSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_SHELLSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_SHELLSTONE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_BRICKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_BRICK_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_BRICK_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SHELLSTONE_BRICK_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_SHELLSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_SHELLSTONE_BRICKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_SHELLSTONE_BRICK_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_SHELLSTONE_BRICK_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MOSSY_SHELLSTONE_BRICK_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CRACKED_SHELLSTONE_BRICKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BLUSH_MOSS_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BLUSH_MOSS_CARPET_ITEM.get()); - event.accept(AntarchyNeoforgeItems.LUMEN_FROGLIGHT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ROSEATE_FROGLIGHT_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_NYXITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_NYXITE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_NYXITE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_NYXITE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_BRICKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_BRICK_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_BRICK_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_BRICK_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_NYXITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.PALE_NYXITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.NYXITE_SPIKE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POTENT_NYXITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ANTIMETAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_ANTIMETAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.ANTIMETAL_SCAFFOLDING_ITEM.get()); - event.accept(AntarchyNeoforgeItems.UMBRAL_MOSS_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.UMBRAL_MOSS_CARPET_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_TORCH_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_LANTERN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_CAMPFIRE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_SAND_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_SANDSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_DREAM_SANDSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_DREAM_SANDSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SMOOTH_DREAM_SANDSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_SANDSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_SANDSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.DREAM_SANDSTONE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SMOOTH_DREAM_SANDSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SMOOTH_DREAM_SANDSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_DREAM_SANDSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BUDDING_BLOOD_CRYSTAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_CRYSTAL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.SMALL_BLOOD_CRYSTAL_BUD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MEDIUM_BLOOD_CRYSTAL_BUD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.LARGE_BLOOD_CRYSTAL_BUD_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MYRMITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BIOMITE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BIOMITE_TURF_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BIOWART_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BIOWART_TENDRILS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_BROODSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_BROODSTONE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_BRICKS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_BROODSTONE_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_BROODSTONE_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.POLISHED_BROODSTONE_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_BRICK_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_BRICK_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_BRICK_WALL_ITEM.get()); - event.accept(AntarchyNeoforgeItems.MYRMITE_COAL_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_URANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BROODSTONE_TITANIUM_ORE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.BILE_VEIN_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHITEN_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHITEN_SPIKE_ITEM.get()); - event.accept(AntarchyNeoforgeItems.AMBER_MOSS_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.AMBER_MOSS_CARPET_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.RAW_URANIUM_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_URANIUM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_URANIUM_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_URANIUM_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_URANIUM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_DOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_TRAPDOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_BARS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.URANIUM_BULB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.RAW_TITANIUM_BLOCK_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_TITANIUM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_TITANIUM_STAIRS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CUT_TITANIUM_SLAB_ITEM.get()); - event.accept(AntarchyNeoforgeItems.CHISELED_TITANIUM_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_DOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_TRAPDOOR_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_BARS_ITEM.get()); - event.accept(AntarchyNeoforgeItems.TITANIUM_BULB_ITEM.get()); - } - - if (event.getTabKey() == CreativeModeTabs.COMBAT) { - event.accept(AntarchyNeoforgeItems.BATTLE_AXE.get()); - event.accept(AntarchyNeoforgeItems.BIG_BERTHA.get()); - event.accept(AntarchyNeoforgeItems.BASILISK_DAGGER.get()); - event.accept(UltimateGearHelper.createUltimateArmorStack(AntarchyNeoforgeItems.ULTIMATE_HELMET.get(), event.getParameters().holders())); - event.accept(UltimateGearHelper.createUltimateArmorStack(AntarchyNeoforgeItems.ULTIMATE_CHESTPLATE.get(), event.getParameters().holders())); - event.accept(UltimateGearHelper.createUltimateArmorStack(AntarchyNeoforgeItems.ULTIMATE_LEGGINGS.get(), event.getParameters().holders())); - event.accept(UltimateGearHelper.createUltimateArmorStack(AntarchyNeoforgeItems.ULTIMATE_BOOTS.get(), event.getParameters().holders())); - event.accept(AntarchyNeoforgeItems.ULTIMATE_SWORD.get()); - event.accept(UltimateGearHelper.createUltimateBowStack(AntarchyNeoforgeItems.ULTIMATE_BOW.get(), event.getParameters().holders())); - event.accept(AntarchyNeoforgeItems.ULTIMATE_CROSSBOW.get()); - event.accept(AntarchyNeoforgeItems.SQUIDZOOKA.get()); - event.accept(AntarchyNeoforgeItems.RPO_LAUNCHER.get()); - event.accept(AntarchyNeoforgeItems.KRAKENS_GRASP.get()); - event.accept(AntarchyNeoforgeItems.SHRINK_RAY.get()); - event.accept(AntarchyNeoforgeItems.GROWTH_RAY.get()); - event.accept(AntarchyNeoforgeItems.GRAVITY_GUN.get()); - event.accept(AntarchyNeoforgeItems.WATER_CANNON.get()); - event.accept(AntarchyNeoforgeItems.ATTITUDE_ADJUSTER.get()); - event.accept(AntarchyNeoforgeItems.LUCID_PEARL.get()); - event.accept(AntarchyNeoforgeItems.PRIMORDIAL_HELMET.get()); - event.accept(AntarchyNeoforgeItems.PRIMORDIAL_CHESTPLATE.get()); - event.accept(AntarchyNeoforgeItems.PRIMORDIAL_LEGGINGS.get()); - event.accept(AntarchyNeoforgeItems.PRIMORDIAL_BOOTS.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_HELMET.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_CHESTPLATE.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_LEGGINGS.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_BOOTS.get()); - event.accept(AntarchyNeoforgeItems.NIGHTMARE_SWORD.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_KATANA.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_HELMET.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_CHESTPLATE.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_LEGGINGS.get()); - event.accept(AntarchyNeoforgeItems.BLOOD_CRYSTAL_BOOTS.get()); - event.accept(AntarchyNeoforgeItems.MOGGLES.get()); - event.accept(AntarchyNeoforgeItems.SCORPION_WHIP.get()); - event.accept(AntarchyNeoforgeItems.FALLEN_KING_CROWN.get()); - event.accept(AntarchyNeoforgeItems.BRUTALFLY_ELYTRA.get()); - event.accept(AntarchyNeoforgeItems.JUMPY_BOOTS.get()); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.SHRINKING)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.STRONG_SHRINKING)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.EXTREME_SHRINKING)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.PARALYSIS)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.LONG_PARALYSIS)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.STINKY_POTION)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.LONG_STINKY)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.HASTE)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.STRONG_HASTE)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.GROWING)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.STRONG_GROWING)); - event.accept(PotionContents.createItemStack(Items.POTION, AntarchyNeoforgeMisc.EXTREME_GROWING)); - } - } - - private static int creativeTabGroup(net.minecraft.world.item.Item item) { - return CreativeTabOrder.group(item); - } - - private static int creativeTabSubOrder(net.minecraft.world.item.Item item) { - return CreativeTabOrder.subOrder(item); + @Override + public void insertAfter(net.minecraft.world.level.ItemLike anchor, net.minecraft.world.level.ItemLike item) { + event.insertAfter(new ItemStack(anchor), new ItemStack(item), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS); + } + }); } } diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java index d49f8d61..65b1abd2 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeItems.java @@ -287,10 +287,12 @@ public final class AntarchyNeoforgeItems { public static final DeferredItem CUT_DREAM_SANDSTONE_SLAB_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.CUT_DREAM_SANDSTONE_SLAB); public static final DeferredItem DEAD_STAR_CORAL_BLOCK_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.DEAD_STAR_CORAL_BLOCK); public static final DeferredItem DEAD_STAR_CORAL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.DEAD_STAR_CORAL); - public static final DeferredItem DEAD_STAR_CORAL_FAN_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.DEAD_STAR_CORAL_FAN); + public static final DeferredItem DEAD_STAR_CORAL_FAN_ITEM = ITEMS.register("dead_star_coral_fan", + () -> new StandingAndWallBlockItem(AntarchyNeoforgeBlocks.DEAD_STAR_CORAL_FAN.get(), AntarchyNeoforgeBlocks.DEAD_STAR_CORAL_WALL_FAN.get(), new Item.Properties(), net.minecraft.core.Direction.UP)); public static final DeferredItem STAR_CORAL_BLOCK_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.STAR_CORAL_BLOCK); public static final DeferredItem STAR_CORAL_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.STAR_CORAL); - public static final DeferredItem STAR_CORAL_FAN_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.STAR_CORAL_FAN); + public static final DeferredItem STAR_CORAL_FAN_ITEM = ITEMS.register("star_coral_fan", + () -> new StandingAndWallBlockItem(AntarchyNeoforgeBlocks.STAR_CORAL_FAN.get(), AntarchyNeoforgeBlocks.STAR_CORAL_WALL_FAN.get(), new Item.Properties(), net.minecraft.core.Direction.UP)); public static final DeferredItem DUCT_TAPE_ITEM = ITEMS.register("duct_tape", () -> new DuctTapeBlockItem(AntarchyNeoforgeBlocks.DUCT_TAPE.get(), new Item.Properties().stacksTo(1))); public static final DeferredItem INFESTED_ROOTED_DIRT_ITEM = ITEMS.registerSimpleBlockItem(AntarchyNeoforgeBlocks.INFESTED_ROOTED_DIRT); @@ -419,18 +421,20 @@ public final class AntarchyNeoforgeItems { AntarchySettings.bloodCrystalKatanaAttackDamage(), -2.2F )); - public static final DeferredItem MANTIS_CLAW = ITEMS.registerSimpleItem("mantis_claw", new Item.Properties().rarity(Rarity.UNCOMMON)); + public static final DeferredItem MANTIS_CLAW = ITEMS.register("mantis_claw", + () -> new MantisClawItem(Tiers.IRON, new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON))); public static final DeferredItem HERCULES_HORN = ITEMS.registerSimpleItem("hercules_horn", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem KING_SCALE = ITEMS.register("king_scale", () -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.RARE))); public static final DeferredItem QUEEN_SCALE = ITEMS.register("queen_scale", () -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.RARE))); public static final DeferredItem CHITEN = ITEMS.registerSimpleItem("chiten", new Item.Properties().rarity(Rarity.UNCOMMON)); - public static final DeferredItem JERRY_NUCLEUS = ITEMS.registerSimpleItem("jerry_nucleus", new Item.Properties().rarity(Rarity.UNCOMMON) - .food(new FoodProperties.Builder() - .nutrition(2) - .saturationModifier(0.1F) - .build())); + public static final DeferredItem JERRY_NUCLEUS = ITEMS.register("jerry_nucleus", + () -> new com.craisinlord.antarchy.content.item.JerryNucleusItem(new Item.Properties().rarity(Rarity.UNCOMMON) + .food(new FoodProperties.Builder() + .nutrition(2) + .saturationModifier(0.1F) + .build()))); public static final DeferredItem CARAPACE = ITEMS.registerSimpleItem("carapace", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem STINK_BUG = ITEMS.registerSimpleItem("stink_bug", new Item.Properties().rarity(Rarity.UNCOMMON)); public static final DeferredItem JUMPY_BUG_LEG = ITEMS.registerSimpleItem("jumpy_bug_leg", new Item.Properties().rarity(Rarity.UNCOMMON)); diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeMisc.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeMisc.java index ddd30c69..77cd39fa 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeMisc.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeMisc.java @@ -10,6 +10,7 @@ import com.craisinlord.antarchy.content.effect.InvertedMobEffect; import com.craisinlord.antarchy.content.effect.ParalyzedMobEffect; import com.craisinlord.antarchy.content.effect.ShrinkMobEffect; import com.craisinlord.antarchy.content.effect.StinkyMobEffect; +import com.craisinlord.antarchy.content.recipe.AmericanizeRecipe; import com.craisinlord.antarchy.content.worldgen.ants.BrownAntNestFeature; import com.craisinlord.antarchy.content.worldgen.ants.RainbowAntNestFeature; import com.craisinlord.antarchy.content.worldgen.ants.RedAntNestFeature; @@ -29,7 +30,6 @@ import com.craisinlord.antarchy.neoforge.worldgen.CornPatchFeature; import com.craisinlord.antarchy.neoforge.worldgen.LumenLilyPadFeature; import com.craisinlord.antarchy.content.worldgen.thoraxis.*; import com.craisinlord.antarchy.neoforge.content.fluid.AntiwaterFluid; -import com.craisinlord.antarchy.neoforge.content.fluid.AntiwaterFluidType; import com.mojang.serialization.MapCodec; import net.minecraft.advancements.critereon.EntitySubPredicate; import net.minecraft.core.particles.ParticleType; @@ -50,13 +50,11 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; import net.minecraft.world.level.material.Fluid; import net.neoforged.bus.api.IEventBus; -import net.neoforged.neoforge.common.SoundActions; import net.neoforged.neoforge.fluids.BaseFlowingFluid; import net.neoforged.neoforge.fluids.FluidType; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.NeoForgeRegistries; -import net.minecraft.sounds.SoundEvents; import java.util.function.Function; @@ -107,8 +105,8 @@ public final class AntarchyNeoforgeMisc { .persistent(com.mojang.serialization.Codec.INT) .networkSynchronized(net.minecraft.network.codec.ByteBufCodecs.INT) .build()); - public static final DeferredHolder, net.minecraft.world.item.crafting.RecipeSerializer> AMERICANIZE_SERIALIZER = - RECIPE_SERIALIZERS.register("americanize", () -> com.craisinlord.antarchy.content.AmericanizeRecipe.SERIALIZER); + public static final DeferredHolder, net.minecraft.world.item.crafting.RecipeSerializer> AMERICANIZE_SERIALIZER = + RECIPE_SERIALIZERS.register("americanize", () -> AmericanizeRecipe.SERIALIZER); public static final DeferredHolder DOUBLE_DAMAGE_CHANCE = ATTRIBUTES.register( "double_damage_chance", diff --git a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSounds.java b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSounds.java index 6614e6c6..2ac56120 100644 --- a/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSounds.java +++ b/neoforge/src/main/java/com/craisinlord/antarchy/neoforge/registry/AntarchyNeoforgeSounds.java @@ -161,6 +161,14 @@ public final class AntarchyNeoforgeSounds { public static final DeferredHolder SPIT_BUG_HURT = registerSoundEvent("spit_bug_hurt"); public static final DeferredHolder SPIT_BUG_SPIT = registerSoundEvent("spit_bug_spit"); public static final DeferredHolder BRUTALFLY_SPIT = registerSoundEvent("brutalfly_spit"); + public static final DeferredHolder JERRY_YOUNG_IDLE = registerSoundEvent("jerry_young_idle"); + public static final DeferredHolder JERRY_YOUNG_HURT = registerSoundEvent("jerry_young_hurt"); + public static final DeferredHolder JERRY_YOUNG_DEATH = registerSoundEvent("jerry_young_death"); + public static final DeferredHolder JERRY_YOUNG_ATTACK = registerSoundEvent("jerry_young_attack"); + public static final DeferredHolder JERRY_ADULT_IDLE = registerSoundEvent("jerry_adult_idle"); + public static final DeferredHolder JERRY_ADULT_HURT = registerSoundEvent("jerry_adult_hurt"); + public static final DeferredHolder JERRY_ADULT_DEATH = registerSoundEvent("jerry_adult_death"); + public static final DeferredHolder JERRY_ADULT_ATTACK = registerSoundEvent("jerry_adult_attack"); public static final DeferredHolder DUCT_TAPE_USE = registerSoundEvent("duct_tape_use"); public static final DeferredHolder POTENT_NYXITE_HYPNOTIC_GAS = registerSoundEvent("potent_nyxite_hypnotic_gas"); public static final DeferredHolder POTENT_NYXITE_GEYSER_ERUPTION_START = registerSoundEvent("potent_nyxite_geyser_eruption_start"); diff --git a/neoforge/src/main/resources/data/antarchy/neoforge/biome_modifier/star_coral_in_oceans.json b/neoforge/src/main/resources/data/antarchy/neoforge/biome_modifier/star_coral_in_oceans.json deleted file mode 100644 index 281f4a35..00000000 --- a/neoforge/src/main/resources/data/antarchy/neoforge/biome_modifier/star_coral_in_oceans.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "neoforge:add_features", - "biomes": "#antarchy:has_star_coral", - "features": ["antarchy:star_coral_patch"], - "step": "vegetal_decoration" -}