datagen fix
This commit is contained in:
26
build.gradle
26
build.gradle
@@ -147,22 +147,22 @@ dependencies {
|
||||
implementation "mezz.jei:jei-${jei_minecraft_version}:${jei_version}"
|
||||
implementation "com.tterrag.registrate:Registrate:${registrate_version}"
|
||||
implementation "dev.xkmc:l2serial:${l2serial_ver}"
|
||||
implementation "vazkii.patchouli:Patchouli:${patchouli_ver}"
|
||||
compileOnly "vazkii.patchouli:Patchouli:${patchouli_ver}"
|
||||
|
||||
|
||||
runtimeOnly "dev.xkmc:l2damagetracker:3.0.3+2"
|
||||
runtimeOnly "dev.xkmc:l2menustacker:3.0.9"
|
||||
runtimeOnly "dev.xkmc:l2itemselector:3.0.8"
|
||||
runtimeOnly "dev.xkmc:l2library:3.0.2+4"
|
||||
runtimeOnly "dev.xkmc:l2complements:3.0.2+7"
|
||||
runtimeOnly "dev.xkmc:l2archery:3.0.0+8"
|
||||
//runtimeOnly "dev.xkmc:l2damagetracker:3.0.3+2"
|
||||
//runtimeOnly "dev.xkmc:l2menustacker:3.0.9"
|
||||
//runtimeOnly "dev.xkmc:l2itemselector:3.0.8"
|
||||
//runtimeOnly "dev.xkmc:l2library:3.0.2+4"
|
||||
//runtimeOnly "dev.xkmc:l2complements:3.0.2+7"
|
||||
//runtimeOnly "dev.xkmc:l2archery:3.0.0+8"
|
||||
|
||||
runtimeOnly "curse.maven:embeddium-908741:5630163"
|
||||
runtimeOnly "curse.maven:farmers-delight-398521:5566383"
|
||||
runtimeOnly "dev.xkmc:cuisinedelight:1.2.2"
|
||||
//runtimeOnly "curse.maven:embeddium-908741:5630163"
|
||||
//runtimeOnly "curse.maven:farmers-delight-398521:5566383"
|
||||
//runtimeOnly "dev.xkmc:cuisinedelight:1.2.2"
|
||||
|
||||
implementation "curse.maven:enchantment-descriptions-250419:5760047"
|
||||
implementation "curse.maven:bookshelf-228525:5757624"
|
||||
implementation "curse.maven:prickle-1023259:5757615"
|
||||
//implementation "curse.maven:enchantment-descriptions-250419:5760047"
|
||||
//implementation "curse.maven:bookshelf-228525:5757624"
|
||||
//implementation "curse.maven:prickle-1023259:5757615"
|
||||
|
||||
}
|
||||
@@ -18,14 +18,14 @@ loader_version_range=[2,)
|
||||
mod_id=l2core
|
||||
mod_name=L2Core
|
||||
mod_license=LGPL-2.1
|
||||
mod_version=3.0.8+1
|
||||
mod_version=3.0.8+3
|
||||
mod_group_id=dev.xkmc
|
||||
mod_authors=lcy0x1
|
||||
mod_description=Core Library mod for all L2 mods
|
||||
|
||||
|
||||
jei_minecraft_version = 1.21-neoforge
|
||||
jei_version = 19.5.0.44
|
||||
jei_minecraft_version = 1.21.1-neoforge
|
||||
jei_version = 19.21.0.246
|
||||
registrate_version = MC1.21-1.3.0+50
|
||||
patchouli_ver = 1.21-87-NEOFORGE-SNAPSHOT
|
||||
|
||||
|
||||
@@ -3,22 +3,28 @@ package dev.xkmc.l2core.base.effects;
|
||||
import dev.xkmc.l2core.base.effects.api.ForceEffect;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import net.neoforged.neoforge.event.entity.living.MobEffectEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class EffectUtil {
|
||||
|
||||
private static final Set<EntityType<?>> INVALID = new HashSet<>();
|
||||
|
||||
/**
|
||||
* force add effect, make hard not override
|
||||
* for icon use only, such as Arcane Mark on Wither and Ender Dragon
|
||||
*/
|
||||
private static void forceAddEffect(LivingEntity e, MobEffectInstance ins, @Nullable Entity source) {
|
||||
private synchronized static void forceAddEffect(LivingEntity e, MobEffectInstance ins, @Nullable Entity source) {
|
||||
if (INVALID.contains(e.getType())) return;
|
||||
MobEffectInstance old = e.activeEffects.get(ins.getEffect());
|
||||
var event = new ForceAddEffectEvent(e, ins);
|
||||
NeoForge.EVENT_BUS.post(event);
|
||||
@@ -27,7 +33,12 @@ public class EffectUtil {
|
||||
}
|
||||
NeoForge.EVENT_BUS.post(new MobEffectEvent.Added(e, old, ins, source));
|
||||
if (old == null) {
|
||||
e.activeEffects.put(ins.getEffect(), ins);
|
||||
try {
|
||||
e.activeEffects.put(ins.getEffect(), ins);
|
||||
} catch (Exception ignored) {
|
||||
INVALID.add(e.getType());
|
||||
return;
|
||||
}
|
||||
e.onEffectAdded(ins, source);
|
||||
ins.onEffectAdded(e);
|
||||
} else if (old.update(ins)) {
|
||||
|
||||
@@ -127,6 +127,10 @@ public class ClientEffectRenderEvents {
|
||||
}
|
||||
}
|
||||
|
||||
if (entity == Minecraft.getInstance().getCameraEntity()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int n = index;
|
||||
int w = (int) Math.ceil(Math.sqrt(n));
|
||||
int h = (int) Math.ceil(n * 1d / w);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BaseRecipeBuilder<
|
||||
.rewards(AdvancementRewards.Builder.recipe(id))
|
||||
.requirements(AdvancementRequirements.Strategy.OR);
|
||||
this.criteria.forEach(builder::addCriterion);
|
||||
id = ResourceLocation.fromNamespaceAndPath(id.getNamespace(), "recipes/" +
|
||||
id = ResourceLocation.fromNamespaceAndPath(id.getNamespace(),
|
||||
BuiltInRegistries.RECIPE_SERIALIZER.getKey(type).getPath() + "/" + id.getPath());
|
||||
pvd.accept(id, recipe, builder.build(id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user