mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 16:35:50 +00:00
Quilt progress 2
This commit is contained in:
parent
8d19368999
commit
639fc71f7a
3
.gitignore
vendored
3
.gitignore
vendored
@ -247,6 +247,5 @@ nbdist/
|
||||
|
||||
**/testDir/
|
||||
|
||||
platforms/fabric/run/**
|
||||
platforms/**/run/**
|
||||
|
||||
platforms/forge/run/**
|
||||
|
@ -19,6 +19,9 @@ package com.dfsek.terra.fabric;
|
||||
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.fabric.FabricServerCommandManager;
|
||||
|
||||
import com.dfsek.terra.lifecycle.util.RegistryUtil;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import org.slf4j.Logger;
|
||||
@ -43,7 +46,6 @@ public class FabricEntryPoint implements ModInitializer {
|
||||
commandSender -> (ServerCommandSource) commandSender
|
||||
);
|
||||
|
||||
|
||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||
|
||||
TERRA_PLUGIN.getEventManager().callEvent(new CommandRegistrationEvent(manager));
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.dfsek.terra.fabric.mixin;
|
||||
|
||||
import com.dfsek.terra.lifecycle.util.RegistryUtil;
|
||||
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
|
||||
@Mixin(Registry.class)
|
||||
public class RegistryMixin {
|
||||
@Inject(method = "<clinit>", at = @At("RETURN"))
|
||||
private static void registerTerraGenerators(CallbackInfo ci) {
|
||||
RegistryUtil.register();
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@
|
||||
"package": "com.dfsek.terra.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"RegistryMixin"
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
|
@ -31,7 +31,7 @@ import com.dfsek.terra.api.handle.WorldHandle;
|
||||
|
||||
public class MinecraftWorldHandle implements WorldHandle {
|
||||
|
||||
private static final BlockState AIR = (BlockState) Blocks.AIR.getDefaultState();
|
||||
private static BlockState AIR = null;
|
||||
|
||||
@Override
|
||||
public @NotNull BlockState createBlockState(@NotNull String data) {
|
||||
@ -46,6 +46,7 @@ public class MinecraftWorldHandle implements WorldHandle {
|
||||
|
||||
@Override
|
||||
public @NotNull BlockState air() {
|
||||
if (AIR == null) AIR = (BlockState) Blocks.AIR.getDefaultState();
|
||||
return AIR;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"NoiseConfigMixin",
|
||||
"RegistryMixin",
|
||||
"lifecycle.MinecraftServerMixin"
|
||||
],
|
||||
"client": [
|
||||
|
@ -19,6 +19,9 @@ package com.dfsek.terra.quilt;
|
||||
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.fabric.FabricServerCommandManager;
|
||||
|
||||
import com.dfsek.terra.lifecycle.util.RegistryUtil;
|
||||
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import org.quiltmc.loader.api.ModContainer;
|
||||
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
||||
@ -43,6 +46,7 @@ public class QuiltEntryPoint implements ModInitializer {
|
||||
commandSender -> (ServerCommandSource) commandSender
|
||||
);
|
||||
|
||||
RegistryUtil.register();
|
||||
|
||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user