diff --git a/gradle.properties b/gradle.properties index 05637a4c..6cb32bc9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,7 @@ mod_name=Hibernal Herbs # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=MIT # The mod version. See https://semver.org/ -mod_version=1.4 +mod_version=1.4.1 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/net/dakotapride/hibernalherbs/HibernalHerbsMod.java b/src/main/java/net/dakotapride/hibernalherbs/HibernalHerbsMod.java index 43e71f42..065dcd9d 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/HibernalHerbsMod.java +++ b/src/main/java/net/dakotapride/hibernalherbs/HibernalHerbsMod.java @@ -5,22 +5,37 @@ import net.dakotapride.hibernalherbs.init.enum_registry.*; import net.dakotapride.hibernalherbs.init.enum_registry.tag.Tags; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.alchemy.PotionBrewing; +import net.minecraft.world.item.alchemy.Potions; +import net.minecraft.world.level.storage.loot.BuiltInLootTables; +import net.minecraft.world.level.storage.loot.LootPool; +import net.minecraft.world.level.storage.loot.LootTable; +import net.minecraft.world.level.storage.loot.entries.LootItem; +import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction; +import net.minecraft.world.level.storage.loot.functions.SetPotionFunction; +import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition; +import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.LootTableLoadEvent; +import net.neoforged.neoforge.event.brewing.RegisterBrewingRecipesEvent; import net.neoforged.neoforge.event.server.ServerStartingEvent; import org.slf4j.Logger; +import java.util.List; + // The value here should match an entry in the META-INF/neoforge.mods.toml file @Mod(HibernalHerbsMod.MOD_ID) public class HibernalHerbsMod { // Define mod id in a common place for everything to reference public static final String MOD_ID = "hibernalherbs"; // Directly reference a slf4j logger - private static final Logger LOGGER = LogUtils.getLogger(); + public static final Logger LOGGER = LogUtils.getLogger(); // The constructor for the mod class is the first code that is run when your mod is loaded. // FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically. @@ -38,10 +53,12 @@ public HibernalHerbsMod(IEventBus modEventBus, ModContainer modContainer) { EntityTypeInit.register(modEventBus); RecipeInit.register(modEventBus); StatusEffectInit.register(modEventBus); + PotionsInit.register(modEventBus); ItemGroupInit.register(modEventBus); EnchantmentKeys.load(); StructureKeys.load(); + ParticleTypeInit.load(modEventBus); DataComponentInit.load(modEventBus); StatsInit.load(modEventBus); CriteriaTriggersInit.load(modEventBus); @@ -92,10 +109,103 @@ public static ResourceLocation asResource(String id) { private void commonSetup(final FMLCommonSetupEvent event) {} +// @SubscribeEvent +// public void lootTableEvents(LootTableLoadEvent event) { +//// if (event.getTable().getLootTableId().equals(BuiltInLootTables.SPAWNER_TRIAL_ITEMS_TO_DROP_WHEN_OMINOUS)) { +//// LootPool swarming_potion = LootPool.lootPool() +//// .setRolls(ConstantValue.exactly(1)) +//// .when(LootItemRandomChanceCondition.randomChance(1.00F))//0.15 +//// .add( +//// LootItem.lootTableItem(Items.LINGERING_POTION) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// .apply(SetPotionFunction.setPotion(PotionsInit.SWARMING)) +//// ) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))).build(); +//// LootPool instability_potion = LootPool.lootPool() +//// .setRolls(ConstantValue.exactly(1)) +//// .when(LootItemRandomChanceCondition.randomChance(0.05F))//0.05 +//// .add( +//// LootItem.lootTableItem(Items.LINGERING_POTION) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// .apply(SetPotionFunction.setPotion(PotionsInit.INSTABILITY)) +//// ) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))).build(); +//// LootPool shrieking_potion = LootPool.lootPool() +//// .setRolls(ConstantValue.exactly(1)) +//// .when(LootItemRandomChanceCondition.randomChance(0.35F))//0.35 +//// .add( +//// LootItem.lootTableItem(Items.LINGERING_POTION) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// .apply(SetPotionFunction.setPotion(PotionsInit.SHRIEKING)) +//// ) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))).build(); +//// +//// event.setTable((LootTable) List.of(swarming_potion, instability_potion, shrieking_potion)); +//// } +// +//// if (event.getTable().getLootTableId().equals(BuiltInLootTables.TRIAL_CHAMBERS_REWARD_OMINOUS_UNIQUE)) { +//// LootPool herbal_sigils = LootPool.lootPool() +//// .setRolls(ConstantValue.exactly(1)) +//// .when(LootItemRandomChanceCondition.randomChance(0.35F))//35% +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.PRIDE.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.ENVY.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.WRATH.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.GREED.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.GLUTTONY.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.SLOTH.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .add( +//// LootItem.lootTableItem(HerbalSigilTypes.LUST.getHerbalSigilItem()) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) +//// ) +//// .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))).build(); +//// +//// event.setTable((LootTable) List.of(herbal_sigils)); +//// } +// } + // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(ServerStartingEvent event) { // Do something when the server starts //LOGGER.info("HELLO from server starting"); } + + @SubscribeEvent + public void onBrewingRecipeRegister(RegisterBrewingRecipesEvent event) { + PotionBrewing.Builder builder = event.getBuilder(); + + builder.addContainer(ItemInit.ENIGMATIC_POTION.asItem()); + builder.addContainer(ItemInit.SOLAR_POTION.asItem()); + builder.addContainer(ItemInit.LUNAR_POTION.asItem()); + + builder.addMix(Potions.AWKWARD, HerbTypes.SAGE.getDriedHerb(), PotionsInit.FROST_RESISTANCE); + + builder.addMix(Potions.AWKWARD, Items.BEE_NEST, PotionsInit.SWARMING); + builder.addMix(Potions.AWKWARD, Items.END_ROD, PotionsInit.INSTABILITY); + builder.addMix(Potions.AWKWARD, Items.SCULK_SHRIEKER, PotionsInit.SHRIEKING); + + builder.addContainerRecipe(Items.POTION, ItemInit.MYSTICAL_ASHES.get(), ItemInit.ENIGMATIC_POTION.get()); + builder.addContainerRecipe(Items.POTION, Items.CLOCK, ItemInit.SOLAR_POTION.get()); + builder.addContainerRecipe(ItemInit.SOLAR_POTION.get(), Items.SCULK, ItemInit.LUNAR_POTION.get()); + + HibernalHerbsMod.LOGGER.info("[Hibernal Herbs Dev Environment] POTION RECIPES REGISTRAR"); + } } diff --git a/src/main/java/net/dakotapride/hibernalherbs/client/ClientEvents.java b/src/main/java/net/dakotapride/hibernalherbs/client/ClientEvents.java index 0cfd2724..5444493c 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/client/ClientEvents.java +++ b/src/main/java/net/dakotapride/hibernalherbs/client/ClientEvents.java @@ -4,13 +4,17 @@ import net.dakotapride.hibernalherbs.entity.render.ModBoatRenderer; import net.dakotapride.hibernalherbs.init.BlockEntityTypeInit; import net.dakotapride.hibernalherbs.init.EntityTypeInit; +import net.dakotapride.hibernalherbs.init.ItemInit; +import net.dakotapride.hibernalherbs.init.ParticleTypeInit; import net.dakotapride.hibernalherbs.init.enum_registry.FrozeBlockstates; import net.dakotapride.hibernalherbs.init.enum_registry.WoodTypes; import net.dakotapride.hibernalherbs.item.HerbalPadlockItem; import net.minecraft.Util; +import net.minecraft.client.color.item.ItemColors; import net.minecraft.client.model.BoatModel; import net.minecraft.client.model.ChestBoatModel; import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.particle.SpellParticle; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Sheets; @@ -19,6 +23,9 @@ import net.minecraft.client.renderer.blockentity.SignRenderer; import net.minecraft.client.renderer.entity.EntityRenderers; import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.component.DataComponents; +import net.minecraft.util.FastColor; +import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.level.block.Block; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; @@ -26,6 +33,8 @@ import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; +import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent; import java.util.Map; @@ -51,6 +60,20 @@ public static void registerEntityModelLayers(EntityRenderersEvent.RegisterLayerD event.registerLayerDefinition(new ModelLayerLocation(asResource("chest_boat/myqueste"), "main"), ChestBoatModel::createBodyModel); } + @SubscribeEvent + public static void registerParticleRenderers(RegisterParticleProvidersEvent event) { + event.registerSpriteSet(ParticleTypeInit.SWARMING.get(), SpellParticle.Provider::new); + event.registerSpriteSet(ParticleTypeInit.INSTABILITY.get(), SpellParticle.Provider::new); + event.registerSpriteSet(ParticleTypeInit.SHRIEKING.get(), SpellParticle.Provider::new); + } + + @SubscribeEvent + public static void registerColourHandlers(RegisterColorHandlersEvent.Item event) { + event.register((itemStack, i) -> i > 0 ? -1 : FastColor.ARGB32.opaque( + itemStack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).getColor()), + ItemInit.ENIGMATIC_POTION, ItemInit.SOLAR_POTION, ItemInit.LUNAR_POTION); + } + @SubscribeEvent public static void clientSetup(final FMLClientSetupEvent event) { // ItemProperties.register(ItemRegistry.CANISTER.get(), new ResourceLocation(MOD_ID, "filled"), diff --git a/src/main/java/net/dakotapride/hibernalherbs/effect/BasicStatusEffect.java b/src/main/java/net/dakotapride/hibernalherbs/effect/BasicStatusEffect.java index ad8f4a36..af726dcb 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/effect/BasicStatusEffect.java +++ b/src/main/java/net/dakotapride/hibernalherbs/effect/BasicStatusEffect.java @@ -1,5 +1,6 @@ package net.dakotapride.hibernalherbs.effect; +import net.minecraft.core.particles.ParticleOptions; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; @@ -8,5 +9,8 @@ public BasicStatusEffect(MobEffectCategory category, int colour) { super(category, colour); } + public BasicStatusEffect(MobEffectCategory category, int colour, ParticleOptions particleOptions) { + super(category, colour, particleOptions); + } } diff --git a/src/main/java/net/dakotapride/hibernalherbs/effect/InstabilityStatusEffect.java b/src/main/java/net/dakotapride/hibernalherbs/effect/InstabilityStatusEffect.java new file mode 100644 index 00000000..4908af6c --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/effect/InstabilityStatusEffect.java @@ -0,0 +1,74 @@ +package net.dakotapride.hibernalherbs.effect; + +import net.dakotapride.hibernalherbs.init.ParticleTypeInit; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.util.Mth; +import net.minecraft.world.effect.MobEffectCategory; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.animal.Fox; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.gameevent.GameEvent; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; + +public class InstabilityStatusEffect extends BasicStatusEffect { + public InstabilityStatusEffect(MobEffectCategory category, int colour) { + super(category, colour); + } + + @Override + public @NotNull ParticleOptions createParticleOptions(@NotNull MobEffectInstance effect) { + return ParticleTypeInit.INSTABILITY.get(); + } + + @Override + public boolean applyEffectTick(LivingEntity livingEntity, int j) { + Level level = livingEntity.level(); + + if (!level.isClientSide) { + for (int i = 0; i < 16; i++) { + double d = livingEntity.getX() + (livingEntity.getRandom().nextDouble() - 0.5) * 16.0; + double e = Mth.clamp( + livingEntity.getY() + (double)(livingEntity.getRandom().nextInt(16) - 8), + level.getMinBuildHeight(), + (level.getMinBuildHeight() + ((ServerLevel)level).getLogicalHeight() - 1) + ); + double f = livingEntity.getZ() + (livingEntity.getRandom().nextDouble() - 0.5) * 16.0; + if (livingEntity.isPassenger()) { + livingEntity.stopRiding(); + } + + Vec3 vec3 = livingEntity.position(); + if (livingEntity.randomTeleport(d, e, f, true)) { + level.gameEvent(GameEvent.TELEPORT, vec3, GameEvent.Context.of(livingEntity)); + SoundSource soundSource; + SoundEvent soundEvent; + if (livingEntity instanceof Fox) { + soundEvent = SoundEvents.FOX_TELEPORT; + soundSource = SoundSource.NEUTRAL; + } else { + soundEvent = SoundEvents.CHORUS_FRUIT_TELEPORT; + soundSource = SoundSource.PLAYERS; + } + + level.playSound(null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), soundEvent, soundSource); + livingEntity.resetFallDistance(); + break; + } + } + } + + return true; + } + + @Override + public boolean shouldApplyEffectTickThisTick(int i, int j) { + int k = 50 >> j; + return k > 0 ? i % k == 0 : true; + } +} diff --git a/src/main/java/net/dakotapride/hibernalherbs/effect/ShriekingStatusEffect.java b/src/main/java/net/dakotapride/hibernalherbs/effect/ShriekingStatusEffect.java new file mode 100644 index 00000000..f632e3fa --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/effect/ShriekingStatusEffect.java @@ -0,0 +1,62 @@ +package net.dakotapride.hibernalherbs.effect; + +import net.dakotapride.hibernalherbs.init.ParticleTypeInit; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.util.SpawnUtil; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.effect.MobEffectCategory; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.monster.warden.Warden; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; +import org.joml.Vector3f; + +public class ShriekingStatusEffect extends BasicStatusEffect { + private final float chanceToSpawn; + + public ShriekingStatusEffect(MobEffectCategory mobEffectCategory, int i, float f) { + super(mobEffectCategory, i); + this.chanceToSpawn = f; + } + + @Override + public @NotNull ParticleOptions createParticleOptions(@NotNull MobEffectInstance effect) { + return ParticleTypeInit.SHRIEKING.get(); + } + + @Override + public void onMobHurt(LivingEntity livingEntity, int i, DamageSource damageSource, float f) { + if (livingEntity.getRandom().nextFloat() <= this.chanceToSpawn) { + this.spawnWarden( + livingEntity.level(), livingEntity, livingEntity.getX(), livingEntity.getY() + (double)livingEntity.getBbHeight() / 2.0, livingEntity.getZ() + ); + } + } + + private void spawnWarden(Level level, LivingEntity livingEntity, double d, double e, double f) { + Warden warden = EntityType.WARDEN.create(level); + if (warden != null) { + //warden.setAggressive(true); + //warden.setTarget(livingEntity); + //SpawnUtil.trySpawnMob(EntityType.WARDEN, MobSpawnType.TRIGGERED, serverLevel, this.getBlockPos(), 20, 5, 6, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER) + RandomSource randomSource = livingEntity.getRandom(); + float g = (float) (Math.PI / 2); + float h = Mth.randomBetween(randomSource, (float) (-Math.PI / 2), (float) (Math.PI / 2)); + Vector3f vector3f = livingEntity.getLookAngle().toVector3f().mul(0.3F).mul(1.0F, 1.5F, 1.0F).rotateY(h); + warden.moveTo(d, e, f, level.getRandom().nextFloat() * 360.0F, 0.0F); + warden.setDeltaMovement(new Vec3(vector3f)); + //level.addFreshEntity(warden); + if (level instanceof ServerLevel serverLevel) + SpawnUtil.trySpawnMob(EntityType.WARDEN, MobSpawnType.TRIGGERED, serverLevel, livingEntity.blockPosition(), 20, 5, 6, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER); + warden.playSound(SoundEvents.WARDEN_HURT); + } + } +} diff --git a/src/main/java/net/dakotapride/hibernalherbs/effect/SwarmingStatusEffect.java b/src/main/java/net/dakotapride/hibernalherbs/effect/SwarmingStatusEffect.java new file mode 100644 index 00000000..4c722af6 --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/effect/SwarmingStatusEffect.java @@ -0,0 +1,64 @@ +package net.dakotapride.hibernalherbs.effect; + +import net.dakotapride.hibernalherbs.init.ParticleTypeInit; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.effect.MobEffectCategory; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.animal.Bee; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; +import org.joml.Vector3f; + +import java.util.function.ToIntFunction; + +public class SwarmingStatusEffect extends BasicStatusEffect { + private final float chanceToSpawn; + private final ToIntFunction spawnedCount; + + public SwarmingStatusEffect(MobEffectCategory mobEffectCategory, int i, float f, ToIntFunction toIntFunction) { + super(mobEffectCategory, i); + this.chanceToSpawn = f; + this.spawnedCount = toIntFunction; + } + + @Override + public @NotNull ParticleOptions createParticleOptions(@NotNull MobEffectInstance effect) { + return ParticleTypeInit.SWARMING.get(); + } + + @Override + public void onMobHurt(LivingEntity livingEntity, int i, DamageSource damageSource, float f) { + if (livingEntity.getRandom().nextFloat() <= this.chanceToSpawn) { + int j = this.spawnedCount.applyAsInt(livingEntity.getRandom()); + + for (int k = 0; k < j; k++) { + this.spawnBees( + livingEntity.level(), livingEntity, livingEntity.getX(), livingEntity.getY() + (double)livingEntity.getBbHeight() / 2.0, livingEntity.getZ() + ); + } + } + } + + private void spawnBees(Level level, LivingEntity livingEntity, double d, double e, double f) { + Bee bee = EntityType.BEE.create(level); + if (bee != null) { + bee.setAggressive(true); + bee.setTarget(livingEntity); + RandomSource randomSource = livingEntity.getRandom(); + float g = (float) (Math.PI / 2); + float h = Mth.randomBetween(randomSource, (float) (-Math.PI / 2), (float) (Math.PI / 2)); + Vector3f vector3f = livingEntity.getLookAngle().toVector3f().mul(0.3F).mul(1.0F, 1.5F, 1.0F).rotateY(h); + bee.moveTo(d, e, f, level.getRandom().nextFloat() * 360.0F, 0.0F); + bee.setDeltaMovement(new Vec3(vector3f)); + level.addFreshEntity(bee); + bee.playSound(SoundEvents.BEE_HURT); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/dakotapride/hibernalherbs/emi/HibernalHerbsEmiPlugin.java b/src/main/java/net/dakotapride/hibernalherbs/emi/HibernalHerbsEmiPlugin.java index eb664023..6320424c 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/emi/HibernalHerbsEmiPlugin.java +++ b/src/main/java/net/dakotapride/hibernalherbs/emi/HibernalHerbsEmiPlugin.java @@ -7,6 +7,7 @@ import dev.emi.emi.api.recipe.EmiRecipe; import dev.emi.emi.api.recipe.EmiRecipeCategory; import dev.emi.emi.api.render.EmiTexture; +import dev.emi.emi.api.stack.Comparison; import dev.emi.emi.api.stack.EmiIngredient; import dev.emi.emi.api.stack.EmiStack; import dev.emi.emi.recipe.EmiCookingRecipe; @@ -22,6 +23,7 @@ import net.dakotapride.hibernalherbs.item.SorcererTomeItem; import net.dakotapride.hibernalherbs.recipe.MysticalCampfireCookingRecipe; import net.minecraft.ChatFormatting; +import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; @@ -94,6 +96,14 @@ public void register(EmiRegistry registry) { registry.addCategory(UNFREEZING_STATE); registry.addCategory(REVERT_DETERIORATION); + Comparison potionComparison = Comparison.compareData(stack -> stack.get(DataComponents.POTION_CONTENTS)); + + //registry.setDefaultComparison(Items.POTION, potionComparison); + + registry.setDefaultComparison(ItemInit.ENIGMATIC_POTION.get(), potionComparison); + registry.setDefaultComparison(ItemInit.SOLAR_POTION.get(), potionComparison); + registry.setDefaultComparison(ItemInit.LUNAR_POTION.get(), potionComparison); + //registry.addRecipe(new EmiInfoRecipe(List.of(EmiIngredient.of(Ingredient.of(ItemInit.LIFE_FORCE_BOTTLE))), List.of(Component.translatable("emi.hibernalherbs.information.life_force"), Component.translatable("emi.hibernalherbs.information.life_force.usage"), Component.translatable("emi.hibernalherbs.information.life_force.slashing")), HibernalHerbsMod.asResource("life_force"))); // Add all the workstations your category uses diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/BlockInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/BlockInit.java index 4363387d..26072a53 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/BlockInit.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/BlockInit.java @@ -7,12 +7,14 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredItem; import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; +import java.util.function.ToIntFunction; public class BlockInit { public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(HibernalHerbsMod.MOD_ID); @@ -27,7 +29,11 @@ public class BlockInit { public static DeferredBlock MYSTICAL_CAMPFIRE = register("mystical_campfire", () -> new MysticalCampfireBlock(true, 10, BlockBehaviour.Properties.ofFullCopy(Blocks.CAMPFIRE).noOcclusion())); public static DeferredBlock INCENSE_PROVIDER = register("incense_provider", - () -> new IncenseProviderBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_SLAB).noOcclusion().lightLevel(l -> 7).requiresCorrectToolForDrops())); + () -> new IncenseProviderBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_SLAB).noOcclusion().lightLevel(incenseLightEmission(7)).requiresCorrectToolForDrops())); + + public static ToIntFunction incenseLightEmission(int i) { + return blockState -> blockState.getValue(PropertiesInit.FED) ? i : 0; + } // Collective Registration public static void register(IEventBus bus) { diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/FeaturesInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/FeaturesInit.java index d7bcb3c8..556ab9e8 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/FeaturesInit.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/FeaturesInit.java @@ -10,8 +10,8 @@ public class FeaturesInit { public static final ResourceKey> MYQUESTE_CONFIGURED = registerConfiguredFeature("myqueste"); public static final ResourceKey> HERBS_CONFIGURED = registerConfiguredFeature("herbs"); - public static final ResourceKey MYQUESTE_PLACED = registerPlacedFeature("myqueste_placed"); - public static final ResourceKey HERBS_PLACED = registerPlacedFeature("herbs_placed"); + public static final ResourceKey MYQUESTE_PLACED = registerPlacedFeature("myqueste"); + public static final ResourceKey HERBS_PLACED = registerPlacedFeature("herbs"); public static ResourceKey> registerConfiguredFeature(String name) { return ResourceKey.create(Registries.CONFIGURED_FEATURE, HibernalHerbsMod.asResource(name)); diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/ItemGroupInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/ItemGroupInit.java index 54da37ed..fb554b6d 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/ItemGroupInit.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/ItemGroupInit.java @@ -1,12 +1,16 @@ package net.dakotapride.hibernalherbs.init; import net.dakotapride.hibernalherbs.HibernalHerbsMod; -import net.dakotapride.hibernalherbs.init.enum_registry.Sickles; +import net.dakotapride.hibernalherbs.init.enum_registry.*; +import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.world.flag.FeatureFlagSet; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.alchemy.Potion; +import net.minecraft.world.item.alchemy.PotionContents; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; @@ -19,12 +23,190 @@ public class ItemGroupInit { public static final Supplier HIBERNAL_HERBS_TAB = CREATIVE_MODE_TABS.register("hibernal_herbs", () -> CreativeModeTab.builder().icon(() -> new ItemStack(Sickles.ARKONIUM.getSickleItem())) .title(Component.translatable("creativetab.hibernalherbs.hibernal_herbs")) - .displayItems((itemDisplayParameters, output) -> { - for (DeferredHolder items : ItemInit.ITEMS.getEntries()) { - output.accept(items.get()); + .displayItems((displayContext, entries) -> { +// for (Item item : ItemInit.ITEMS.stream().toList()) { +// entries.accept(item); +// } + + entries.accept(ItemInit.GROUND_HERBS); + entries.accept(ItemInit.LIFE_FORCE_BOTTLE); + entries.accept(ItemInit.INSCRIPTION_SMITHING_TEMPLATE); + entries.accept(ItemInit.BLANK_HERBAL_SIGIL); + entries.accept(ItemInit.CRACKED_HERBAL_SIGIL); + entries.accept(ItemInit.SILIPTIUM_PETALS); + entries.accept(ItemInit.LUMBINETRIK_PETALS); + entries.accept(ItemInit.JULISIUM_PETALS); + entries.accept(ItemInit.GRIMOIRE); + entries.accept(ItemInit.SINGED_GRIMOIRE); + entries.accept(ItemInit.SORCERER_AGGLOMERATION); + entries.accept(ItemInit.SORCERER_TOME); + entries.accept(ItemInit.MYSTICAL_ASHES); + entries.accept(ItemInit.VILE_ASHES); + entries.accept(ItemInit.VIRTUOUS_ASHES); + entries.accept(BlockInit.SACRIFICIAL_RUNE_BLOCK); + entries.accept(BlockInit.FROZE_STATE_SACRIFICIAL_RUNE_BLOCK); + entries.accept(BlockInit.DETERIORATED_SACRIFICIAL_RUNE_BLOCK); + entries.accept(BlockInit.MYSTICAL_CAMPFIRE); + entries.accept(BlockInit.INCENSE_PROVIDER); + + for (HerbTypes types : HerbTypes.values()) { + entries.accept(types.getBaseBlock()); + entries.accept(types.getPoundedHerbBlock()); + entries.accept(types.getDriedHerbBlock()); + entries.accept(types.getPoundedHerb()); + entries.accept(types.getDriedHerb()); + entries.accept(types.getLanternBlock()); + entries.accept(types.getHerbPileBlock()); + entries.accept(types.getHerbBarrelBlock()); } + + for (HerbalBlendTypes types : HerbalBlendTypes.values()) { + if (types != HerbalBlendTypes.NONE) { + entries.accept(types.getHerbalBlend()); + } + } + + for (HerbalSigilTypes types : HerbalSigilTypes.values()) { + if (types != HerbalSigilTypes.NONE) { + entries.accept(types.getHerbalSigilItem()); + } + } + + for (PadlockTypes types : PadlockTypes.values()) { + if (types != PadlockTypes.NONE) { + entries.accept(types.getUnboundPadlockItem()); + entries.accept(types.getBoundPadlockItem()); + } + } + + for (WoodTypes types : WoodTypes.values()) { + entries.accept(types.getLeavesBlock()); + entries.accept(types.getLogBlock()); + entries.accept(types.getStrippedLogBlock()); + entries.accept(types.getWoodBlock()); + entries.accept(types.getStrippedWoodBlock()); + entries.accept(types.getPlanksBlock()); + entries.accept(types.getSlabBlock()); + entries.accept(types.getStairsBlock()); + entries.accept(types.getFenceBlock()); + entries.accept(types.getFenceGateBlock()); + entries.accept(types.getButtonBlock()); + entries.accept(types.getPressurePlateBlock()); + entries.accept(types.getDoorBlock()); + entries.accept(types.getTrapdoorBlock()); + entries.accept(types.getSignBlock()); + entries.accept(types.getHangingSignBlock()); + entries.accept(types.getBoatItem()); + entries.accept(types.getChestBoatItem()); + entries.accept(types.getSaplingBlock()); + } + + for (StoneTypes types : StoneTypes.values()) { + entries.accept(types.getBaseBlock()); + entries.accept(types.getCobbledBlock()); + entries.accept(types.getPolishedBlock()); + entries.accept(types.getBricksBlock()); + entries.accept(types.getSlabBlock()); + entries.accept(types.getCobbledSlabBlock()); + entries.accept(types.getPolishedSlabBlock()); + entries.accept(types.getBrickSlabBlock()); + entries.accept(types.getStairsBlock()); + entries.accept(types.getCobbledStairsBlock()); + entries.accept(types.getPolishedStairsBlock()); + entries.accept(types.getBrickStairsBlock()); + entries.accept(types.getWallBlock()); + entries.accept(types.getCobbledWallBlock()); + entries.accept(types.getPolishedWallBlock()); + entries.accept(types.getBrickWallBlock()); + entries.accept(types.getButtonBlock()); + entries.accept(types.getPressurePlateBlock()); + } + + for (Archaeology.Metals metals : Archaeology.Metals.values()) { + if (metals.isAlloy()) { + entries.accept(metals.getScrapItem()); + } + entries.accept(metals.getIngotItem()); + entries.accept(metals.getNuggetItem()); + entries.accept(metals.getBlock()); + } + + for (Archaeology.Brushes brushes : Archaeology.Brushes.values()) { + entries.accept(brushes.getBrushItem()); + } + + for (Archaeology.SuspiciousBlocks suspiciousBlocks : Archaeology.SuspiciousBlocks.values()) { + entries.accept(suspiciousBlocks.getBlock()); + } + + for (Archaeology.Ashes ashes : Archaeology.Ashes.values()) { + entries.accept(ashes.getAshesItem()); + } + + for (MetalUtilities.Armour armour : MetalUtilities.Armour.values()) { + entries.accept(armour.getHelmetItem()); + entries.accept(armour.getChestplateItem()); + entries.accept(armour.getLeggingsItem()); + entries.accept(armour.getBootsItem()); + } + + for (MetalUtilities.Tools tools : MetalUtilities.Tools.values()) { + entries.accept(tools.getSwordItem()); + entries.accept(tools.getPickaxeItem()); + entries.accept(tools.getAxeItem()); + entries.accept(tools.getShovelItem()); + entries.accept(tools.getHoeItem()); + } + + for (FertilizerTypes types : FertilizerTypes.values()) { + entries.accept(types.getHerbHumusItem()); + if (types != FertilizerTypes.NONE) { + entries.accept(types.getFertilizerItem()); + } + } + + for (Sickles sickles : Sickles.values()) { + entries.accept(sickles.getSickleItem()); + } + + for (FrozeBlockstates blockstates : FrozeBlockstates.values()) { + entries.accept(blockstates.getFrozeState()); + entries.accept(blockstates.getFrozeCutState()); + entries.accept(blockstates.getFrozeCutSlabState()); + entries.accept(blockstates.getFrozeCutStairsState()); + entries.accept(blockstates.getFrozeDoorState()); + entries.accept(blockstates.getFrozeTrapdoorState()); + entries.accept(blockstates.getFrozeBulbState()); + entries.accept(blockstates.getFrozeGrateState()); + entries.accept(blockstates.getFrozeChiseledState()); + } + + displayContext.holders().lookup(Registries.POTION).ifPresent( + registryLookup -> generatePotionEffectTypes( + entries, registryLookup, ItemInit.ENIGMATIC_POTION.get(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS, displayContext.enabledFeatures() + ) + ); + displayContext.holders().lookup(Registries.POTION).ifPresent( + registryLookup -> generatePotionEffectTypes( + entries, registryLookup, ItemInit.SOLAR_POTION.get(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS, displayContext.enabledFeatures() + ) + ); + displayContext.holders().lookup(Registries.POTION).ifPresent( + registryLookup -> generatePotionEffectTypes( + entries, registryLookup, ItemInit.LUNAR_POTION.get(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS, displayContext.enabledFeatures() + ) + ); }).build()); + private static void generatePotionEffectTypes( + CreativeModeTab.Output output, HolderLookup holderLookup, Item item, CreativeModeTab.TabVisibility tabVisibility, FeatureFlagSet featureFlagSet + ) { + holderLookup.listElements() + .filter(reference -> (reference.value()).isEnabled(featureFlagSet)) + .map(reference -> PotionContents.createItemStack(item, reference)) + .forEach(itemStack -> output.accept(itemStack, tabVisibility)); + } + public static void register(IEventBus eventBus) { CREATIVE_MODE_TABS.register(eventBus); diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/ItemInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/ItemInit.java index 5f5601ce..2235c548 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/ItemInit.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/ItemInit.java @@ -3,9 +3,11 @@ import net.dakotapride.hibernalherbs.HibernalHerbsMod; import net.dakotapride.hibernalherbs.item.*; import net.minecraft.core.Registry; +import net.minecraft.core.component.DataComponents; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.Item; import net.minecraft.world.item.Rarity; +import net.minecraft.world.item.alchemy.PotionContents; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredItem; import net.neoforged.neoforge.registries.DeferredRegister; @@ -39,6 +41,10 @@ public class ItemInit { public static DeferredItem VILE_ASHES = register("extract_vile_ashes", () -> new ExtractItem("Vile Flame", new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON))); public static DeferredItem VIRTUOUS_ASHES = register("extract_virtuous_ashes", () -> new ExtractItem("Virtuous Flame", new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON))); + public static DeferredItem ENIGMATIC_POTION = register("enigmatic_potion", () -> new EnigmaticPotionItem(new Item.Properties().stacksTo(1).component(DataComponents.POTION_CONTENTS, PotionContents.EMPTY))); + public static DeferredItem SOLAR_POTION = register("solar_potion", () -> new TimeOfDayPotion(TimeOfDayPotion.Time.DAY, new Item.Properties().stacksTo(1).component(DataComponents.POTION_CONTENTS, PotionContents.EMPTY))); + public static DeferredItem LUNAR_POTION = register("lunar_potion", () -> new TimeOfDayPotion(TimeOfDayPotion.Time.NIGHT, new Item.Properties().stacksTo(1).component(DataComponents.POTION_CONTENTS, PotionContents.EMPTY))); + // Collective Registration public static void register(IEventBus bus) { ITEMS.register(bus); diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/ParticleTypeInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/ParticleTypeInit.java new file mode 100644 index 00000000..6d2f339f --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/init/ParticleTypeInit.java @@ -0,0 +1,25 @@ +package net.dakotapride.hibernalherbs.init; + +import net.dakotapride.hibernalherbs.HibernalHerbsMod; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.particles.SimpleParticleType; +import net.minecraft.core.registries.BuiltInRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; + +public class ParticleTypeInit { + public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(BuiltInRegistries.PARTICLE_TYPE, HibernalHerbsMod.MOD_ID); + + public static final DeferredHolder, SimpleParticleType> SWARMING = register("swarming", false); + public static final DeferredHolder, SimpleParticleType> INSTABILITY = register("instability", false); + public static final DeferredHolder, SimpleParticleType> SHRIEKING = register("shrieking", false); + + private static DeferredHolder, SimpleParticleType> register(String key, boolean overrideLimiter) { + return PARTICLE_TYPES.register(key, () -> new SimpleParticleType(overrideLimiter)); + } + + public static void load(IEventBus bus) { + PARTICLE_TYPES.register(bus); + } +} diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/PotionsInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/PotionsInit.java new file mode 100644 index 00000000..2a5a038f --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/init/PotionsInit.java @@ -0,0 +1,46 @@ +package net.dakotapride.hibernalherbs.init; + +import net.dakotapride.hibernalherbs.HibernalHerbsMod; +import net.dakotapride.hibernalherbs.init.enum_registry.HerbTypes; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.alchemy.Potion; +import net.minecraft.world.item.alchemy.PotionBrewing; +import net.minecraft.world.item.alchemy.Potions; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.event.brewing.RegisterBrewingRecipesEvent; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; + +public class PotionsInit { + public static final DeferredRegister POTIONS = DeferredRegister.create(BuiltInRegistries.POTION, HibernalHerbsMod.MOD_ID); + + //public static final Holder MYSTERIOUS = register("mysterious", new Potion()); + public static final DeferredHolder FROST_RESISTANCE = register("frost_resistance", + () -> new Potion("frost_resistance", new MobEffectInstance(StatusEffectInit.FROST_RESISTANCE, 3600))); + + public static final DeferredHolder SWARMING = register("swarming", + () -> new Potion("swarming", new MobEffectInstance(StatusEffectInit.SWARMING, 3600))); + public static final DeferredHolder INSTABILITY = register("instability", + () -> new Potion("instability", new MobEffectInstance(StatusEffectInit.INSTABILITY, 3600))); + public static final DeferredHolder SHRIEKING = register("shrieking", + () -> new Potion("shrieking", new MobEffectInstance(StatusEffectInit.SHRIEKING, 3600))); + + private static DeferredHolder register(String string, Supplier potion) { + return POTIONS.register(string, potion); + } + + public static void register(IEventBus bus) { + //potionRecipes(); + POTIONS.register(bus); + } + + //private static void potionRecipes() {} + +} \ No newline at end of file diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/StatusEffectInit.java b/src/main/java/net/dakotapride/hibernalherbs/init/StatusEffectInit.java index d17dcbb5..33a69145 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/StatusEffectInit.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/StatusEffectInit.java @@ -1,15 +1,13 @@ package net.dakotapride.hibernalherbs.init; import net.dakotapride.hibernalherbs.HibernalHerbsMod; -import net.dakotapride.hibernalherbs.effect.ApplyEffectOnAttackStatusEffect; -import net.dakotapride.hibernalherbs.effect.BasicStatusEffect; -import net.dakotapride.hibernalherbs.effect.MimicryStatusEffect; -import net.dakotapride.hibernalherbs.effect.SiphonHealthStatusEffect; +import net.dakotapride.hibernalherbs.effect.*; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.stats.StatType; +import net.minecraft.util.Mth; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.effect.MobEffects; @@ -40,7 +38,14 @@ public class StatusEffectInit { .addAttributeModifier(Attributes.SNEAKING_SPEED, HibernalHerbsMod.asResource("effect.esurient.sneaking_speed"), -0.15F, AttributeModifier.Operation.ADD_MULTIPLIED_BASE)); public static final DeferredHolder MIMICRY = register("mimicry", MimicryStatusEffect::new); - public static final DeferredHolder FROST_RESISTANCE = register("frost_resistance", () -> new BasicStatusEffect(MobEffectCategory.BENEFICIAL, 0x0)); + public static final DeferredHolder FROST_RESISTANCE = register("frost_resistance", () -> new BasicStatusEffect(MobEffectCategory.BENEFICIAL, 0xAEC9E5)); + + public static final DeferredHolder SWARMING = register("swarming", () -> new SwarmingStatusEffect(MobEffectCategory.HARMFUL, + 0xEDC343, 0.40F, randomSource -> Mth.randomBetweenInclusive(randomSource, 1, 2))); + public static final DeferredHolder INSTABILITY = register("instability", () -> new InstabilityStatusEffect(MobEffectCategory.HARMFUL, + 0xDB88F7)); + public static final DeferredHolder SHRIEKING = register("shrieking", () -> new ShriekingStatusEffect(MobEffectCategory.HARMFUL, + 0x111B21, 0.01F)); // Collective Registration public static void register(IEventBus bus) { diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/Archaeology.java b/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/Archaeology.java index 863a53de..c616903f 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/Archaeology.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/Archaeology.java @@ -205,7 +205,7 @@ public enum Ashes { Ashes() { this.ashes_id = name().toLowerCase(Locale.ROOT); - this.ashes = ItemInit.register(ashes_id + "_ashes", () -> new Item(new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON))); + this.ashes = ItemInit.register(ashes_id + "_ashes", () -> new Item(new Item.Properties().rarity(Rarity.UNCOMMON))); } public String getAshesId() { diff --git a/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/tag/Tags.java b/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/tag/Tags.java index 2aa514e3..437202e5 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/tag/Tags.java +++ b/src/main/java/net/dakotapride/hibernalherbs/init/enum_registry/tag/Tags.java @@ -37,7 +37,8 @@ public enum Items { LONG_AGGLOMERATION_DURATION("agglomeration_duration/long"), CAN_USE_WITH_AGGLOMERATION("can_use_with_agglomeration"), CAN_USE_WITH_TOME("can_use_with_tome"), - CAN_BE_CONVERTED_WITH_AGGLOMERATION("can_be_converted_with_agglomeration"),; + CAN_BE_CONVERTED_WITH_AGGLOMERATION("can_be_converted_with_agglomeration"), + IS_ACCEPTABLE_IN_BREWING_STAND("c", "acceptable_potions_for_brewing"); // Added for recipe functionality, do NOT add your own agglomeration-like items to this tag, it may cause compatibility issues //AGGLOMERATION("agglomerations"); diff --git a/src/main/java/net/dakotapride/hibernalherbs/item/EnigmaticPotionItem.java b/src/main/java/net/dakotapride/hibernalherbs/item/EnigmaticPotionItem.java new file mode 100644 index 00000000..299745de --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/item/EnigmaticPotionItem.java @@ -0,0 +1,99 @@ +package net.dakotapride.hibernalherbs.item; + +import net.dakotapride.hibernalherbs.init.ItemInit; +import net.minecraft.ChatFormatting; +import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.core.component.DataComponents; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.stats.Stats; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.PotionItem; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.alchemy.PotionContents; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.gameevent.GameEvent; + +import java.util.List; + +public class EnigmaticPotionItem extends PotionItem { + public EnigmaticPotionItem(Properties properties) { + super(properties); + } + + @Override + public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, List list, TooltipFlag tooltipFlag) { + super.appendHoverText(itemStack, tooltipContext, list, tooltipFlag); + + list.add(Component.literal("")); + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.no_particles").withStyle(ChatFormatting.GRAY)); + + // Modifiers + list.add(Component.literal("")); + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.enigmatic_extract.modifiers").withStyle(ChatFormatting.AQUA)); + //list.add(Component.literal("")); + // Vile Ashes + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.enigmatic_extract.vile").withStyle(ChatFormatting.LIGHT_PURPLE)); + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.enigmatic_extract.vile.occurrence").withStyle(ChatFormatting.GRAY)); + // Virtuous Ashes + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.enigmatic_extract.virtuous").withStyle(ChatFormatting.LIGHT_PURPLE)); + list.add(Component.translatable("text.hibernalherbs.mysterious_potion.enigmatic_extract.virtuous.occurrence").withStyle(ChatFormatting.GRAY)); + } + + @Override + public ItemStack finishUsingItem(ItemStack itemStack, Level level, LivingEntity livingEntity) { + Player player = livingEntity instanceof Player ? (Player)livingEntity : null; + if (player instanceof ServerPlayer) { + CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer)player, itemStack); + } + + if (!level.isClientSide) { + PotionContents potionContents = itemStack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); + potionContents.forEachEffect(mobEffectInstance -> { + mobEffectInstance.visible = false; + // Controlled by Enigmatic Extracts + // mobEffectInstance.duration = 1; + // mobEffectInstance.amplifier = 1; + + if (!(player.getCooldowns().isOnCooldown(player.getOffhandItem().getItem()))) { + if (player.getOffhandItem().is(ItemInit.VIRTUOUS_ASHES)) { + mobEffectInstance.duration = (int)(mobEffectInstance.getDuration() * 1.5F); + + player.getCooldowns().addCooldown(player.getOffhandItem().getItem(), 1200); + } else if (player.getOffhandItem().is(ItemInit.VILE_ASHES)) { + mobEffectInstance.amplifier = mobEffectInstance.getAmplifier() + 1; + + player.getCooldowns().addCooldown(player.getOffhandItem().getItem(), 2400); + } + + if (mobEffectInstance.getEffect().value().isInstantenous()) { + mobEffectInstance.getEffect().value().applyInstantenousEffect(player, player, livingEntity, mobEffectInstance.getAmplifier(), 1.0); + } else { + livingEntity.addEffect(mobEffectInstance); + } + } + }); + } + + if (player != null) { + player.awardStat(Stats.ITEM_USED.get(this)); + itemStack.consume(1, player); + } + + if (player == null || !player.hasInfiniteMaterials()) { + if (itemStack.isEmpty()) { + return new ItemStack(Items.GLASS_BOTTLE); + } + + if (player != null) { + player.getInventory().add(new ItemStack(Items.GLASS_BOTTLE)); + } + } + + livingEntity.gameEvent(GameEvent.DRINK); + return itemStack; + } +} diff --git a/src/main/java/net/dakotapride/hibernalherbs/item/SorcererAgglomerationItem.java b/src/main/java/net/dakotapride/hibernalherbs/item/SorcererAgglomerationItem.java index fbb30a3b..9f69947a 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/item/SorcererAgglomerationItem.java +++ b/src/main/java/net/dakotapride/hibernalherbs/item/SorcererAgglomerationItem.java @@ -12,6 +12,7 @@ import net.dakotapride.hibernalherbs.init.enum_registry.HerbalSigilTypes; import net.dakotapride.hibernalherbs.init.enum_registry.StoneTypes; import net.dakotapride.hibernalherbs.init.enum_registry.tag.Tags; +import net.minecraft.ChatFormatting; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; @@ -97,6 +98,8 @@ public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, list.add(Component.translatable("text.hibernalherbs.agglomeration.is_active")); list.add(Component.literal("")); list.add(Component.translatable("text.hibernalherbs.agglomeration.cannot_utilise")); + } else if (isNotActive(itemStack)) { + list.add(Component.translatable("text.hibernalherbs.not_active").withStyle(ChatFormatting.GRAY)); } } diff --git a/src/main/java/net/dakotapride/hibernalherbs/item/SorcererTomeItem.java b/src/main/java/net/dakotapride/hibernalherbs/item/SorcererTomeItem.java index c5e44db8..d2f00053 100644 --- a/src/main/java/net/dakotapride/hibernalherbs/item/SorcererTomeItem.java +++ b/src/main/java/net/dakotapride/hibernalherbs/item/SorcererTomeItem.java @@ -7,6 +7,7 @@ import net.dakotapride.hibernalherbs.init.enum_registry.HerbalSigilTypes; import net.dakotapride.hibernalherbs.init.enum_registry.PadlockTypes; import net.dakotapride.hibernalherbs.init.enum_registry.tag.Tags; +import net.minecraft.ChatFormatting; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; @@ -43,6 +44,8 @@ public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, list.add(Component.translatable("text.hibernalherbs.tome.is_active")); list.add(Component.literal("")); list.add(Component.translatable("text.hibernalherbs.tome.cannot_utilise")); + } else if (isNotActive(itemStack)) { + list.add(Component.translatable("text.hibernalherbs.not_active").withStyle(ChatFormatting.GRAY)); } } diff --git a/src/main/java/net/dakotapride/hibernalherbs/item/TimeOfDayPotion.java b/src/main/java/net/dakotapride/hibernalherbs/item/TimeOfDayPotion.java new file mode 100644 index 00000000..217a7d7f --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/item/TimeOfDayPotion.java @@ -0,0 +1,128 @@ +package net.dakotapride.hibernalherbs.item; + +import net.minecraft.ChatFormatting; +import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.core.component.DataComponents; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.stats.Stats; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.PotionItem; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.alchemy.PotionContents; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.gameevent.GameEvent; + +import java.util.List; + +public class TimeOfDayPotion extends PotionItem { + Time time; + + boolean isDay; + boolean isNight; + + public TimeOfDayPotion(Time time, Properties properties) { + super(properties); + this.time = time; + } + + @Override + public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, List list, TooltipFlag tooltipFlag) { + super.appendHoverText(itemStack, tooltipContext, list, tooltipFlag); + + list.add(Component.literal("")); + + switch (time) { + case DAY -> { + list.add(Component.translatable("text.hibernalherbs.time_of_day_potion.daytime").withStyle(ChatFormatting.GOLD)); + } + case NIGHT -> { + list.add(Component.translatable("text.hibernalherbs.time_of_day_potion.nighttime").withStyle(ChatFormatting.DARK_PURPLE)); + } + default -> {} + } + } + + @Override + public ItemStack finishUsingItem(ItemStack itemStack, Level level, LivingEntity livingEntity) { + Player player = livingEntity instanceof Player ? (Player)livingEntity : null; + if (player instanceof ServerPlayer) { + CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer)player, itemStack); + } + + if (!level.isClientSide) { + PotionContents potionContents = itemStack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); + + //int timeOfDay = (int) level.getDayTime(); + long getTime = level.getDayTime(); + + potionContents.forEachEffect(mobEffectInstance -> { + switch (time) { + case DAY -> { + if (getTime >= 1000 && getTime < 13000) { + mobEffectInstance.duration = (mobEffectInstance.getDuration() + 2000); + mobEffectInstance.amplifier = (mobEffectInstance.getAmplifier() + 2); + } else { + mobEffectInstance.duration = (int) (mobEffectInstance.getDuration() * 0.5F); + if (mobEffectInstance.amplifier != 0) { + mobEffectInstance.amplifier = (mobEffectInstance.getAmplifier() - 1); + } + } + + if (mobEffectInstance.getEffect().value().isInstantenous()) { + mobEffectInstance.getEffect().value().applyInstantenousEffect(player, player, livingEntity, mobEffectInstance.getAmplifier(), 1.0); + } else { + livingEntity.addEffect(mobEffectInstance); + } + } + case NIGHT -> { + if (getTime >= 13000 && getTime < 23999) { + mobEffectInstance.duration = (mobEffectInstance.getDuration() + 2000); + mobEffectInstance.amplifier = (mobEffectInstance.getAmplifier() + 2); + } else { + mobEffectInstance.duration = (int) (mobEffectInstance.getDuration() * 0.5F); + if (mobEffectInstance.amplifier != 0) { + mobEffectInstance.amplifier = (mobEffectInstance.getAmplifier() - 1); + } + } + + if (mobEffectInstance.getEffect().value().isInstantenous()) { + mobEffectInstance.getEffect().value().applyInstantenousEffect(player, player, livingEntity, mobEffectInstance.getAmplifier(), 1.0); + } else { + livingEntity.addEffect(mobEffectInstance); + } + } + default -> {} + } + }); + } + + if (player != null) { + player.awardStat(Stats.ITEM_USED.get(this)); + itemStack.consume(1, player); + } + + if (player == null || !player.hasInfiniteMaterials()) { + if (itemStack.isEmpty()) { + return new ItemStack(Items.GLASS_BOTTLE); + } + + if (player != null) { + player.getInventory().add(new ItemStack(Items.GLASS_BOTTLE)); + } + } + + livingEntity.gameEvent(GameEvent.DRINK); + return itemStack; + } + + public enum Time { + DAY, + NIGHT; + + Time() {} + } +} diff --git a/src/main/java/net/dakotapride/hibernalherbs/mixin/MaceItemMixin.java b/src/main/java/net/dakotapride/hibernalherbs/mixin/MaceItemMixin.java new file mode 100644 index 00000000..4b61110b --- /dev/null +++ b/src/main/java/net/dakotapride/hibernalherbs/mixin/MaceItemMixin.java @@ -0,0 +1,30 @@ +package net.dakotapride.hibernalherbs.mixin; + +import net.dakotapride.hibernalherbs.init.ItemInit; +import net.dakotapride.hibernalherbs.init.enum_registry.tag.Tags; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.MaceItem; +import net.minecraft.world.item.enchantment.EnchantmentHelper; +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(MaceItem.class) +public class MaceItemMixin { + + @Inject(method = "postHurtEnemy", at = @At("RETURN")) + private void provideLifeForceFromEnchantment(ItemStack itemStack, LivingEntity livingEntity, LivingEntity livingEntity2, CallbackInfo ci) { + if (livingEntity2 instanceof Player player) { + if (player.getOffhandItem().is(Items.GLASS_BOTTLE) && EnchantmentHelper.hasTag(itemStack, Tags.Enchantments.HARVESTS_LIFE_FORCE.getTag())) { + livingEntity2.getOffhandItem().shrink(1); + + player.addItem(new ItemStack(ItemInit.LIFE_FORCE_BOTTLE.get(), 1)); + } + } + } + +} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 52b21a7b..02cae6dc 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,3 +1,7 @@ public net.minecraft.world.level.block.Blocks leaves(Lnet/minecraft/world/level/block/SoundType;)Lnet/minecraft/world/level/block/Block; # leaves public net.minecraft.world.level.block.Blocks log(Lnet/minecraft/world/level/material/MapColor;Lnet/minecraft/world/level/material/MapColor;)Lnet/minecraft/world/level/block/Block; # log -public net.minecraft.world.level.block.Blocks woodenButton(Lnet/minecraft/world/level/block/state/properties/BlockSetType;)Lnet/minecraft/world/level/block/Block; # woodenButton \ No newline at end of file +public net.minecraft.world.level.block.Blocks woodenButton(Lnet/minecraft/world/level/block/state/properties/BlockSetType;)Lnet/minecraft/world/level/block/Block; # woodenButton +public net.minecraft.world.effect.MobEffectInstance visible # visible +public net.minecraft.world.effect.MobEffectInstance duration # duration +public net.minecraft.world.effect.MobEffectInstance amplifier # amplifier +public net.minecraft.world.inventory.BrewingStandMenu$PotionSlot \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/lang/en_us.json b/src/main/resources/assets/hibernalherbs/lang/en_us.json index eed52504..1e42208b 100644 --- a/src/main/resources/assets/hibernalherbs/lang/en_us.json +++ b/src/main/resources/assets/hibernalherbs/lang/en_us.json @@ -284,6 +284,10 @@ "effect.hibernalherbs.esurient": "Esurient", "effect.hibernalherbs.esurient.level": "Esurient %s", "effect.hibernalherbs.frost_resistance": "Frost Resistance", + "item.minecraft.potion.effect.frost_resistance": "Potion of Frost Resistance", + "item.minecraft.splash_potion.effect.frost_resistance": "Splash Potion of Frost Resistance", + "item.minecraft.lingering_potion.effect.frost_resistance": "Lingering Potion of Frost Resistance", + "item.minecraft.tipped_arrow.effect.frost_resistance": "Arrow of Frost Resistance", "effect.hibernalherbs.lethargy": "Lethargy", "effect.hibernalherbs.lethargy.level": "Lethargy %s", "effect.hibernalherbs.mimicry": "Mimicry", @@ -479,6 +483,7 @@ "text.hibernalherbs.ability.wither": "Decaying", "text.hibernalherbs.agglomeration.cannot_utilise": "§7Cannot be used at this moment", "text.hibernalherbs.agglomeration.is_active": "§3Sorcerer's Agglomeration is active", + "text.hibernalherbs.not_active": "Not active", "text.hibernalherbs.association.acacia": "§6Association:§7 Acacia", "text.hibernalherbs.association.bamboo": "§6Association:§7 Bamboo", "text.hibernalherbs.association.birch": "§6Association:§7 Birch", @@ -652,7 +657,8 @@ "trim_material.hibernalherbs.arkonium": "Arkonium Material", "trim_material.hibernalherbs.syrum": "Syrum Material", "tag.item.accessories.necklace": "Necklace Accessories", - "tag.item.c.sickles": "Sickles", + "tag.item.c.tools.sickles": "Sickles", + "tag.item.c.tools.acceptable_potions_for_brewing": "Acceptable in Potion Input Slots", "tag.item.hibernalherbs.agglomeration_duration.long": "Long Agglomeration Usage", "tag.item.hibernalherbs.agglomeration_duration.short": "Short Agglomeration Usage", "tag.item.hibernalherbs.ashes": "Ashes of Sin", @@ -672,5 +678,121 @@ "tag.item.hibernalherbs.stone_types.idiosyncratic_stone": "Idiosyncratic Stone", "tag.item.hibernalherbs.stone_types.necromantic_stone": "Necromantic Stone", "tag.item.hibernalherbs.unbound_herbal_padlocks": "Unbound Herbal Padlocks", - "upgrade.hibernalherbs.sigil_upgrade": "Herbal Sigil Application" + "upgrade.hibernalherbs.sigil_upgrade": "Herbal Sigil Application", + "text.hibernalherbs.mysterious_potion.no_particles": "No Particles", + "text.hibernalherbs.mysterious_potion.enigmatic_extract.modifiers": "Offhand Modifiers", + "text.hibernalherbs.mysterious_potion.enigmatic_extract.vile": " Vile Flame", + "text.hibernalherbs.mysterious_potion.enigmatic_extract.vile.occurrence": " Increases Effect Amplifier", + "text.hibernalherbs.mysterious_potion.enigmatic_extract.virtuous": " Virtuous Flame", + "text.hibernalherbs.mysterious_potion.enigmatic_extract.virtuous.occurrence": " Increases Effect Duration", + "text.hibernalherbs.time_of_day_potion.daytime": "Amplified During Daytime", + "text.hibernalherbs.time_of_day_potion.nighttime": "Amplified During Nighttime", + "effect.hibernalherbs.swarming": "Swarming", + "item.minecraft.potion.effect.swarming": "Potion of Swarming", + "item.minecraft.splash_potion.effect.swarming": "Splash Potion of Swarming", + "item.minecraft.lingering_potion.effect.swarming": "Lingering Potion of Swarming", + "item.minecraft.tipped_arrow.effect.swarming": "Arrow of Swarming", + "effect.hibernalherbs.instability": "Instability", + "item.minecraft.potion.effect.instability": "Potion of Instability", + "item.minecraft.splash_potion.effect.instability": "Splash Potion of Instability", + "item.minecraft.lingering_potion.effect.instability": "Lingering Potion of Instability", + "item.minecraft.tipped_arrow.effect.instability": "Arrow of Instability", + "effect.hibernalherbs.shrieking": "Shrieking", + "item.minecraft.potion.effect.shrieking": "Potion of Shrieking", + "item.minecraft.splash_potion.effect.shrieking": "Splash Potion of Shrieking", + "item.minecraft.lingering_potion.effect.shrieking": "Lingering Potion of Shrieking", + "item.minecraft.tipped_arrow.effect.shrieking": "Arrow of Shrieking", + "item.hibernalherbs.enigmatic_potion": "Enigmatic Potion", + "item.hibernalherbs.enigmatic_potion.effect.awkward": "Awkward Enigmatic Potion", + "item.hibernalherbs.enigmatic_potion.effect.empty": "Enigmatic Uncraftable Potion", + "item.hibernalherbs.enigmatic_potion.effect.fire_resistance": "Enigmatic Potion of Fire Resistance", + "item.hibernalherbs.enigmatic_potion.effect.harming": "Enigmatic Potion of Harming", + "item.hibernalherbs.enigmatic_potion.effect.healing": "Enigmatic Potion of Healing", + "item.hibernalherbs.enigmatic_potion.effect.infested": "Enigmatic Potion of Infestation", + "item.hibernalherbs.enigmatic_potion.effect.invisibility": "Enigmatic Potion of Invisibility", + "item.hibernalherbs.enigmatic_potion.effect.leaping": "Enigmatic Potion of Leaping", + "item.hibernalherbs.enigmatic_potion.effect.levitation": "Enigmatic Potion of Levitation", + "item.hibernalherbs.enigmatic_potion.effect.luck": "Enigmatic Potion of Luck", + "item.hibernalherbs.enigmatic_potion.effect.mundane": "Mundane Enigmatic Potion", + "item.hibernalherbs.enigmatic_potion.effect.night_vision": "Enigmatic Potion of Night Vision", + "item.hibernalherbs.enigmatic_potion.effect.oozing": "Enigmatic Potion of Oozing", + "item.hibernalherbs.enigmatic_potion.effect.poison": "Enigmatic Potion of Poison", + "item.hibernalherbs.enigmatic_potion.effect.regeneration": "Enigmatic Potion of Regeneration", + "item.hibernalherbs.enigmatic_potion.effect.slow_falling": "Enigmatic Potion of Slow Falling", + "item.hibernalherbs.enigmatic_potion.effect.slowness": "Enigmatic Potion of Slowness", + "item.hibernalherbs.enigmatic_potion.effect.strength": "Enigmatic Potion of Strength", + "item.hibernalherbs.enigmatic_potion.effect.swiftness": "Enigmatic Potion of Swiftness", + "item.hibernalherbs.enigmatic_potion.effect.thick": "Thick Enigmatic Potion", + "item.hibernalherbs.enigmatic_potion.effect.turtle_master": "Enigmatic Potion of the Turtle Master", + "item.hibernalherbs.enigmatic_potion.effect.water": "Enigmatic Water Bottle", + "item.hibernalherbs.enigmatic_potion.effect.water_breathing": "Enigmatic Potion of Water Breathing", + "item.hibernalherbs.enigmatic_potion.effect.weakness": "Enigmatic Potion of Weakness", + "item.hibernalherbs.enigmatic_potion.effect.weaving": "Enigmatic Potion of Weaving", + "item.hibernalherbs.enigmatic_potion.effect.wind_charged": "Enigmatic Potion of Wind Charging", + "item.hibernalherbs.enigmatic_potion.effect.frost_resistance": "Enigmatic Potion of Frost Resistance", + "item.hibernalherbs.enigmatic_potion.effect.swarming": "Enigmatic Potion of Swarming", + "item.hibernalherbs.enigmatic_potion.effect.instability": "Enigmatic Potion of Instability", + "item.hibernalherbs.enigmatic_potion.effect.shrieking": "Enigmatic Potion of Shrieking", + "item.hibernalherbs.solar_potion": "Solar Potion", + "item.hibernalherbs.solar_potion.effect.awkward": "Awkward Solar Potion", + "item.hibernalherbs.solar_potion.effect.empty": "Solar Uncraftable Potion", + "item.hibernalherbs.solar_potion.effect.fire_resistance": "Solar Potion of Fire Resistance", + "item.hibernalherbs.solar_potion.effect.harming": "Solar Potion of Harming", + "item.hibernalherbs.solar_potion.effect.healing": "Solar Potion of Healing", + "item.hibernalherbs.solar_potion.effect.infested": "Solar Potion of Infestation", + "item.hibernalherbs.solar_potion.effect.invisibility": "Solar Potion of Invisibility", + "item.hibernalherbs.solar_potion.effect.leaping": "Solar Potion of Leaping", + "item.hibernalherbs.solar_potion.effect.levitation": "Solar Potion of Levitation", + "item.hibernalherbs.solar_potion.effect.luck": "Solar Potion of Luck", + "item.hibernalherbs.solar_potion.effect.mundane": "Mundane Solar Potion", + "item.hibernalherbs.solar_potion.effect.night_vision": "Solar Potion of Night Vision", + "item.hibernalherbs.solar_potion.effect.oozing": "Solar Potion of Oozing", + "item.hibernalherbs.solar_potion.effect.poison": "Solar Potion of Poison", + "item.hibernalherbs.solar_potion.effect.regeneration": "Solar Potion of Regeneration", + "item.hibernalherbs.solar_potion.effect.slow_falling": "Solar Potion of Slow Falling", + "item.hibernalherbs.solar_potion.effect.slowness": "Solar Potion of Slowness", + "item.hibernalherbs.solar_potion.effect.strength": "Solar Potion of Strength", + "item.hibernalherbs.solar_potion.effect.swiftness": "Solar Potion of Swiftness", + "item.hibernalherbs.solar_potion.effect.thick": "Thick Solar Potion", + "item.hibernalherbs.solar_potion.effect.turtle_master": "Solar Potion of the Turtle Master", + "item.hibernalherbs.solar_potion.effect.water": "Solar Water Bottle", + "item.hibernalherbs.solar_potion.effect.water_breathing": "Solar Potion of Water Breathing", + "item.hibernalherbs.solar_potion.effect.weakness": "Solar Potion of Weakness", + "item.hibernalherbs.solar_potion.effect.weaving": "Solar Potion of Weaving", + "item.hibernalherbs.solar_potion.effect.wind_charged": "Solar Potion of Wind Charging", + "item.hibernalherbs.solar_potion.effect.frost_resistance": "Solar Potion of Frost Resistance", + "item.hibernalherbs.solar_potion.effect.swarming": "Solar Potion of Swarming", + "item.hibernalherbs.solar_potion.effect.instability": "Solar Potion of Instability", + "item.hibernalherbs.solar_potion.effect.shrieking": "Solar Potion of Shrieking", + "item.hibernalherbs.lunar_potion": "Lunar Potion", + "item.hibernalherbs.lunar_potion.effect.awkward": "Awkward Lunar Potion", + "item.hibernalherbs.lunar_potion.effect.empty": "Lunar Uncraftable Potion", + "item.hibernalherbs.lunar_potion.effect.fire_resistance": "Lunar Potion of Fire Resistance", + "item.hibernalherbs.lunar_potion.effect.harming": "Lunar Potion of Harming", + "item.hibernalherbs.lunar_potion.effect.healing": "Lunar Potion of Healing", + "item.hibernalherbs.lunar_potion.effect.infested": "Lunar Potion of Infestation", + "item.hibernalherbs.lunar_potion.effect.invisibility": "Lunar Potion of Invisibility", + "item.hibernalherbs.lunar_potion.effect.leaping": "Lunar Potion of Leaping", + "item.hibernalherbs.lunar_potion.effect.levitation": "Lunar Potion of Levitation", + "item.hibernalherbs.lunar_potion.effect.luck": "Lunar Potion of Luck", + "item.hibernalherbs.lunar_potion.effect.mundane": "Mundane Lunar Potion", + "item.hibernalherbs.lunar_potion.effect.night_vision": "Lunar Potion of Night Vision", + "item.hibernalherbs.lunar_potion.effect.oozing": "Lunar Potion of Oozing", + "item.hibernalherbs.lunar_potion.effect.poison": "Lunar Potion of Poison", + "item.hibernalherbs.lunar_potion.effect.regeneration": "Lunar Potion of Regeneration", + "item.hibernalherbs.lunar_potion.effect.slow_falling": "Lunar Potion of Slow Falling", + "item.hibernalherbs.lunar_potion.effect.slowness": "Lunar Potion of Slowness", + "item.hibernalherbs.lunar_potion.effect.strength": "Lunar Potion of Strength", + "item.hibernalherbs.lunar_potion.effect.swiftness": "Lunar Potion of Swiftness", + "item.hibernalherbs.lunar_potion.effect.thick": "Thick Lunar Potion", + "item.hibernalherbs.lunar_potion.effect.turtle_master": "Lunar Potion of the Turtle Master", + "item.hibernalherbs.lunar_potion.effect.water": "Lunar Water Bottle", + "item.hibernalherbs.lunar_potion.effect.water_breathing": "Lunar Potion of Water Breathing", + "item.hibernalherbs.lunar_potion.effect.weakness": "Lunar Potion of Weakness", + "item.hibernalherbs.lunar_potion.effect.weaving": "Lunar Potion of Weaving", + "item.hibernalherbs.lunar_potion.effect.wind_charged": "Lunar Potion of Wind Charging", + "item.hibernalherbs.lunar_potion.effect.frost_resistance": "Lunar Potion of Frost Resistance", + "item.hibernalherbs.lunar_potion.effect.swarming": "Lunar Potion of Swarming", + "item.hibernalherbs.lunar_potion.effect.instability": "Lunar Potion of Instability", + "item.hibernalherbs.lunar_potion.effect.shrieking": "Lunar Potion of Shrieking" } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/models/item/enigmatic_potion.json b/src/main/resources/assets/hibernalherbs/models/item/enigmatic_potion.json new file mode 100644 index 00000000..a38f55c1 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/models/item/enigmatic_potion.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hibernalherbs:item/mysterious_potion_overlay", + "layer1": "hibernalherbs:item/mysterious_potion" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/models/item/lunar_potion.json b/src/main/resources/assets/hibernalherbs/models/item/lunar_potion.json new file mode 100644 index 00000000..f97e1e68 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/models/item/lunar_potion.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hibernalherbs:item/time_potion_overlay", + "layer1": "hibernalherbs:item/time_potion" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/models/item/solar_potion.json b/src/main/resources/assets/hibernalherbs/models/item/solar_potion.json new file mode 100644 index 00000000..f97e1e68 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/models/item/solar_potion.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hibernalherbs:item/time_potion_overlay", + "layer1": "hibernalherbs:item/time_potion" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/particles/instability.json b/src/main/resources/assets/hibernalherbs/particles/instability.json new file mode 100644 index 00000000..c272a0e0 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/particles/instability.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hibernalherbs:instability" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/particles/shrieking.json b/src/main/resources/assets/hibernalherbs/particles/shrieking.json new file mode 100644 index 00000000..d0c8708c --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/particles/shrieking.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hibernalherbs:shrieking" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/particles/swarming.json b/src/main/resources/assets/hibernalherbs/particles/swarming.json new file mode 100644 index 00000000..e9db09a5 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/particles/swarming.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "hibernalherbs:swarming" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/brewing.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/brewing.json new file mode 100644 index 00000000..353370f4 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/brewing.json @@ -0,0 +1,6 @@ +{ + "name": "Brewing", + "description": "Expanded brewing systems for you to explore.", + "icon": "hibernalherbs:enigmatic_potion[potion_contents={potion:'regeneration'}]", + "sortnum": 5 +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herb_reproduction.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herb_reproduction.json index 02716788..c3ed2bba 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herb_reproduction.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herb_reproduction.json @@ -1,5 +1,6 @@ { "name": "Herb Reproduction", "description": "Want to reproduce your herbs? Here's what you do!", - "icon": "hibernalherbs:spruce_herb_fertilizer" + "icon": "hibernalherbs:spruce_herb_fertilizer", + "sortnum": 1 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herbs.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herbs.json index eb34f65b..a2d230e1 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herbs.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/herbs.json @@ -1,5 +1,6 @@ { "name": "Herbal Basics", "description": "Any information regarding all herbs (Pounded, Non-Pounded, and Dried) can be found here.", - "icon": "hibernalherbs:pounded_chamomile" + "icon": "hibernalherbs:pounded_chamomile", + "sortnum": 0 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/mystical_campfire_conversion.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/mystical_campfire_conversion.json index f2b98abd..ed77ada6 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/mystical_campfire_conversion.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/mystical_campfire_conversion.json @@ -1,5 +1,6 @@ { "name": "Mystical Campfire Conversion", "description": "Transform normality through the mystical arts.", - "icon": "hibernalherbs:mystical_campfire" + "icon": "hibernalherbs:mystical_campfire", + "sortnum": 2 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sin_alignments.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sin_alignments.json index 94440503..03d551fa 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sin_alignments.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sin_alignments.json @@ -1,5 +1,6 @@ { "name": "Sin Alignments", "description": "Not quite making a deal with a devil, but close enough.", - "icon": "hibernalherbs:pride_ashes" + "icon": "hibernalherbs:pride_ashes", + "sortnum": 4 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sorcerer_books.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sorcerer_books.json index 08ccc5f7..5f9fc932 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sorcerer_books.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/sorcerer_books.json @@ -1,5 +1,6 @@ { "name": "Sorcerer's Books", "description": "The Sorcerer books have special abilities that help you progress.", - "icon": "hibernalherbs:agglomeration" + "icon": "hibernalherbs:agglomeration", + "sortnum": 3 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/utilities.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/utilities.json index b62b4c51..cbe7ebf0 100644 --- a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/utilities.json +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/categories/utilities.json @@ -1,5 +1,6 @@ { "name": "Utilities", "description": "Utility blocks and items that may prove useful to you.", - "icon": "hibernalherbs:iron_sickle" + "icon": "hibernalherbs:iron_sickle", + "sortnum": 6 } \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/enigmatic_potions.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/enigmatic_potions.json new file mode 100644 index 00000000..23a37c14 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/enigmatic_potions.json @@ -0,0 +1,27 @@ +{ + "name": "Enigmatic Potions", + "icon": "hibernalherbs:enigmatic_potion[potion_contents={potion:'fire_resistance'}]", + "category": "hibernalherbs:brewing", + "pages": [ + { + "type": "patchouli:spotlight", + "item": "hibernalherbs:enigmatic_potion[potion_contents={potion:'fire_resistance'}]", + "title": "Enigmatic Potions", + "text": "When combining an Enigmatic Extract that contains Mystical Ashes within with a given potion, you can make a secretive Enigmatic Potion! This type of potion makes it so that any effects given to the affected entity by the potion will not show any sort of particles." + }, + { + "type": "hibernalherbs:brewing2", + "input": "minecraft:potion[potion_contents={potion:'fire_resistance'}]", + "ingredient": "hibernalherbs:extract_mystical_ashes", + "output": "hibernalherbs:enigmatic_potion[potion_contents={potion:'fire_resistance'}]", + + "input2": "minecraft:potion[potion_contents={potion:'regeneration'}]", + "ingredient2": "hibernalherbs:extract_mystical_ashes", + "output2": "hibernalherbs:enigmatic_potion[potion_contents={potion:'regeneration'}]" + }, + { + "type": "patchouli:text", + "text": "Consuming Enigmatic Potions while having specific Enigmatic Extracts in your offhand will provide you with benefits.$(br)An Enigmatic Extract with Virtuous Ashes contained within will increase the duration of the effect(s) applied while Enigmatic Extract with Vile Ashes contained within will increase the amplifier of the effect(s) applied." + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/time_dependent_potions.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/time_dependent_potions.json new file mode 100644 index 00000000..87ab0078 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/entries/brewing/time_dependent_potions.json @@ -0,0 +1,31 @@ +{ + "name": "Time Dependent Potions", + "icon": "hibernalherbs:solar_potion[potion_contents={potion:'fire_resistance'}]", + "category": "hibernalherbs:brewing", + "pages": [ + { + "type": "patchouli:spotlight", + "item": "hibernalherbs:solar_potion[potion_contents={potion:'fire_resistance'}]", + "title": "Time Dependent Potions", + "text": "When combining a Clock with a given potion, you can make a potion that has its amplifier and duration increased during the day, but decreased during the night! Perhaps you should try to sleep more often if you take this option." + }, + { + "type": "hibernalherbs:brewing", + "input": "minecraft:potion[potion_contents={potion:'fire_resistance'}]", + "ingredient": "minecraft:clock", + "output": "hibernalherbs:solar_potion[potion_contents={potion:'fire_resistance'}]" + }, + { + "type": "patchouli:spotlight", + "item": "hibernalherbs:lunar_potion[potion_contents={potion:'water_breathing'}]", + "title": "Time Dependent Potions", + "text": "When combining a Clock with any Solar Potion, you can make a potion that has its amplifier and duration increased during the night, but decreased during the day! Finally, someone else who may like phantoms." + }, + { + "type": "hibernalherbs:brewing", + "input": "minecraft:potion[potion_contents={potion:'water_breathing'}]", + "ingredient": "minecraft:sculk", + "output": "hibernalherbs:lunar_potion[potion_contents={potion:'water_breathing'}]" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing.json new file mode 100644 index 00000000..be170876 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing.json @@ -0,0 +1,58 @@ +{ + "components": [ + { + "type": "patchouli:header", + "text": "Brewing", + "x": -1, + "y": -6 + }, + { + "type": "patchouli:image", + "image": "patchouli:textures/gui/crafting.png", + "x": 7, + "y": 2, + "u": 10, + "v": 134, + "texture_width": 128, + "texture_height": 256, + "width": 100, + "height": 62 + }, + { + "type": "patchouli:item", + "item": "#input", + "x": 12, + "y": 7 + }, + { + "type": "patchouli:item", + "item": "#ingredient", + "x": 12, + "y": 26 + }, + { + "type": "patchouli:item", + "item": "#output", + "link_recipe": true, + "x": 84, + "y": 16 + }, + { + "type": "patchouli:item", + "item": "minecraft:blaze_powder", + "x": 49, + "y": 26 + }, + { + "type": "patchouli:text", + "text": "#text", + "y": 69 + }, + { + "type": "patchouli:item", + "item": "minecraft:brewing_stand", + "x": 49, + "y": 7 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing2.json b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing2.json new file mode 100644 index 00000000..ab2b9c44 --- /dev/null +++ b/src/main/resources/assets/hibernalherbs/patchouli_books/grimoire/en_us/templates/brewing2.json @@ -0,0 +1,96 @@ +{ + "components": [ + { + "type": "patchouli:header", + "text": "Brewing", + "x": -1, + "y": -6 + }, + { + "type": "patchouli:image", + "image": "patchouli:textures/gui/crafting.png", + "x": 7, + "y": 2, + "u": 10, + "v": 134, + "texture_width": 128, + "texture_height": 256, + "width": 100, + "height": 62 + }, + { + "type": "patchouli:image", + "image": "patchouli:textures/gui/crafting.png", + "x": 7, + "y": 82, + "u": 10, + "v": 134, + "texture_width": 128, + "texture_height": 256, + "width": 100, + "height": 62 + }, + { + "type": "patchouli:item", + "item": "#input", + "x": 12, + "y": 7 + }, + { + "type": "patchouli:item", + "item": "#ingredient", + "x": 12, + "y": 26 + }, + { + "type": "patchouli:item", + "item": "#output", + "link_recipe": true, + "x": 84, + "y": 16 + }, + { + "type": "patchouli:item", + "item": "#input2", + "x": 12, + "y": 87 + }, + { + "type": "patchouli:item", + "item": "#ingredient2", + "x": 12, + "y": 106 + }, + { + "type": "patchouli:item", + "item": "#output2", + "link_recipe": true, + "x": 84, + "y": 96 + }, + { + "type": "patchouli:item", + "item": "minecraft:blaze_powder", + "x": 49, + "y": 26 + }, + { + "type": "patchouli:item", + "item": "minecraft:blaze_powder", + "x": 49, + "y": 106 + }, + { + "type": "patchouli:item", + "item": "minecraft:brewing_stand", + "x": 49, + "y": 7 + }, + { + "type": "patchouli:item", + "item": "minecraft:brewing_stand", + "x": 49, + "y": 87 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion.png b/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion.png new file mode 100644 index 00000000..1e04f712 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion_overlay.png b/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion_overlay.png new file mode 100644 index 00000000..56bf4ff8 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/item/mysterious_potion_overlay.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/item/time_potion.png b/src/main/resources/assets/hibernalherbs/textures/item/time_potion.png new file mode 100644 index 00000000..8b84f748 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/item/time_potion.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/item/time_potion_overlay.png b/src/main/resources/assets/hibernalherbs/textures/item/time_potion_overlay.png new file mode 100644 index 00000000..ede303a7 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/item/time_potion_overlay.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/mob_effect/instability.png b/src/main/resources/assets/hibernalherbs/textures/mob_effect/instability.png new file mode 100644 index 00000000..a8b722de Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/mob_effect/instability.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/mob_effect/shrieking.png b/src/main/resources/assets/hibernalherbs/textures/mob_effect/shrieking.png new file mode 100644 index 00000000..d7239e9a Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/mob_effect/shrieking.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/mob_effect/swarming.png b/src/main/resources/assets/hibernalherbs/textures/mob_effect/swarming.png new file mode 100644 index 00000000..912e8b63 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/mob_effect/swarming.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/particle/instability.png b/src/main/resources/assets/hibernalherbs/textures/particle/instability.png new file mode 100644 index 00000000..f0d0f76f Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/particle/instability.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/particle/shrieking.png b/src/main/resources/assets/hibernalherbs/textures/particle/shrieking.png new file mode 100644 index 00000000..ce9179a0 Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/particle/shrieking.png differ diff --git a/src/main/resources/assets/hibernalherbs/textures/particle/swarming.png b/src/main/resources/assets/hibernalherbs/textures/particle/swarming.png new file mode 100644 index 00000000..4186c21f Binary files /dev/null and b/src/main/resources/assets/hibernalherbs/textures/particle/swarming.png differ diff --git a/src/main/resources/data/c/tags/item/acceptable_potions_for_brewing.json b/src/main/resources/data/c/tags/item/acceptable_potions_for_brewing.json new file mode 100644 index 00000000..3246e1df --- /dev/null +++ b/src/main/resources/data/c/tags/item/acceptable_potions_for_brewing.json @@ -0,0 +1,7 @@ +{ + "values": [ + "hibernalherbs:enigmatic_potion", + "hibernalherbs:solar_potion", + "hibernalherbs:lunar_potion" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_modifiers/lingering_potions.json b/src/main/resources/data/hibernalherbs/loot_modifiers/lingering_potions.json new file mode 100644 index 00000000..f45e7fb7 --- /dev/null +++ b/src/main/resources/data/hibernalherbs/loot_modifiers/lingering_potions.json @@ -0,0 +1,10 @@ +{ + "type": "neoforge:add_table", + "conditions": [ + { + "condition": "neoforge:loot_table_id", + "loot_table_id": "minecraft:spawners/trial_chamber/items_to_drop_when_ominous" + } + ], + "table": "hibernalherbs:modifiers/lingering_potions" +} \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_modifiers/ominous_vault_loot.json b/src/main/resources/data/hibernalherbs/loot_modifiers/ominous_vault_loot.json new file mode 100644 index 00000000..797f969d --- /dev/null +++ b/src/main/resources/data/hibernalherbs/loot_modifiers/ominous_vault_loot.json @@ -0,0 +1,10 @@ +{ + "type": "neoforge:add_table", + "conditions": [ + { + "condition": "neoforge:loot_table_id", + "loot_table_id": "minecraft:chests/trial_chambers/reward_ominous_unique" + } + ], + "table": "hibernalherbs:modifiers/ominous_vault_loot" +} \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_table/modifiers/lingering_potions.json b/src/main/resources/data/hibernalherbs/loot_table/modifiers/lingering_potions.json new file mode 100644 index 00000000..bb5bee9e --- /dev/null +++ b/src/main/resources/data/hibernalherbs/loot_table/modifiers/lingering_potions.json @@ -0,0 +1,75 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": 1, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:set_potion", + "id": "hibernalherbs:swarming" + } + ], + "name": "minecraft:lingering_potion", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.15 + } + ] + }, + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": 1, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:set_potion", + "id": "hibernalherbs:shrieking" + } + ], + "name": "minecraft:lingering_potion", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.35 + } + ] + }, + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": 1, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:set_potion", + "id": "hibernalherbs:instability" + } + ], + "name": "minecraft:lingering_potion", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.05 + } + ] + } + ], + "rolls": 1 + } + ], + "random_sequence": "hibernalherbs:modifiers/lingering_potions" +} \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_table/modifiers/ominous_vault_loot.json b/src/main/resources/data/hibernalherbs/loot_table/modifiers/ominous_vault_loot.json new file mode 100644 index 00000000..d637fb66 --- /dev/null +++ b/src/main/resources/data/hibernalherbs/loot_table/modifiers/ominous_vault_loot.json @@ -0,0 +1,25 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:tag", + "expand": true, + "weight": 35, + "functions": [ + { + "add": false, + "count": 1, + "function": "minecraft:set_count" + } + ], + "name": "hibernalherbs:herbal_sigils" + } + ], + "rolls": 1 + } + ], + "random_sequence": "hibernalherbs:modifiers/ominous_vault_loot" +} \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/common.json b/src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/common.json similarity index 98% rename from src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/common.json rename to src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/common.json index 247badbd..a7d3ec9f 100644 --- a/src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/common.json +++ b/src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/common.json @@ -172,5 +172,5 @@ ] } ], - "random_sequence": "hibernalherbs:chests/arcane_ruins/common" + "random_sequence": "hibernalherbs:vaults/arcane_ruins/common" } \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/rare.json b/src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/rare.json similarity index 78% rename from src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/rare.json rename to src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/rare.json index e69ba5f6..9904800e 100644 --- a/src/main/resources/data/hibernalherbs/loot_table/chests/arcane_ruins/rare.json +++ b/src/main/resources/data/hibernalherbs/loot_table/vaults/arcane_ruins/rare.json @@ -38,8 +38,39 @@ "weight": 10, "functions": [ { - "function": "minecraft:enchant_randomly", - "options": "#minecraft:on_random_loot" + "function": "minecraft:enchant_with_levels", + "levels": 1, + "options": [ + "hibernalherbs:culling" + ] + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:book", + "weight": 5, + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": 1, + "options": [ + "hibernalherbs:rapid" + ] + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:book", + "weight": 15, + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": 1, + "options": [ + "hibernalherbs:slashing" + ] } ] } @@ -154,5 +185,5 @@ ] } ], - "random_sequence": "hibernalherbs:chests/arcane_ruins/common" + "random_sequence": "hibernalherbs:vaults/arcane_ruins/rare" } \ No newline at end of file diff --git a/src/main/resources/data/hibernalherbs/patchouli_books/grimoire/book.json b/src/main/resources/data/hibernalherbs/patchouli_books/grimoire/book.json index 9222840b..e98128b6 100644 --- a/src/main/resources/data/hibernalherbs/patchouli_books/grimoire/book.json +++ b/src/main/resources/data/hibernalherbs/patchouli_books/grimoire/book.json @@ -1,7 +1,7 @@ { "name": "Herbal Grimoire", "landing_text": "This Grimoire was used to learn what effects herbs had. Studiers of the Dark Arts used herbs to make powerful brews and harnessed the power of the seven princes, altering themselves. Will you do the same?", - "version": 10, + "version": 230627, "use_resource_pack": true, "show_progress": true, "link_color": "3D474C", diff --git a/src/main/resources/data/hibernalherbs/recipe/sorcerer_agglomeration_reset.json b/src/main/resources/data/hibernalherbs/recipe/sorcerer_agglomeration_reset.json index c6cd8cdc..c7f803ac 100644 --- a/src/main/resources/data/hibernalherbs/recipe/sorcerer_agglomeration_reset.json +++ b/src/main/resources/data/hibernalherbs/recipe/sorcerer_agglomeration_reset.json @@ -7,6 +7,11 @@ } ], "result": { + "components": { + "minecraft:custom_data": { + "hibernalherbs:is_being_used": false + } + }, "count": 1, "id": "hibernalherbs:agglomeration" } diff --git a/src/main/resources/data/hibernalherbs/recipe/sorcerer_tome.json b/src/main/resources/data/hibernalherbs/recipe/sorcerer_tome.json index bd787242..acce7e6c 100644 --- a/src/main/resources/data/hibernalherbs/recipe/sorcerer_tome.json +++ b/src/main/resources/data/hibernalherbs/recipe/sorcerer_tome.json @@ -10,6 +10,11 @@ } ], "result": { + "components": { + "minecraft:custom_data": { + "hibernalherbs:is_being_used": false + } + }, "count": 1, "id": "hibernalherbs:tome" } diff --git a/src/main/resources/data/hibernalherbs/structure/arcane_ruins.nbt b/src/main/resources/data/hibernalherbs/structure/arcane_ruins.nbt index 9adf5310..f8f54b94 100644 Binary files a/src/main/resources/data/hibernalherbs/structure/arcane_ruins.nbt and b/src/main/resources/data/hibernalherbs/structure/arcane_ruins.nbt differ diff --git a/src/main/resources/data/hibernalherbs/tags/enchantment/harvests_life_force.json b/src/main/resources/data/hibernalherbs/tags/enchantment/harvests_life_force.json index 5c0064ce..4e30c85f 100644 --- a/src/main/resources/data/hibernalherbs/tags/enchantment/harvests_life_force.json +++ b/src/main/resources/data/hibernalherbs/tags/enchantment/harvests_life_force.json @@ -1,5 +1,6 @@ { "values": [ - "hibernalherbs:slashing" + "hibernalherbs:slashing", + "minecraft:breach" ] } \ No newline at end of file diff --git a/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json b/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json new file mode 100644 index 00000000..370b8d80 --- /dev/null +++ b/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "entries": [ + "hibernalherbs:lingering_potions", + "hibernalherbs:ominous_vault_loot" + ] +} \ No newline at end of file diff --git a/src/main/resources/hibernalherbs.mixins.json b/src/main/resources/hibernalherbs.mixins.json index b2b04dcd..c564224a 100644 --- a/src/main/resources/hibernalherbs.mixins.json +++ b/src/main/resources/hibernalherbs.mixins.json @@ -7,6 +7,7 @@ "EnderManMixin", "GiveGiftToHeroMixin", "LivingEntityMixin", + "MaceItemMixin", "PiglinAiMixin", "PlayerMixin", "VillagerMixin", @@ -14,5 +15,5 @@ ], "injectors": { "defaultRequire": 1 - } + } } \ No newline at end of file