- My IJ is broke but this should work. Dunno if I got all nms changes, but we will see.
This commit is contained in:
N0tMyFaultOG
2020-08-23 17:18:29 +02:00
parent 1e070b3a71
commit 6cb8352686
31 changed files with 226 additions and 122 deletions

View File

@ -42,4 +42,30 @@ public final class Constants {
));
}
/**
* The DataVersion for Minecraft 1.13
*/
public static final int DATA_VERSION_MC_1_13 = 1519;
/**
* The DataVersion for Minecraft 1.13.2
*/
public static final int DATA_VERSION_MC_1_13_2 = 1631;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_14 = 1952;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_15 = 2225;
/**
* The DataVersion for Minecraft 1.16
*/
public static final int DATA_VERSION_MC_1_16 = 2566;
}

View File

@ -0,0 +1,44 @@
/*
* 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.internal;
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
import com.sk89q.worldedit.util.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class SchematicsEventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(SchematicsEventListener.class);
@Subscribe
public void onConfigLoad(ConfigurationLoadEvent event) {
Path config = event.getConfiguration().getWorkingDirectory().toPath();
try {
Files.createDirectories(config.resolve(event.getConfiguration().saveDir));
} catch (IOException e) {
LOGGER.warn("Failed to create schematics directory", e);
}
}
}

View File

@ -21,6 +21,9 @@ package com.sk89q.worldedit.internal.util;
import com.google.common.base.Joiner;
import com.google.common.base.Throwables;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
@ -106,4 +109,10 @@ public class DeprecationUtil {
|| BlockCategories.SIGNS.contains(blockType);
}
public static String getHeadOwnerKey() {
int dataVersion = WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getDataVersion();
return dataVersion >= Constants.DATA_VERSION_MC_1_16 ? "SkullOwner" : "Owner";
}
}