Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assorted bug fixes #653

Merged
merged 9 commits into from
Jan 2, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import de.dafuqs.spectrum.mixin.accessors.*;
import de.dafuqs.spectrum.registries.SpectrumStatusEffects;
import de.dafuqs.spectrum.registries.SpectrumStatusEffectTags;
import net.minecraft.entity.*;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.network.packet.s2c.play.*;
Expand All @@ -16,7 +16,7 @@ public interface Incurable {

static boolean isIncurable(StatusEffectInstance instance) {
var type = instance.getEffectType();
if (type == SpectrumStatusEffects.ETERNAL_SLUMBER || type == SpectrumStatusEffects.FATAL_SLUMBER)
if (SpectrumStatusEffectTags.cannotBeIncurable(type))
return false;

return ((Incurable) instance).spectrum$isIncurable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public static int getRequiredExperienceForEnchantment(int enchantability, Enchan
default -> rarityCost = 80;
}

float levelCost = level + ((float) level / enchantment.getMaxLevel()); // the higher the level, the pricier. But not as bad for enchantments with high max levels
float levelCost = level * Math.min(1, (float) level / enchantment.getMaxLevel()); // the higher the level, the pricier. But not as bad for enchantments with high max levels
float specialMulti = enchantment.isTreasure() ? 2.0F : enchantment.isCursed() ? 1.5F : 1.0F;
float selectionAvailabilityMod = 1.0F;
if (!(enchantment instanceof SpectrumEnchantment)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ private static boolean hasUniqueReagents(PotionWorkshopBlockEntity potionWorksho
}

private static boolean isBrewingRecipeApplicable(PotionWorkshopBrewingRecipe recipe, ItemStack baseIngredient, PotionWorkshopBlockEntity potionWorkshopBlockEntity) {
return hasUniqueReagents(potionWorkshopBlockEntity) && recipe.recipeData.isApplicableTo(baseIngredient, getPotionModFromReagents(potionWorkshopBlockEntity));
PotionMod potionMod = getPotionModFromReagents(potionWorkshopBlockEntity);
return hasUniqueReagents(potionWorkshopBlockEntity) && recipe.recipeData.isApplicableTo(baseIngredient, potionMod)
&& !(potionMod.incurable && SpectrumStatusEffectTags.cannotBeIncurable(recipe.recipeData.statusEffect()));
}

private static void craftRecipe(PotionWorkshopBlockEntity potionWorkshopBlockEntity, PotionWorkshopCraftingRecipe recipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public class SpectrumAdvancements {

// Revelations
public static final Identifier REVEAL_AMARANTH = SpectrumCommon.locate("milestones/reveal_amaranth");
public static final Identifier REVEAL_AZURITE = locate("milestones/reveal_azurite");
public static final Identifier REVEAL_AZURITE = SpectrumCommon.locate("milestones/reveal_azurite");
public static final Identifier REVEAL_BLOOD_ORCHID_PETALS = SpectrumCommon.locate("milestones/reveal_blood_orchid_petals");
public static final Identifier REVEAL_COLORED_SAPLINGS_CMY = SpectrumCommon.locate("milestones/reveal_colored_saplings_cmy");
public static final Identifier REVEAL_COLORED_TREES_BLACK = SpectrumCommon.locate("milestones/reveal_colored_trees_k");
public static final Identifier REVEAL_COLORED_TREES_CMY = SpectrumCommon.locate("milestones/reveal_colored_trees_cmy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class SpectrumItemTags {
public static final TagKey<Item> EMISSIVE = of("emissive");
public static final TagKey<Item> PASTEL_NODE_UPGRADES = of("pastel_node_upgrades");
public static final TagKey<Item> TAG_FILTERING_ITEMS = of("tag_filtering_items");
public static final TagKey<Item> WEEPING_GALA_LOGS = of("weeping_gala_logs");

private static TagKey<Item> of(String id) {
return TagKey.of(RegistryKeys.ITEM, SpectrumCommon.locate(id));
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/de/dafuqs/spectrum/registries/SpectrumItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public Map<Enchantment, Integer> getDefaultEnchantments() {

public static final Item JADEITE_PETALS = new Item(IS.of(Rarity.UNCOMMON));

public static final Item BLOOD_ORCHID_PETAL = new CloakedItem(IS.of(), SpectrumAdvancements.SOLVE_WIRELESS_REDSTONE_PRESERVATION_RUIN, Items.RED_DYE);
public static final Item BLOOD_ORCHID_PETAL = new CloakedItem(IS.of(), SpectrumAdvancements.REVEAL_BLOOD_ORCHID_PETALS, Items.RED_DYE);

public static final Item ROCK_CANDY = new RockCandyItem(IS.of().food(SpectrumFoodComponents.ROCK_CANDY), RockCandy.RockCandyVariant.SUGAR);
public static final Item TOPAZ_ROCK_CANDY = new RockCandyItem(IS.of().food(SpectrumFoodComponents.TOPAZ_ROCK_CANDY), RockCandy.RockCandyVariant.TOPAZ);
Expand Down Expand Up @@ -1005,6 +1005,18 @@ public static void registerFuelRegistry() {

FuelRegistry.INSTANCE.add(SpectrumItemTags.COLORED_FENCES, 300);
FuelRegistry.INSTANCE.add(SpectrumItemTags.COLORED_FENCE_GATES, 300);

// gala wood burns twice as long as normal
FuelRegistry.INSTANCE.add(SpectrumItemTags.WEEPING_GALA_LOGS, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_PLANKS, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_STAIRS, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_DOOR, 400);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_FENCE, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_PRESSURE_PLATE, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_TRAPDOOR, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_FENCE_GATE, 600);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_BUTTON, 200);
FuelRegistry.INSTANCE.add(SpectrumBlocks.WEEPING_GALA_SLAB, 300);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class SpectrumStatusEffectTags {
public static TagKey<StatusEffect> BYPASSES_WHISPY_CIRCLET;
public static TagKey<StatusEffect> BYPASSES_NECTAR_GLOVES;
public static TagKey<StatusEffect> BYPASSES_IMMUNITY;
public static TagKey<StatusEffect> CANNOT_BE_INCURABLE;
public static TagKey<StatusEffect> NO_DURATION_EXTENSION;
public static TagKey<StatusEffect> SOPORIFIC;
public static TagKey<StatusEffect> NIGHT_ALCHEMY;
Expand All @@ -19,6 +20,7 @@ public static void register() {
BYPASSES_WHISPY_CIRCLET = of("bypasses_whispy_circlet");
BYPASSES_NECTAR_GLOVES = of("bypasses_nectar_gloves");
BYPASSES_IMMUNITY = of("bypasses_immunity");
CANNOT_BE_INCURABLE = of("cannot_be_incurable");
NO_DURATION_EXTENSION = of("no_duration_extension");
SOPORIFIC = of("soporific");
NIGHT_ALCHEMY = of("night_alchemy");
Expand All @@ -43,6 +45,10 @@ public static boolean bypassesNectarGloves(StatusEffect statusEffect) {
public static boolean bypassesWhispyCirclet(StatusEffect statusEffect) {
return isIn(SpectrumStatusEffectTags.BYPASSES_WHISPY_CIRCLET, statusEffect);
}

public static boolean cannotBeIncurable(StatusEffect statusEffect) {
return isIn(SpectrumStatusEffectTags.CANNOT_BE_INCURABLE, statusEffect);
}

public static boolean hasEffectWithTag(LivingEntity livingEntity, TagKey<StatusEffect> tag) {
for (StatusEffect statusEffect : livingEntity.getActiveStatusEffects().keySet()) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/spectrum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3983,7 +3983,7 @@
"book.spectrum.guidebook.weeping_gala.lantern.text": "I made two variants. I can switch between then by sneaking while placing it.",
"book.spectrum.guidebook.weeping_gala.light.text": "Bright as can be",
"book.spectrum.guidebook.weeping_gala.name": "Weeping Galas",
"book.spectrum.guidebook.weeping_gala.page0.text": "Imposing willows adorned with pale leaves. Its sprigs weep with a sticky, sweet resin that can be used as a [Milk](item://minecraft:milk_bucket) substitute.\\\n\\\nI wonder how they grow so large when their leaves don't even have chlorophyll.",
"book.spectrum.guidebook.weeping_gala.page0.text": "Imposing willows adorned with pale leaves. The sprigs weep with a sticky, sweet resin that can be used as a [Milk](item://minecraft:milk_bucket) substitute. The wood is incredibly dense, making it much slower to burn than most other woods.\\\n\\\nI wonder how they grow so large when their leaves don't even have chlorophyll?",
"book.spectrum.guidebook.weeping_gala.page1.text": "*Gala... milk tree... wait - GALACTOSE!*",
"book.spectrum.guidebook.weeping_gala.pillar.text": "*dainty*",
"book.spectrum.guidebook.what_happened.name": "What happened down there?",
Expand Down Expand Up @@ -5154,7 +5154,7 @@
"spectrum.recipe.fusion_shrine.explanation.no_rgb": "Saw you peeking",
"spectrum.recipe.fusion_shrine.explanation.ominous_sapling": "Requires daytime",
"spectrum.recipe.fusion_shrine.explanation.onyx_shard": "Midnight on a new moon only",
"spectrum.recipe.fusion_shrine.explanation.soothing_bouquet": "Perform at the height of slumber",
"spectrum.recipe.fusion_shrine.explanation.soothing_bouquet": "Perform at the darkest hour",
"spectrum.recipe.fusion_shrine.explanation.paltaeria_gem": "Requires a thunderstorm",
"spectrum.recipe.fusion_shrine.explanation.shooting_star_hardening": "Protects star from breaking",
"spectrum.recipe.fusion_shrine.explanation.spectral_shard": "The perfect Compound",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"criteria": {
"solved_wireless_redstone_ruin": {
"trigger": "revelationary:advancement_gotten",
"conditions": {
"advancement_identifier": "spectrum:solve_wireless_redstone_preservation_ruin"
}
},
"entered_undergrowth_manor": {
"trigger": "revelationary:advancement_gotten",
"conditions": {
"advancement_identifier": "spectrum:lategame/find_undergrowth_manor"
}
}
},
"requirements": [
[
"solved_wireless_redstone_ruin",
"entered_undergrowth_manor"
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,28 @@
"name": "spectrum:bristle_sprouts",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,28 @@
"name": "spectrum:giant_moss_ball",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
]
}
Expand Down
26 changes: 22 additions & 4 deletions src/main/resources/data/spectrum/loot_tables/blocks/moss_ball.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,28 @@
"name": "spectrum:moss_ball",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,28 @@
"name": "spectrum:varia_sprout",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"tag": "c:shears"
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "spectrum:ink_converting",
"ingredient": {
"item": "botania:black_petal_block"
},
"ink_color": "spectrum:black",
"amount": 225,
"required_advancement": "spectrum:hidden/collect_pigment/black",
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"botania"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "spectrum:ink_converting",
"ingredient": {
"item": "botania:blue_petal_block"
},
"ink_color": "spectrum:blue",
"amount": 225,
"required_advancement": "spectrum:hidden/collect_pigment/blue",
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"botania"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "spectrum:ink_converting",
"ingredient": {
"item": "botania:brown_petal_block"
},
"ink_color": "spectrum:brown",
"amount": 225,
"required_advancement": "spectrum:hidden/collect_pigment/brown",
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"botania"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "spectrum:ink_converting",
"ingredient": {
"item": "botania:cyan_petal_block"
},
"ink_color": "spectrum:cyan",
"amount": 225,
"required_advancement": "spectrum:hidden/collect_pigment/cyan",
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"botania"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "spectrum:ink_converting",
"ingredient": {
"item": "botania:gray_petal_block"
},
"ink_color": "spectrum:gray",
"amount": 225,
"required_advancement": "spectrum:hidden/collect_pigment/gray",
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"botania"
]
}
]
}
Loading
Loading