feat: creativeNoInfinitePickup & skipTicksForJoblessVillager
This commit is contained in:
9 files changed
+167
-8
No files matched your search
@@ -7,11 +7,14 @@ import com.google.common.collect.MapMaker;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.Version;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.injection.struct.InjectorGroupInfo;
|
||||
@@ -23,6 +26,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraft.server.command.CommandManager.*;
|
||||
|
||||
public class ServerMain implements ModInitializer, CarpetExtension {
|
||||
public static final String MOD_ID = "carpet-sls-addition";
|
||||
public static final String MOD_NAME = "Carpet SLS Addition";
|
||||
@@ -48,12 +53,18 @@ public class ServerMain implements ModInitializer, CarpetExtension {
|
||||
public Map<String, String> canHasTranslations(String lang) {
|
||||
Map<String, String> translation = Maps.newHashMap();
|
||||
String jsonFile;
|
||||
try (InputStream stream = ServerMain.class.getResourceAsStream("/assets/slsaddition/lang/%s.json".formatted(lang))) {
|
||||
jsonFile = new String(stream.readAllBytes());
|
||||
} catch (IOException ignored) {
|
||||
try (InputStream stream = ServerMain.class.getResourceAsStream("/assets/slsaddition/lang/%s.json".formatted("en_us"))) {
|
||||
try {
|
||||
try (InputStream stream = ServerMain.class.getResourceAsStream("/assets/slsaddition/lang/%s.json".formatted(lang))) {
|
||||
assert stream != null;
|
||||
jsonFile = new String(stream.readAllBytes());
|
||||
} catch (IOException e) {
|
||||
}
|
||||
} catch (IOException | NullPointerException ignored) {
|
||||
try {
|
||||
try (InputStream stream = ServerMain.class.getResourceAsStream("/assets/slsaddition/lang/%s.json".formatted("en_us"))) {
|
||||
assert stream != null;
|
||||
jsonFile = new String(stream.readAllBytes());
|
||||
}
|
||||
} catch (IOException | NullPointerException e) {
|
||||
return translation;
|
||||
}
|
||||
}
|
||||
@@ -64,4 +75,8 @@ public class ServerMain implements ModInitializer, CarpetExtension {
|
||||
.forEach(entry -> translation.put(entry.getKey(), entry.getValue()));
|
||||
return translation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandBuildContext) {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user