Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 019adaf46f | |||
| 6f55ed7e8e | |||
| 12c58f69b3 |
@@ -88,3 +88,13 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在lophine新建文件的补丁(注意不要提交);
|
||||
5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
|
||||
6. 将修改后的补丁 PR 发回储存库。
|
||||
|
||||
## 为配置项提供本地化的注释支持
|
||||
|
||||
1. 在 `lophine-server/src/main/resources/assets/lophine/lang` 目录下创建或修改相应的语言文件,添加本地化的注释;
|
||||
- 文件的名字应当符合 `https://minecraft.wiki/w/Language` 页面下的格式,如 `en_us` `zh_cn` `zh_hk` `zh_tw`,文件以 `json` 为格式类型;
|
||||
2. 运行 Gradle 任务 `sortLangKeys` 来对你的语言文件内容进行重排序;
|
||||
3. 使用 `git commit -m <提交信息>` 进行提交;
|
||||
4. 将你修改的文件进行推送。
|
||||
|
||||
这样做以后,你就可以将你的修改进行 PR 提交。
|
||||
|
||||
@@ -91,3 +91,13 @@ You can modify an existing patch by following the steps below:
|
||||
4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate lophine-created files to patches (PS: do not commit again before you run this task)
|
||||
5. Run Gradle's task `rebuildAllServerPatches` to modify existing patches
|
||||
6. Push and PR again
|
||||
|
||||
## Providing localized comment support for configuration entries
|
||||
|
||||
1. Create or modify the corresponding language file under the `lophine-server/src/main/resources/assets/lophine/lang` directory to add localized comments;
|
||||
- The file name should follow the format listed on the `https://minecraft.wiki/w/Language` page, such as `en_us`, `zh_cn`, `zh_hk`, `zh_tw`. The file format is `json`;
|
||||
2. Run the Gradle task `sortLangKeys` to re-sort the keys in your language file;
|
||||
3. Commit your changes using `git commit -m <Commit Message>`;
|
||||
4. Push your modified files to your repository.
|
||||
|
||||
After pushing, you can open a PR to submit your changes.
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
public class BarSubcommand extends LiteralNode {
|
||||
public BarSubcommand(EnumBarType barType) {
|
||||
super(barType.getCommandName());
|
||||
super(barType.getName());
|
||||
children(
|
||||
new ToggleCommand(barType),
|
||||
new ConfigEditCommand(barType)
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
package me.earthme.luminol.utils;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.generator.BiomeProvider;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.PluginBase;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.PluginLoader;
|
||||
import org.bukkit.plugin.PluginLogger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
public class NullPlugin extends PluginBase {
|
||||
private final String pluginName;
|
||||
private boolean enabled = true;
|
||||
private PluginDescriptionFile pdf;
|
||||
|
||||
public NullPlugin() {
|
||||
this.pluginName = "Minecraft";
|
||||
pdf = new PluginDescriptionFile(pluginName, "1.0", "nms");
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getDataFolder() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginDescriptionFile getDescription() {
|
||||
return pdf;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() {
|
||||
return pdf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileConfiguration getConfig() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public InputStream getResource(String filename) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveConfig() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDefaultConfig() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveResource(String resourcePath, boolean replace) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginLogger getLogger() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginLoader getPluginLoader() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Server getServer() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaggable() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNaggable(boolean canNag) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable BiomeProvider getDefaultBiomeProvider(@NotNull String worldName, @Nullable String id) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
|
||||
// Paper start - lifecycle events
|
||||
@Override
|
||||
public @NotNull io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager<org.bukkit.plugin.Plugin> getLifecycleManager() {
|
||||
throw new UnsupportedOperationException("Not supported.");
|
||||
}
|
||||
// Paper end - lifecycle events
|
||||
}
|
||||
+2
-2
@@ -21,12 +21,12 @@ import com.mojang.brigadier.arguments.BoolArgumentType;
|
||||
import fun.bm.lophine.LophineLogger;
|
||||
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
|
||||
import me.earthme.luminol.config.modules.experiment.CommandConfig;
|
||||
import me.earthme.luminol.utils.NullPlugin;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.waypoints.ServerWaypointManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.command.CommandContext;
|
||||
import org.leavesmc.leaves.plugin.MinecraftInternalPlugin;
|
||||
|
||||
public class LocatorBarConfig extends AbstractBotConfig<Boolean, LocatorBarConfig> {
|
||||
private boolean value;
|
||||
@@ -60,7 +60,7 @@ public class LocatorBarConfig extends AbstractBotConfig<Boolean, LocatorBarConfi
|
||||
manager.untrackWaypoint(this.bot);
|
||||
}
|
||||
} else {
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(new NullPlugin(), (task0) -> setValue(value, count + 1), 20);
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(MinecraftInternalPlugin.INSTANCE, (_) -> setValue(value, count + 1), 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -21,11 +21,11 @@ import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import fun.bm.lophine.LophineLogger;
|
||||
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
|
||||
import me.earthme.luminol.utils.NullPlugin;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.command.CommandContext;
|
||||
import org.leavesmc.leaves.plugin.MinecraftInternalPlugin;
|
||||
|
||||
import static net.minecraft.network.chat.Component.literal;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class SimulationDistanceConfig extends AbstractBotConfig<Integer, Simulat
|
||||
if (this.bot != null) {
|
||||
this.setValue(nbt.getIntOr(getName(), FakeplayerConfig.getSimulationDistance(this.bot)));
|
||||
} else {
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(new NullPlugin(), (task0) -> load(nbt, count + 1), 20);
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(MinecraftInternalPlugin.INSTANCE, (_) -> load(nbt, count + 1), 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,11 +20,11 @@ package org.leavesmc.leaves.bot.agent.configs;
|
||||
import com.mojang.brigadier.arguments.BoolArgumentType;
|
||||
import fun.bm.lophine.LophineLogger;
|
||||
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
|
||||
import me.earthme.luminol.utils.NullPlugin;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.command.CommandContext;
|
||||
import org.leavesmc.leaves.plugin.MinecraftInternalPlugin;
|
||||
|
||||
public class SkipSleepConfig extends AbstractBotConfig<Boolean, SkipSleepConfig> {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SkipSleepConfig extends AbstractBotConfig<Boolean, SkipSleepConfig>
|
||||
if (this.bot != null) {
|
||||
bot.fauxSleeping = value;
|
||||
} else {
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(new NullPlugin(), (task0) -> setValue(value, count + 1), 20);
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(MinecraftInternalPlugin.INSTANCE, (_) -> setValue(value, count + 1), 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -20,7 +20,6 @@ package org.leavesmc.leaves.protocol.servux.litematics.placement;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import fun.bm.lophine.config.modules.function.protocol.ServuxProtocolConfig;
|
||||
import io.papermc.paper.threadedregions.RegionizedServer;
|
||||
import me.earthme.luminol.utils.NullPlugin;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.minecraft.core.BlockBox;
|
||||
@@ -36,6 +35,7 @@ import net.minecraft.world.phys.AABB;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.plugin.MinecraftInternalPlugin;
|
||||
import org.leavesmc.leaves.protocol.servux.ServuxProtocol;
|
||||
import org.leavesmc.leaves.protocol.servux.litematics.LitematicaSchematic;
|
||||
import org.leavesmc.leaves.protocol.servux.litematics.selection.Box;
|
||||
@@ -342,13 +342,13 @@ public class SchematicPlacement {
|
||||
}
|
||||
);
|
||||
|
||||
final NullPlugin nullPlugin = new NullPlugin();
|
||||
final MinecraftInternalPlugin nullPlugin = MinecraftInternalPlugin.INSTANCE;
|
||||
scheduleTask(nullPlugin, serverWorld, count, count_full, player, timeStart, ServuxProtocolConfig.maxDelay);
|
||||
}
|
||||
|
||||
private void scheduleTask(Plugin plugin, ServerLevel serverWorld, AtomicInteger count1, AtomicInteger count2, ServerPlayer player, long timeStart, int retryCount) {
|
||||
Bukkit.getGlobalRegionScheduler().runDelayed(plugin,
|
||||
(unused) -> {
|
||||
(_) -> {
|
||||
if (count1.get() >= count2.get()) {
|
||||
long timeElapsed = System.currentTimeMillis() - timeStart;
|
||||
player.getBukkitEntity().sendActionBar(
|
||||
|
||||
Reference in New Issue
Block a user