Add forge 1.16.1 support

This commit is contained in:
Blue (Lukas Rieger) 2020-07-30 16:45:22 +02:00
parent 4646e78969
commit a2067107a0
6 changed files with 20 additions and 30 deletions

View File

@ -12,7 +12,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle'
minecraft {
mappings channel: 'snapshot', version: '20190719-1.14.3'
mappings channel: 'snapshot', version: '20200514-1.16'
}
configurations {
@ -20,7 +20,7 @@ configurations {
}
dependencies {
minecraft 'net.minecraftforge:forge:1.15.2-31.1.0'
minecraft 'net.minecraftforge:forge:1.16.1-32.0.97'
include (project(':BlueMapCommon')) {
//exclude dependencies provided by forge
@ -33,7 +33,7 @@ dependencies {
}
build.dependsOn shadowJar {
destinationDir = file '../build/unsupported'
destinationDir = file '../build/release'
archiveFileName = "BlueMap-${version}-forge.jar"
configurations = [project.configurations.include]

View File

@ -33,7 +33,6 @@
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.core.world.World;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.server.ServerWorld;
@ -51,7 +50,7 @@ public ForgeCommandSource(ForgeMod mod, Plugin plugin, net.minecraft.command.Com
@Override
public void sendMessage(Text text) {
delegate.sendFeedback(ITextComponent.Serializer.fromJson(text.toJSONString()), false);
delegate.sendFeedback(ITextComponent.Serializer.func_240643_a_(text.toJSONString()), false);
}
@Override
@ -61,7 +60,7 @@ public boolean hasPermission(String permission) {
@Override
public Optional<Vector3d> getPosition() {
Vec3d pos = delegate.getPos();
net.minecraft.util.math.vector.Vector3d pos = delegate.getPos();
if (pos != null) {
return Optional.of(new Vector3d(pos.x, pos.y, pos.z));
}

View File

@ -42,6 +42,8 @@
import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface;
import de.bluecolored.bluemap.core.logger.Logger;
import net.minecraft.command.CommandSource;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.DimensionType;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
@ -88,7 +90,7 @@ public void onServerStarting(FMLServerStartingEvent event) {
}
//register commands
this.commands = new Commands<>(bluemap, event.getCommandDispatcher(), forgeSource -> new ForgeCommandSource(this, bluemap, forgeSource));
this.commands = new Commands<>(bluemap, event.getServer().getCommandManager().getDispatcher(), forgeSource -> new ForgeCommandSource(this, bluemap, forgeSource));
new Thread(() -> {
try {
@ -189,14 +191,11 @@ public UUID getUUIDForWorld(ServerWorld world) throws IOException {
}
private File getFolderForWorld(ServerWorld world) throws IOException {
File worldFolder = world.getSaveHandler().getWorldDirectory();
int dimensionId = world.getDimension().getType().getId();
if (dimensionId != 0) {
worldFolder = new File(worldFolder, "DIM" + dimensionId);
}
return worldFolder.getCanonicalFile();
MinecraftServer server = world.getServer();
String worldName = server.func_240793_aU_().getWorldName();
File worldFolder = new File(world.getServer().getDataDirectory(), worldName);
File dimensionFolder = DimensionType.func_236031_a_(world.func_234923_W_(), worldFolder);
return dimensionFolder.getCanonicalFile();
}
@Override

View File

@ -20,6 +20,6 @@ A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebG
[[dependencies.bluemap]]
modId="minecraft"
mandatory=true
versionRange="[1.15.2]"
versionRange="[1.16.1]"
ordering="NONE"
side="SERVER"

View File

@ -1,14 +0,0 @@
[
{
"modid": "bluemap",
"name": "BlueMap",
"version": "${version}",
"description": "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)",
"url": "https://github.com/BlueMap-Minecraft",
"authorList": [
"Blue (TBlueF, Lukas Rieger)"
],
"dependencies": [],
"requiredMods": []
}
]

View File

@ -0,0 +1,6 @@
{
"pack": {
"description": "BlueMap - A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)",
"pack_format": 5
}
}