mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Disable watchdog ticking by default, //watchdog to turn on
This commit is contained in:
@ -34,6 +34,7 @@ import net.minecraft.SharedConstants;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.PlayerManager;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Identifier;
|
||||
@ -64,8 +65,8 @@ class FabricPlatform extends AbstractPlatform implements MultiUserPlatform {
|
||||
this.mod = mod;
|
||||
this.server = server;
|
||||
this.dataFixer = new FabricDataFixer(getDataVersion());
|
||||
this.watchdog = server instanceof DedicatedServer
|
||||
? new FabricWatchdog((MixinMinecraftServer) (Object) server) : null;
|
||||
this.watchdog = server instanceof MinecraftDedicatedServer
|
||||
? new FabricWatchdog((MinecraftDedicatedServer) server) : null;
|
||||
}
|
||||
|
||||
boolean isHookingEvents() {
|
||||
|
@ -1,19 +1,39 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.fabric;
|
||||
|
||||
import com.sk89q.worldedit.extension.platform.Watchdog;
|
||||
import com.sk89q.worldedit.fabric.mixin.MixinMinecraftServer;
|
||||
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
|
||||
import net.minecraft.util.SystemUtil;
|
||||
|
||||
class FabricWatchdog implements Watchdog {
|
||||
|
||||
private final MixinMinecraftServer server;
|
||||
private final MinecraftDedicatedServer server;
|
||||
|
||||
FabricWatchdog(MixinMinecraftServer server) {
|
||||
FabricWatchdog(MinecraftDedicatedServer server) {
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
server.timeReference = SystemUtil.getMeasuringTimeMs();
|
||||
((MixinMinecraftServer) (Object) server).timeReference = SystemUtil.getMeasuringTimeMs();
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.fabric.mixin;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@ -11,8 +30,8 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
@Mixin(MinecraftServer.class)
|
||||
public abstract class MixinMinecraftServer extends NonBlockingThreadExecutor<ServerTask> implements SnooperListener, CommandOutput, AutoCloseable, Runnable {
|
||||
|
||||
public MixinMinecraftServer(String string_1) {
|
||||
super(string_1);
|
||||
public MixinMinecraftServer(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Shadow
|
||||
|
Reference in New Issue
Block a user