mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-19 19:12:33 +00:00
Fix particle releated crash on bukkit
This commit is contained in:
parent
c658d1a81b
commit
3322a16f09
@ -6,10 +6,15 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|||||||
import com.mojang.brigadier.StringReader;
|
import com.mojang.brigadier.StringReader;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import net.minecraft.commands.arguments.ParticleArgument;
|
import net.minecraft.commands.arguments.ParticleArgument;
|
||||||
|
import net.minecraft.core.HolderLookup;
|
||||||
import net.minecraft.core.HolderLookup.Provider;
|
import net.minecraft.core.HolderLookup.Provider;
|
||||||
|
import net.minecraft.core.HolderLookup.RegistryLookup;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
||||||
|
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientParticleSettings> {
|
public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientParticleSettings> {
|
||||||
@Value("particle")
|
@Value("particle")
|
||||||
@ -26,9 +31,10 @@ public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientPartic
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new AmbientParticleSettings(ParticleArgument.readParticle(new StringReader(particle),
|
return new AmbientParticleSettings(ParticleArgument.readParticle(new StringReader(particle),
|
||||||
(Provider) BuiltInRegistries.PARTICLE_TYPE.asHolderIdMap()), probability);
|
HolderLookup.Provider.create(Stream.of(BuiltInRegistries.PARTICLE_TYPE))), probability);
|
||||||
} catch(CommandSyntaxException e) {
|
} catch(CommandSyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user