mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +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/
|
**/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.execution.CommandExecutionCoordinator;
|
||||||
import cloud.commandframework.fabric.FabricServerCommandManager;
|
import cloud.commandframework.fabric.FabricServerCommandManager;
|
||||||
|
|
||||||
|
import com.dfsek.terra.lifecycle.util.RegistryUtil;
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -43,7 +46,6 @@ public class FabricEntryPoint implements ModInitializer {
|
|||||||
commandSender -> (ServerCommandSource) commandSender
|
commandSender -> (ServerCommandSource) commandSender
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||||
|
|
||||||
TERRA_PLUGIN.getEventManager().callEvent(new CommandRegistrationEvent(manager));
|
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",
|
"package": "com.dfsek.terra.fabric.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
"RegistryMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
],
|
],
|
||||||
|
@ -31,7 +31,7 @@ import com.dfsek.terra.api.handle.WorldHandle;
|
|||||||
|
|
||||||
public class MinecraftWorldHandle implements WorldHandle {
|
public class MinecraftWorldHandle implements WorldHandle {
|
||||||
|
|
||||||
private static final BlockState AIR = (BlockState) Blocks.AIR.getDefaultState();
|
private static BlockState AIR = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull BlockState createBlockState(@NotNull String data) {
|
public @NotNull BlockState createBlockState(@NotNull String data) {
|
||||||
@ -46,6 +46,7 @@ public class MinecraftWorldHandle implements WorldHandle {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull BlockState air() {
|
public @NotNull BlockState air() {
|
||||||
|
if (AIR == null) AIR = (BlockState) Blocks.AIR.getDefaultState();
|
||||||
return AIR;
|
return AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"NoiseConfigMixin",
|
"NoiseConfigMixin",
|
||||||
"RegistryMixin",
|
|
||||||
"lifecycle.MinecraftServerMixin"
|
"lifecycle.MinecraftServerMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
|
@ -19,6 +19,9 @@ package com.dfsek.terra.quilt;
|
|||||||
|
|
||||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||||
import cloud.commandframework.fabric.FabricServerCommandManager;
|
import cloud.commandframework.fabric.FabricServerCommandManager;
|
||||||
|
|
||||||
|
import com.dfsek.terra.lifecycle.util.RegistryUtil;
|
||||||
|
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import org.quiltmc.loader.api.ModContainer;
|
import org.quiltmc.loader.api.ModContainer;
|
||||||
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
||||||
@ -43,6 +46,7 @@ public class QuiltEntryPoint implements ModInitializer {
|
|||||||
commandSender -> (ServerCommandSource) commandSender
|
commandSender -> (ServerCommandSource) commandSender
|
||||||
);
|
);
|
||||||
|
|
||||||
|
RegistryUtil.register();
|
||||||
|
|
||||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user