From df715c48a0fae0be12bd98bdb8fd59107dccc492 Mon Sep 17 00:00:00 2001 From: SammySemicolon <69329424+SammySemicolon@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:27:16 +0100 Subject: [PATCH] 1.20 Update to up to date thing --- gradle.properties | 2 +- .../item/curiosities/armor/MalumArmorItem.java | 12 ++++++++++++ .../item/curiosities/armor/SoulHunterArmorItem.java | 1 - .../malum/common/spiritrite/SacredRiteType.java | 1 - .../malum/common/spiritrite/WickedRiteType.java | 2 +- .../spiritrite/greater/EldritchAerialRiteType.java | 1 - .../spiritrite/greater/EldritchAqueousRiteType.java | 2 +- .../spiritrite/greater/EldritchWickedRiteType.java | 2 +- src/main/java/com/sammy/malum/data/MalumRecipes.java | 5 ----- .../data/recipe/MalumSpiritFocusingRecipes.java | 5 ----- .../data/recipe/MalumSpiritInfusionRecipes.java | 5 ----- .../data/recipe/MalumSpiritTransmutationRecipes.java | 5 ----- .../data/recipe/MalumVanillaRecipeReplacements.java | 5 ----- .../malum/visual_effects/RadiantParticleEffects.java | 5 +++-- .../malum/visual_effects/SparkParticleEffects.java | 4 ++-- .../SpiritCrucibleParticleEffects.java | 4 ++-- .../visual_effects/WeepingWellParticleEffects.java | 8 ++++---- 17 files changed, 27 insertions(+), 42 deletions(-) diff --git a/gradle.properties b/gradle.properties index 075a138b4..d0ac4973b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,6 +35,6 @@ modAuthors=Sammy Semicolon # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. modDescription=A dark magic mod focused on soul and spirit magic. # Mod Dependency Versions -lodestoneVersion=1.4.25 +lodestoneVersion=1.4.2.27 jeiVersion=15.2.0.22 curiosVersion=5.4.0+1.20.1 \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/armor/MalumArmorItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/armor/MalumArmorItem.java index 550b140f1..e6ea967e0 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/armor/MalumArmorItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/armor/MalumArmorItem.java @@ -2,6 +2,7 @@ import com.sammy.malum.client.cosmetic.ArmorSkinRenderingData; import com.sammy.malum.common.item.cosmetic.skins.ArmorSkin; +import net.minecraft.*; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -10,7 +11,18 @@ import net.minecraft.world.item.ItemStack; import team.lodestar.lodestone.systems.item.LodestoneArmorItem; +import java.util.*; + public class MalumArmorItem extends LodestoneArmorItem { + + //TODO: access transformer for the vanilla one in ArmorItem is being fucking stupid, just putting this here as a temporary measure + protected static final EnumMap ARMOR_MODIFIER_UUID_PER_TYPE = Util.make(new EnumMap<>(ArmorItem.Type.class), (p_266744_) -> { + p_266744_.put(ArmorItem.Type.BOOTS, UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B")); + p_266744_.put(ArmorItem.Type.LEGGINGS, UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D")); + p_266744_.put(ArmorItem.Type.CHESTPLATE, UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E")); + p_266744_.put(ArmorItem.Type.HELMET, UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")); + }); + public MalumArmorItem(ArmorMaterial materialIn, ArmorItem.Type slot, Properties builder) { super(materialIn, slot, builder); } diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/armor/SoulHunterArmorItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/armor/SoulHunterArmorItem.java index cceb96b06..e42bde177 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/armor/SoulHunterArmorItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/armor/SoulHunterArmorItem.java @@ -31,7 +31,6 @@ public SoulHunterArmorItem(ArmorItem.Type slot, Properties builder) { @Override public ImmutableMultimap.Builder createExtraAttributes(ArmorItem.Type slot) { - ImmutableMultimap.Builder builder = new ImmutableMultimap.Builder<>(); UUID uuid = ARMOR_MODIFIER_UUID_PER_TYPE.get(slot); builder.put(LodestoneAttributeRegistry.MAGIC_PROFICIENCY.get(), new AttributeModifier(uuid, "Magic Proficiency", 2f, AttributeModifier.Operation.ADDITION)); diff --git a/src/main/java/com/sammy/malum/common/spiritrite/SacredRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/SacredRiteType.java index fe3540f74..f642d6f33 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/SacredRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/SacredRiteType.java @@ -1,7 +1,6 @@ package com.sammy.malum.common.spiritrite; import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; -import com.sammy.malum.core.systems.rites.EntityAffectingRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteType; import com.sammy.malum.registry.common.ParticleEffectTypeRegistry; diff --git a/src/main/java/com/sammy/malum/common/spiritrite/WickedRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/WickedRiteType.java index d4b430627..837cbf157 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/WickedRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/WickedRiteType.java @@ -1,7 +1,7 @@ package com.sammy.malum.common.spiritrite; import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; -import com.sammy.malum.core.systems.rites.EntityAffectingRiteEffect; + import com.sammy.malum.core.systems.rites.MalumRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteType; import com.sammy.malum.registry.common.DamageSourceRegistry; diff --git a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAerialRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAerialRiteType.java index 6de888604..f87d320fe 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAerialRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAerialRiteType.java @@ -3,7 +3,6 @@ import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; import com.sammy.malum.common.packets.particle.curiosities.rite.AerialBlockFallRiteEffectPacket; import com.sammy.malum.core.systems.rites.BlockAffectingRiteEffect; -import com.sammy.malum.core.systems.rites.EntityAffectingRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteType; import com.sammy.malum.registry.common.ParticleEffectTypeRegistry; diff --git a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAqueousRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAqueousRiteType.java index 09774979a..86ce1258f 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAqueousRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchAqueousRiteType.java @@ -2,7 +2,7 @@ import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; import com.sammy.malum.core.systems.rites.BlockAffectingRiteEffect; -import com.sammy.malum.core.systems.rites.EntityAffectingRiteEffect; + import com.sammy.malum.core.systems.rites.MalumRiteEffect; import com.sammy.malum.core.systems.rites.MalumRiteType; import com.sammy.malum.registry.common.ParticleEffectTypeRegistry; diff --git a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchWickedRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchWickedRiteType.java index 2977315e8..fcf397934 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchWickedRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/greater/EldritchWickedRiteType.java @@ -41,7 +41,7 @@ public MalumRiteEffect getCorruptedEffect() { return new MalumRiteEffect(MalumRiteEffect.MalumRiteEffectCategory.LIVING_ENTITY_EFFECT) { @Override public void doRiteEffect(TotemBaseBlockEntity totemBase) { - Map, List> animalMap = getNearbyEntities(totemBase, Animal.class, e -> e.getAge() > 0 && !e.isInvulnerableTo(DamageSourceRegistry.VOODOO)).collect(Collectors.groupingBy(Animal::getClass)); + Map, List> animalMap = getNearbyEntities(totemBase, Animal.class, e -> e.getAge() > 0 && !e.isInvulnerableTo(DamageSourceRegistry.create(e.level(), DamageSourceRegistry.VOODOO))).collect(Collectors.groupingBy(Animal::getClass)); for (List animals : animalMap.values()) { if (animals.size() < 20) { return; diff --git a/src/main/java/com/sammy/malum/data/MalumRecipes.java b/src/main/java/com/sammy/malum/data/MalumRecipes.java index e870273d8..f6d7c6ce6 100644 --- a/src/main/java/com/sammy/malum/data/MalumRecipes.java +++ b/src/main/java/com/sammy/malum/data/MalumRecipes.java @@ -47,11 +47,6 @@ public MalumRecipes(PackOutput pOutput) { super(pOutput); } - @Override - public String getName() { - return "Malum Recipe Provider"; - } - @Override protected void buildRecipes(Consumer consumer) { //KEY ITEMS diff --git a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritFocusingRecipes.java b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritFocusingRecipes.java index 0f1c33b10..3e6f16ac8 100644 --- a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritFocusingRecipes.java +++ b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritFocusingRecipes.java @@ -30,11 +30,6 @@ public MalumSpiritFocusingRecipes(PackOutput generatorIn) { super(generatorIn); } - @Override - public String getName() { - return "Malum Spirit Crucible Recipe Provider"; - } - @Override protected void buildRecipes(Consumer consumer) { int metalDuration = 900; diff --git a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritInfusionRecipes.java b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritInfusionRecipes.java index b680cc685..b6de9af40 100644 --- a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritInfusionRecipes.java +++ b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritInfusionRecipes.java @@ -28,11 +28,6 @@ public MalumSpiritInfusionRecipes(PackOutput generatorIn) { super(generatorIn); } - @Override - public String getName() { - return "Malum Spirit Infusion Recipe Provider"; - } - @Override protected void buildRecipes(Consumer consumer) { new SpiritInfusionRecipeBuilder(Items.GUNPOWDER, 1, ItemRegistry.HEX_ASH.get(), 1) diff --git a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritTransmutationRecipes.java b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritTransmutationRecipes.java index e2d1fc9bb..66790a444 100644 --- a/src/main/java/com/sammy/malum/data/recipe/MalumSpiritTransmutationRecipes.java +++ b/src/main/java/com/sammy/malum/data/recipe/MalumSpiritTransmutationRecipes.java @@ -19,11 +19,6 @@ public MalumSpiritTransmutationRecipes(PackOutput generatorIn) { super(generatorIn); } - @Override - public String getName() { - return "Malum Block Transmutation Recipe Provider"; - } - private static final List, RegistryObject>> SOULWOOD_TRANSMUTATIONS = List.of( new Pair<>(RUNEWOOD_SAPLING, SOULWOOD_GROWTH), new Pair<>(RUNEWOOD_LEAVES, SOULWOOD_LEAVES), diff --git a/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipeReplacements.java b/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipeReplacements.java index 731174b65..8dcf09c38 100644 --- a/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipeReplacements.java +++ b/src/main/java/com/sammy/malum/data/recipe/MalumVanillaRecipeReplacements.java @@ -29,11 +29,6 @@ public MalumVanillaRecipeReplacements(PackOutput pOutput) { super(pOutput); } - @Override - public String getName() { - return "Malum Void Favor Recipe Provider"; - } - @Override protected void buildRecipes(Consumer pWriter) { replace(Items.QUARTZ, Tags.Items.GEMS_QUARTZ); diff --git a/src/main/java/com/sammy/malum/visual_effects/RadiantParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/RadiantParticleEffects.java index 67940d540..14152c40c 100644 --- a/src/main/java/com/sammy/malum/visual_effects/RadiantParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/RadiantParticleEffects.java @@ -3,6 +3,7 @@ import com.sammy.malum.common.block.curiosities.weeping_well.*; import com.sammy.malum.visual_effects.networked.data.*; import net.minecraft.core.*; +import net.minecraft.util.*; import net.minecraft.world.level.*; import net.minecraft.world.phys.*; import team.lodestar.lodestone.helpers.*; @@ -31,7 +32,7 @@ public static void spitOutWeepingWellRadiance(Level level, PositionEffectData po double posY = positionEffectData.posY; double posZ = positionEffectData.posZ; Vec3 pos = new Vec3(posX, posY, posZ); - Random rand = level.random; + RandomSource rand = level.random; Consumer spawnBehavior = p -> p.tickParticle(2); for (int i = 0; i < 64; i++) { Color color = RADIANT_COLORS.get((i % 12) / 4); @@ -109,7 +110,7 @@ public static void spitOutWeepingWellRadiance(Level level, PositionEffectData po public static void radiantWeepingWellParticles(VoidConduitBlockEntity voidConduit) { Level level = voidConduit.getLevel(); - Random rand = level.random; + RandomSource rand = level.random; Color color = RADIANT_COLORS.get(((int) level.getGameTime() % 27) / 9); final BlockPos blockPos = voidConduit.getBlockPos(); final ColorParticleData colorData = ColorParticleData.create(color.brighter(), color).setCoefficient(0.5f).build(); diff --git a/src/main/java/com/sammy/malum/visual_effects/SparkParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/SparkParticleEffects.java index 466ee08ab..9ed16126d 100644 --- a/src/main/java/com/sammy/malum/visual_effects/SparkParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/SparkParticleEffects.java @@ -2,6 +2,7 @@ import com.sammy.malum.core.systems.spirit.MalumSpiritType; import com.sammy.malum.registry.client.ParticleRegistry; +import net.minecraft.util.*; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import team.lodestar.lodestone.helpers.RandomHelper; @@ -20,12 +21,11 @@ public class SparkParticleEffects { public static ParticleEffectSpawner spiritMotionSparks(Level level, Vec3 pos, MalumSpiritType spiritType) { - var rand = level.getRandom(); return spiritMotionSparks(level, pos, spiritType.createMainColorData(1.25f).build(), spiritType.createBloomColorData().build()); } public static ParticleEffectSpawner spiritMotionSparks(Level level, Vec3 pos, ColorParticleData colorData, ColorParticleData bloomColorData) { - Random rand = level.getRandom(); + RandomSource rand = level.getRandom(); final SpinParticleData spinData = SpinParticleData.createRandomDirection(rand, nextFloat(rand, 0.05f, 0.1f)).randomSpinOffset(rand).build(); final Consumer slowDown = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.95f)); int lifetime = RandomHelper.randomBetween(rand, 10, 20); diff --git a/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java index e2d23c8f5..fb7a03037 100644 --- a/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java @@ -34,7 +34,7 @@ public static void passiveCrucibleParticles(SpiritCrucibleCoreBlockEntity crucib return; } Level level = crucible.getLevel(); - Random random = level.random; + RandomSource random = level.random; Vec3 itemPos = crucible.getItemPos(); LodestoneBlockEntityInventory spiritInventory = crucible.spiritInventory; SpiritFocusingRecipe recipe = crucible.recipe; @@ -88,7 +88,7 @@ public static void spiritCatalyzerParticles(SpiritCatalyzerCoreBlockEntity catal Level level = catalyzer.getLevel(); BlockPos catalyzerPos = catalyzer.getBlockPos(); Vec3 startPos = catalyzer.getItemOffset().add(catalyzerPos.getX(), catalyzerPos.getY(), catalyzerPos.getZ()); - Random random = level.random; + RandomSource random = level.random; Vec3 targetPos = target.getAccelerationPoint(); Vec3 velocity = targetPos.subtract(startPos).normalize().scale(RandomHelper.randomBetween(random, 0.06f, 0.12f)); if (level.getGameTime() % 2L == 0) { diff --git a/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java index 1296d25cc..43962f243 100644 --- a/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/WeepingWellParticleEffects.java @@ -40,7 +40,7 @@ public static void spitOutItemParticles(Level level, PositionEffectData position double posY = positionEffectData.posY; double posZ = positionEffectData.posZ; Vec3 pos = new Vec3(posX, posY, posZ); - Random rand = level.random; + RandomSource rand = level.random; Color color = getWeepingWellSmokeColor(rand); ColorParticleData colorData = ColorParticleData.create(color, color.darker()).setCoefficient(0.5f).build(); Consumer spawnBehavior = p -> p.tickParticle(2); @@ -153,13 +153,13 @@ public static void passiveWeepingWellParticles(VoidConduitBlockEntity voidCondui public static ParticleEffectSpawner weepingWellSparks(Level level, Vec3 pos) { - Random rand = level.random; + RandomSource rand = level.random; Color color = getWeepingWellSmokeColor(rand); ColorParticleData colorData = ColorParticleData.create(color, color.darker()).setCoefficient(0.5f).build(); return weepingWellSparks(level, pos, colorData, LodestoneWorldParticleRenderType.LUMITRANSPARENT); } public static ParticleEffectSpawner weepingWellSparks(Level level, Vec3 pos, ColorParticleData colorData, LodestoneWorldParticleRenderType renderType) { - Random rand = level.random; + RandomSource rand = level.random; var lightSpecs = SparkParticleEffects.spiritMotionSparks(level, pos, colorData, colorData); lightSpecs.getBuilder().act(b -> b .setRenderType(renderType) @@ -199,7 +199,7 @@ public static ParticleEffectSpawner weepingWellSpecs(Level return lightSpecs; } public static ParticleEffectSpawner weepingWellSquare(Level level, Vec3 pos, ColorParticleData colorData) { - Random rand = level.random; + RandomSource rand = level.random; final GenericParticleData scaleData = GenericParticleData.create(0.1f, RandomHelper.randomBetween(rand, 1.7f, 1.8f), 0.5f).setEasing(Easing.SINE_OUT, Easing.SINE_IN).setCoefficient(RandomHelper.randomBetween(rand, 1f, 1.25f)).build(); final Consumer behavior = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.95f)); float yMotion = RandomHelper.randomBetween(rand, 0.04f, 0.06f);