mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
Don't try to resolve the choice type for modded entities. (#4165)
This commit is contained in:
parent
6e4c084dbc
commit
771b444bdf
1 changed files with 5 additions and 2 deletions
|
@ -20,6 +20,7 @@ import java.util.Objects;
|
|||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.mojang.datafixers.DSL;
|
||||
import com.mojang.datafixers.types.Type;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -35,6 +36,7 @@ import net.minecraft.entity.EntityType;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityType;
|
||||
import net.fabricmc.fabric.impl.object.builder.FabricEntityTypeImpl;
|
||||
|
@ -88,8 +90,9 @@ public abstract class EntityTypeBuilderMixin<T extends Entity> implements Fabric
|
|||
}
|
||||
|
||||
@WrapOperation(method = "build", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;getChoiceType(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;"))
|
||||
private @Nullable Type<?> allowNullId(DSL.TypeReference typeReference, String id, Operation<Type<?>> original) {
|
||||
if (id == null) {
|
||||
private @Nullable Type<?> allowNoModdedDatafixers(DSL.TypeReference typeReference, String id, Operation<Type<?>> original, @Local(argsOnly = true) RegistryKey<EntityType<?>> registryKey) {
|
||||
if (!registryKey.getValue().getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) {
|
||||
// Don't try to resolve the choice type for modded entities.
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue