mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
Fix runtime errors
This commit is contained in:
parent
2ccf8a8805
commit
be7e10c30c
@ -76,6 +76,6 @@ public class MinecraftWorldHandle implements WorldHandle {
|
|||||||
if(!id.contains(":")) throw new IllegalArgumentException("Invalid entity identifier " + id);
|
if(!id.contains(":")) throw new IllegalArgumentException("Invalid entity identifier " + id);
|
||||||
Identifier identifier = Identifier.tryParse(id);
|
Identifier identifier = Identifier.tryParse(id);
|
||||||
if(identifier == null) identifier = Identifier.tryParse(id);
|
if(identifier == null) identifier = Identifier.tryParse(id);
|
||||||
return (EntityType) Registries.ENTITY_TYPE.getEntry(identifier).orElseThrow();
|
return (EntityType) Registries.ENTITY_TYPE.getEntry(identifier).orElseThrow().value();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.state.properties.Property;
|
import com.dfsek.terra.api.block.state.properties.Property;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ public abstract class PropertyMixin<T> {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
public abstract Collection<T> getValues();
|
public abstract List<T> getValues();
|
||||||
|
|
||||||
@Intrinsic
|
@Intrinsic
|
||||||
public Collection<T> terra$values() {
|
public Collection<T> terra$values() {
|
||||||
|
@ -49,9 +49,6 @@ public abstract class WorldChunkMixin {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public abstract net.minecraft.block.BlockState setBlockState(BlockPos pos, net.minecraft.block.BlockState state, boolean moved);
|
public abstract net.minecraft.block.BlockState setBlockState(BlockPos pos, net.minecraft.block.BlockState state, boolean moved);
|
||||||
|
|
||||||
@Shadow
|
|
||||||
public abstract TickSchedulers getTickSchedulers();
|
|
||||||
|
|
||||||
public void terra$setBlock(int x, int y, int z, BlockState data, boolean physics) {
|
public void terra$setBlock(int x, int y, int z, BlockState data, boolean physics) {
|
||||||
BlockPos blockPos = new BlockPos(x, y, z);
|
BlockPos blockPos = new BlockPos(x, y, z);
|
||||||
setBlockState(blockPos, (net.minecraft.block.BlockState) data, false);
|
setBlockState(blockPos, (net.minecraft.block.BlockState) data, false);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.dfsek.terra.lifecycle.mixin.lifecycle;
|
package com.dfsek.terra.lifecycle.mixin.lifecycle;
|
||||||
|
|
||||||
import net.minecraft.registry.DynamicRegistryManager;
|
import net.minecraft.registry.CombinedDynamicRegistries;
|
||||||
import net.minecraft.registry.RegistryKeys;
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.ServerDynamicRegistryType;
|
||||||
import net.minecraft.server.SaveLoading;
|
import net.minecraft.server.SaveLoading;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@ -18,13 +19,11 @@ public class SaveLoadingMixin {
|
|||||||
"Ljava/util/concurrent/CompletableFuture;",
|
"Ljava/util/concurrent/CompletableFuture;",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/registry/RegistryLoader;loadFromResource(Lnet/minecraft/resource/ResourceManager;" +
|
target = "Lnet/minecraft/server/DataPackContents;reload(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/registry/CombinedDynamicRegistries;Ljava/util/List;Lnet/minecraft/resource/featuretoggle/FeatureSet;Lnet/minecraft/server/command/CommandManager$RegistrationEnvironment;ILjava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"),
|
||||||
"Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)" +
|
|
||||||
"Lnet/minecraft/registry/DynamicRegistryManager$Immutable;"),
|
|
||||||
index = 1
|
index = 1
|
||||||
)
|
)
|
||||||
private static DynamicRegistryManager grabManager(DynamicRegistryManager registryManager) {
|
private static CombinedDynamicRegistries<ServerDynamicRegistryType> grabManager(CombinedDynamicRegistries<ServerDynamicRegistryType> dynamicRegistries) {
|
||||||
MinecraftUtil.registerFlora(registryManager.getOrThrow(RegistryKeys.BIOME));
|
MinecraftUtil.registerFlora(dynamicRegistries.getCombinedRegistryManager().getOrThrow(RegistryKeys.BIOME));
|
||||||
return registryManager;
|
return dynamicRegistries;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user