Skip to content

Commit

Permalink
1.20 Update to up to date thing
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Nov 21, 2023
1 parent d7d63b7 commit df715c4
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 42 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<ArmorItem.Type, UUID> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public SoulHunterArmorItem(ArmorItem.Type slot, Properties builder) {

@Override
public ImmutableMultimap.Builder<Attribute, AttributeModifier> createExtraAttributes(ArmorItem.Type slot) {

ImmutableMultimap.Builder<Attribute, AttributeModifier> 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));
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public MalumRiteEffect getCorruptedEffect() {
return new MalumRiteEffect(MalumRiteEffect.MalumRiteEffectCategory.LIVING_ENTITY_EFFECT) {
@Override
public void doRiteEffect(TotemBaseBlockEntity totemBase) {
Map<Class<? extends Animal>, List<Animal>> animalMap = getNearbyEntities(totemBase, Animal.class, e -> e.getAge() > 0 && !e.isInvulnerableTo(DamageSourceRegistry.VOODOO)).collect(Collectors.groupingBy(Animal::getClass));
Map<Class<? extends Animal>, List<Animal>> animalMap = getNearbyEntities(totemBase, Animal.class, e -> e.getAge() > 0 && !e.isInvulnerableTo(DamageSourceRegistry.create(e.level(), DamageSourceRegistry.VOODOO))).collect(Collectors.groupingBy(Animal::getClass));
for (List<Animal> animals : animalMap.values()) {
if (animals.size() < 20) {
return;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/sammy/malum/data/MalumRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public MalumRecipes(PackOutput pOutput) {
super(pOutput);
}

@Override
public String getName() {
return "Malum Recipe Provider";
}

@Override
protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
//KEY ITEMS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FinishedRecipe> consumer) {
int metalDuration = 900;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FinishedRecipe> consumer) {
new SpiritInfusionRecipeBuilder(Items.GUNPOWDER, 1, ItemRegistry.HEX_ASH.get(), 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public MalumSpiritTransmutationRecipes(PackOutput generatorIn) {
super(generatorIn);
}

@Override
public String getName() {
return "Malum Block Transmutation Recipe Provider";
}

private static final List<Pair<RegistryObject<Block>, RegistryObject<Block>>> SOULWOOD_TRANSMUTATIONS = List.of(
new Pair<>(RUNEWOOD_SAPLING, SOULWOOD_GROWTH),
new Pair<>(RUNEWOOD_LEAVES, SOULWOOD_LEAVES),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FinishedRecipe> pWriter) {
replace(Items.QUARTZ, Tags.Items.GEMS_QUARTZ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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<LodestoneWorldParticleActor> spawnBehavior = p -> p.tickParticle(2);
for (int i = 0; i < 64; i++) {
Color color = RADIANT_COLORS.get((i % 12) / 4);
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,12 +21,11 @@
public class SparkParticleEffects {

public static ParticleEffectSpawner<SparkParticleBuilder> 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<SparkParticleBuilder> 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<LodestoneWorldParticleActor> slowDown = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.95f));
int lifetime = RandomHelper.randomBetween(rand, 10, 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LodestoneWorldParticleActor> spawnBehavior = p -> p.tickParticle(2);
Expand Down Expand Up @@ -153,13 +153,13 @@ public static void passiveWeepingWellParticles(VoidConduitBlockEntity voidCondui


public static ParticleEffectSpawner<SparkParticleBuilder> 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<SparkParticleBuilder> 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)
Expand Down Expand Up @@ -199,7 +199,7 @@ public static ParticleEffectSpawner<WorldParticleBuilder> weepingWellSpecs(Level
return lightSpecs;
}
public static ParticleEffectSpawner<DirectionalParticleBuilder> 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<LodestoneWorldParticleActor> behavior = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.95f));
float yMotion = RandomHelper.randomBetween(rand, 0.04f, 0.06f);
Expand Down

0 comments on commit df715c4

Please sign in to comment.