Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1-aria-for-painters' into 1…
Browse files Browse the repository at this point in the history
….20.1-aria-for-painters
  • Loading branch information
DaFuqs committed Nov 16, 2024
2 parents 46db6cc + 15c9d9f commit 734e9a6
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 41 deletions.
Binary file added raw/assets/11⁄11⁄2024.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ public static void buildTooltip(List<Text> tooltip, List<InkPoweredStatusEffectI
}

InkCost cost = entry.getInkCost();


if (effect == null) {
tooltip.add(Text.translatable("item.spectrum.potion.tooltip.invalid"));
continue;
}
MutableText mutableText = Text.translatable(effect.getTranslationKey());
if (effect.getAmplifier() > 0) {
mutableText = Text.translatable("potion.withAmplifier", mutableText, Text.translatable("potion.potency." + effect.getAmplifier()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat
float chance = state.get(LOGGED) == FluidLogging.State.LIQUID_CRYSTAL ? 1.0F : 0.5F;
int nextAge = age + random.nextBetween(1, (int) Math.ceil(attempts * chance));

if (nextAge >= 7) {
if (nextAge >= 8) {
ItemEntity pearlEntity = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(SpectrumItems.MERMAIDS_GEM, 1));
world.spawnEntity(pearlEntity);
}

world.setBlockState(pos, state.with(AGE, nextAge % 8), Block.NOTIFY_NEIGHBORS | Block.NOTIFY_LISTENERS);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.dafuqs.spectrum.blocks.spirit_instiller;

import de.dafuqs.matchbooks.recipe.*;
import de.dafuqs.spectrum.*;
import de.dafuqs.spectrum.api.block.*;
import de.dafuqs.spectrum.api.color.*;
import de.dafuqs.spectrum.blocks.*;
Expand Down Expand Up @@ -42,6 +43,8 @@ public class SpiritInstillerBlockEntity extends InWorldInteractionBlockEntity im
add(new Vec3i(2, 0, 0));
add(new Vec3i(-2, 0, 0));
}};

private static final Identifier JADE_VINE_CROSSBREEDING = SpectrumCommon.locate("spirit_instiller/secret/germinated_jade_vine_crossbreeding");

private final Inventory autoCraftingInventory; // 0: instiller stack; 1-2: item bowl stacks
private boolean inventoryChanged;
Expand Down Expand Up @@ -202,21 +205,25 @@ private static boolean checkRecipeRequirements(World world, BlockPos blockPos, @
}

if (lastInteractedPlayer instanceof ServerPlayerEntity serverPlayerEntity) {
testAndUnlockUnlockBossMemoryAdvancement(serverPlayerEntity, spiritInstillerBlockEntity.currentRecipe, canCraft);
testAndUnlockRecipeAdvancements(serverPlayerEntity, spiritInstillerBlockEntity.currentRecipe, canCraft);
}

return canCraft & spiritInstillerBlockEntity.currentRecipe.canPlayerCraft(lastInteractedPlayer) && spiritInstillerBlockEntity.currentRecipe.canCraftWithStacks(spiritInstillerBlockEntity.autoCraftingInventory);
}

public static void testAndUnlockUnlockBossMemoryAdvancement(ServerPlayerEntity player, SpiritInstillerRecipe spiritInstillerRecipe, boolean canActuallyCraft) {
boolean isBossMemory = spiritInstillerRecipe.getGroup() != null && spiritInstillerRecipe.getGroup().equals("boss_memories");
if (isBossMemory) {
public static void testAndUnlockRecipeAdvancements(ServerPlayerEntity player, SpiritInstillerRecipe spiritInstillerRecipe, boolean canActuallyCraft) {
// boss memory advancements
if (spiritInstillerRecipe.getGroup() != null && spiritInstillerRecipe.getGroup().equals("boss_memories")) {
if (canActuallyCraft) {
Support.grantAdvancementCriterion(player, "midgame/craft_blacklisted_memory_success", "succeed_crafting_boss_memory");
} else {
Support.grantAdvancementCriterion(player, "midgame/craft_blacklisted_memory_fail", "fail_to_craft_boss_memory");
}
}
// jade vine crossbreeding advancement
if (spiritInstillerRecipe.getId().equals(JADE_VINE_CROSSBREEDING)) {
Support.grantAdvancementCriterion(player, "lategame/create_jade_vine", "crossbred_jade_vine_bulb");
}
}

public static void craftSpiritInstillerRecipe(World world, @NotNull SpiritInstillerBlockEntity spiritInstillerBlockEntity, @NotNull SpiritInstillerRecipe spiritInstillerRecipe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ private void ascend(int blastMod) {
var distance = Math.sqrt(transmutePos.getSquaredDistance(getBlockPos()));
if (distance <= 6 * blastMod || random.nextFloat() < 1 / ((distance - 6) / 3)) {
var candidate = world.getBlockState(transmutePos);

// Do not the bedrock nor the claims
if (candidate.getHardness(world, transmutePos) < 0 || !CommonProtectionApiCompat.canBreak(world, transmutePos, this))
continue;

if (candidate.isAir()) {
if (random.nextFloat() < 0.125F) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static BlockState getCursedBlockColorVariant(World world, BlockPos blockP

BlockState blockState = world.getBlockState(blockPos);

if (blockState.isIn(SpectrumBlockTags.INK_EFFECT_BLACKLISTED)) {
if (blockState.isIn(SpectrumBlockTags.INK_EFFECT_BLACKLISTED) || blockState.getHardness(world,blockPos) == -1) {
return Blocks.AIR.getDefaultState();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ private boolean tryApplyOil(ItemStack oil, ItemStack food, PlayerEntity user) {
.anyMatch(e -> e.equals(effect.getStatusEffectInstance().getEffectType())))
return false;

var instance = effect.getStatusEffectInstance();
if (instance == null)
return true;

var compound = new NbtCompound();
compound.putUuid(POISONER_KEY, user.getUuid());
effect.getStatusEffectInstance().writeNbt(compound);
instance.writeNbt(compound);
food.getOrCreateNbt().put(OIL_EFFECT_ID, compound);
return true;
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/de/dafuqs/spectrum/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import de.dafuqs.spectrum.cca.*;
import de.dafuqs.spectrum.enchantments.InexorableEnchantment;
import de.dafuqs.spectrum.mixin.accessors.*;
import de.dafuqs.spectrum.registries.*;
import de.dafuqs.spectrum.status_effects.*;
import net.minecraft.enchantment.*;
Expand Down Expand Up @@ -76,7 +77,11 @@ public abstract class EntityMixin {
@ModifyReturnValue(method = "getPose", at = @At("RETURN"))
public EntityPose spectrum$forceSleepPose(EntityPose original) {
var entity = (Entity) (Object) this;
if (entity instanceof LivingEntity living && !(entity instanceof PlayerEntity) && (living.hasStatusEffect(SpectrumStatusEffects.ETERNAL_SLUMBER) || living.hasStatusEffect(SpectrumStatusEffects.FATAL_SLUMBER)))

if (!(entity instanceof LivingEntity living) || ((LivingEntityAccessor) living).getActiveStatusEffects() == null)
return original;

if (!(entity instanceof PlayerEntity) && (living.hasStatusEffect(SpectrumStatusEffects.ETERNAL_SLUMBER) || living.hasStatusEffect(SpectrumStatusEffects.FATAL_SLUMBER)))
return EntityPose.SLEEPING;

return original;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package de.dafuqs.spectrum.mixin.accessors;

import net.minecraft.entity.effect.*;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;

import java.util.*;

@Mixin(LivingEntity.class)
public interface LivingEntityAccessor {
@Accessor
DamageSource getLastDamageSource();

@Accessor("lastDamageSource")
public void setLastDamageSource(DamageSource damageSource);

@Accessor()
Map<StatusEffect, StatusEffectInstance> getActiveStatusEffects();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.dafuqs.spectrum.recipe.fluid_converting.dynamic;

import com.neep.neepmeat.init.NMItems;
import de.dafuqs.spectrum.compat.SpectrumIntegrationPacks;
import de.dafuqs.spectrum.recipe.*;
import de.dafuqs.spectrum.recipe.fluid_converting.*;
import net.minecraft.item.*;
Expand All @@ -18,7 +20,7 @@ public MeatToRottenFleshRecipe(Identifier identifier) {
private static Ingredient getMeatsIngredient() {
return Ingredient.ofStacks(Registries.ITEM.stream().filter(item -> {
FoodComponent foodComponent = item.getFoodComponent();
return item != Items.ROTTEN_FLESH && foodComponent != null && foodComponent.isMeat();
return item != Items.ROTTEN_FLESH && !(SpectrumIntegrationPacks.isIntegrationPackActive(SpectrumIntegrationPacks.NEEPMEAT_ID) && item == NMItems.MEAT_SCRAP) && foodComponent != null && foodComponent.isMeat();
}).map(ItemStack::new));
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/assets/spectrum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2955,13 +2955,13 @@
"book.spectrum.guidebook.jade_vines.page0.text": "The remaining energy of this plant from eons ago is barely still perceptible. So featherweight and fragile that I feel any false move could breathe the last bit of life out of this fragile bulb.\\\n\\\n*Will the history of this plant remain elusive to me forever?*",
"book.spectrum.guidebook.jade_vines.page1.text": "Once almost a lost cause, I now have an ace up my sleeve:\\\nWith the help of the [Spirit Instiller](entry://creating_life/spirit_instiller) I'm sure I can breathe some life back into the little deadish bulb.",
"book.spectrum.guidebook.jade_vines.page1.title": "Germinating",
"book.spectrum.guidebook.jade_vines.page2.text": "Pallid, fragile but beautiful hanging plants, twining down wooden fences with generous space underneath.\\\n[#](8f2121)Not used to intense light after all these eons, they will die if exposed to too much sunlight.\\\n[#](98ff37)They only grow one stage a night and only when exposed to the much softer, indirect light of the moon.",
"book.spectrum.guidebook.jade_vines.page2.text": "Pallid, fragile but beautiful hanging plants, twining down wooden fences with generous space underneath.\\\n[#](8f2121)Not used to intense light after all these eons, they will die if exposed to too much sunlight.\\\n[#](449900)They only grow one stage a night and only when exposed to the much softer, indirect light of the moon.",
"book.spectrum.guidebook.jade_vines.page2.title": "Planting & Growing",
"book.spectrum.guidebook.jade_vines.page3.text": "As I exposed one of the plants to strong sunlight, I found that it had withered. Not only did this withered shrub leave me now only with new Bulbs, but also with this gel-like jelly, though!\\\n\\\n*Unexpectedly tasty*.",
"book.spectrum.guidebook.jade_vines.page4.text": "When Jade Jelly is heated blazingly fast and then cooled down again, the result is a very viscous but sugar-sweet mass.\\\n\\\n*Fancy a sugar rush?*",
"book.spectrum.guidebook.jade_vines.page5.text": "Shiny petals can be plucked when partially grown.\\\nThey can be used for decoration and rarely, I can find [#](449900)another Bulb[#]() when searching through the petals.\\\n\\\nWhat will Jade Vines look like when I let them grow further, tough?",
"book.spectrum.guidebook.jade_vines.page5.text": "Shiny petals can be plucked when partially grown.\\\nThey can be used for decoration and rarely, I can find [#](449900)another Bulb[#]() when searching through the petals.\\\n\\\nWhat will Jade Vines look like when I let them grow further, though?",
"book.spectrum.guidebook.jade_vines.page5.title": "Petals",
"book.spectrum.guidebook.jade_vines.page6.text": "After many full moon nights, the plants reach full bloom. I was able to gather collect some nectar from their blossoms by using a [#](bb00bb)Glass Bottle[#]().\\\nBears great restorative properties:\n- can be drunk for healing\n- able to repair any damaged item.",
"book.spectrum.guidebook.jade_vines.page6.text": "After many nights, when the moon is full, the plants reach full bloom. I was able to collect some nectar from their blossoms by using a [#](bb00bb)Glass Bottle[#]().\\\n\\\nThe nectar has great restorative properties:\n- can be drunk for healing\n- able to repair any damaged item.",
"book.spectrum.guidebook.jade_wine.page0.text": "Since the [Jade Vines](entry://general/jade_vines) are notorious for their restorative properties, it's no wonder they translate perfectly when fermented.\\\nIn contrast to the slight bitterness of the bulbs, adding a good portion of petals brings out a more floral and slightly tart flavor, complemented by earthy undertones - almost resembling wine, in their characteristic jade color.",
"book.spectrum.guidebook.jade_wine.page1.text": "[#](bb00bb)1 Bulb[#]() and [#](bb00bb)3 Petals[#]() for the [#](bb00bb)Bucket of Water[#]() feel like a good starting point.\\\nThe longer the fermentation goes on, the stronger the taste gets.\\\n\\\n*A bit of [#](bb00bb)added sweetness[#]()* would do it good, I'm sure.",
"book.spectrum.guidebook.jade_wine.page2.text": "Adding a drop of [#](bb00bb)Moonstruck Nectar[#]() made the wine much easier to drink. The fermentation process is accelerated and negative effects are noticeably mitigated.",
Expand Down Expand Up @@ -4792,6 +4792,7 @@
"item.spectrum.potion.faster_to_drink": "Faster to drink",
"item.spectrum.potion.slower_to_drink": "Slower to drink",
"item.spectrum.potion.tooltip.unidentifiable": "§0Blackened beyond recognition",
"item.spectrum.potion.tooltip.invalid": "§5[?]",
"item.spectrum.potion.tooltip.incurable": "§5[Incurable]",
"item.spectrum.potion_pendant.tooltip_max_level": "§7Supports Effects up to level ",
"item.spectrum.potion_pendant.tooltip_not_full_count": "§7Fill with up to §f%d§7 Effects in the §fPotion Workshop",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@
},
"collected_draconic_twinsword": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"conditions": { "items": [{ "items": [ "spectrum:draconic_twinsword" ]}] }
"conditions": {
"items": [{ "items": [ "spectrum:draconic_twinsword" ]}]
}
},
"collected_nectar_lance": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"conditions": { "items": [{ "items": [ "spectrum:nectar_lance" ]}] }
"conditions": {
"items": [{ "items": [ "spectrum:nectar_lance" ]}]
}
},
"collected_nightfalls_blade": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"conditions": { "items": [{ "items": [ "spectrum:nightfalls_blade" ]}] }
"items": [{ "items": [ "spectrum:nightfalls_blade" ]}]
}
},
"collected_dreamflayer": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"conditions": { "items": [{ "items": [ "spectrum:dreamflayer" ]}] }
"items": [{ "items": [ "spectrum:dreamflayer" ]}]
}
},
"gotten_previous": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@
},
"parent": "spectrum:lategame/spectrum_lategame",
"criteria": {
"created_germinated_jade_vine_bulb": {
"trigger": "spectrum:crafted_with_spirit_instiller",
"conditions": {
"items": [
{
"items": [
"spectrum:germinated_jade_vine_bulb"
]
}
]
}
"crossbred_jade_vine_bulb": {
"trigger": "minecraft:impossible"
},
"gotten_previous": {
"trigger": "revelationary:advancement_gotten",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
"trigger": "spectrum:trinket_change",
"conditions": {
"items": [
{
"items": [
"spectrum:ring_of_aerial_grace",
"spectrum:ring_of_denser_steps"
]
}
{"items": [ "spectrum:ring_of_aerial_grace" ]},
{"items": [ "spectrum:ring_of_denser_steps" ]}
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
},
"description": {
"translate": "advancements.spectrum.become_enlightened.description"
}
},
"hidden": true
},
"hidden": true,
"criteria": {
"confirmed": {
"trigger": "minecraft:impossible"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
"condition": {
"type": "modonomicon:advancement",
"advancement_id": "spectrum:hidden/instilled_germinated_jade_vine_bulb"
"advancement_id": "spectrum:midgame/harvest_moonstruck_nectar"
},
"text": "book.spectrum.guidebook.jade_vines.page6.text"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"values": [
"spectrum:black_chiseled_preservation_stone",
"spectrum:blue_chiseled_preservation_stone",
"spectrum:brown_chiseled_preservation_stone",
"spectrum:cyan_chiseled_preservation_stone",
"spectrum:gray_chiseled_preservation_stone",
"spectrum:green_chiseled_preservation_stone",
"spectrum:light_blue_chiseled_preservation_stone",
"spectrum:light_gray_chiseled_preservation_stone",
"spectrum:lime_chiseled_preservation_stone",
"spectrum:magenta_chiseled_preservation_stone",
"spectrum:orange_chiseled_preservation_stone",
"spectrum:pink_chiseled_preservation_stone",
"spectrum:purple_chiseled_preservation_stone",
"spectrum:red_chiseled_preservation_stone",
"spectrum:white_chiseled_preservation_stone",
"spectrum:yellow_chiseled_preservation_stone"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

]
}

0 comments on commit 734e9a6

Please sign in to comment.