mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-23 02:55:19 +01:00
Add forge 1.16.1 support
This commit is contained in:
parent
4646e78969
commit
a2067107a0
@ -12,7 +12,7 @@ buildscript {
|
|||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
mappings channel: 'snapshot', version: '20190719-1.14.3'
|
mappings channel: 'snapshot', version: '20200514-1.16'
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
@ -20,7 +20,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft 'net.minecraftforge:forge:1.15.2-31.1.0'
|
minecraft 'net.minecraftforge:forge:1.16.1-32.0.97'
|
||||||
|
|
||||||
include (project(':BlueMapCommon')) {
|
include (project(':BlueMapCommon')) {
|
||||||
//exclude dependencies provided by forge
|
//exclude dependencies provided by forge
|
||||||
@ -33,7 +33,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn shadowJar {
|
build.dependsOn shadowJar {
|
||||||
destinationDir = file '../build/unsupported'
|
destinationDir = file '../build/release'
|
||||||
archiveFileName = "BlueMap-${version}-forge.jar"
|
archiveFileName = "BlueMap-${version}-forge.jar"
|
||||||
|
|
||||||
configurations = [project.configurations.include]
|
configurations = [project.configurations.include]
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
|
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
|
||||||
import de.bluecolored.bluemap.common.plugin.text.Text;
|
import de.bluecolored.bluemap.common.plugin.text.Text;
|
||||||
import de.bluecolored.bluemap.core.world.World;
|
import de.bluecolored.bluemap.core.world.World;
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ public ForgeCommandSource(ForgeMod mod, Plugin plugin, net.minecraft.command.Com
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessage(Text text) {
|
public void sendMessage(Text text) {
|
||||||
delegate.sendFeedback(ITextComponent.Serializer.fromJson(text.toJSONString()), false);
|
delegate.sendFeedback(ITextComponent.Serializer.func_240643_a_(text.toJSONString()), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -61,7 +60,7 @@ public boolean hasPermission(String permission) {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<Vector3d> getPosition() {
|
public Optional<Vector3d> getPosition() {
|
||||||
Vec3d pos = delegate.getPos();
|
net.minecraft.util.math.vector.Vector3d pos = delegate.getPos();
|
||||||
if (pos != null) {
|
if (pos != null) {
|
||||||
return Optional.of(new Vector3d(pos.x, pos.y, pos.z));
|
return Optional.of(new Vector3d(pos.x, pos.y, pos.z));
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface;
|
import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface;
|
||||||
import de.bluecolored.bluemap.core.logger.Logger;
|
import de.bluecolored.bluemap.core.logger.Logger;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.world.DimensionType;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
@ -88,7 +90,7 @@ public void onServerStarting(FMLServerStartingEvent event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//register commands
|
//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(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
@ -189,14 +191,11 @@ public UUID getUUIDForWorld(ServerWorld world) throws IOException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private File getFolderForWorld(ServerWorld world) throws IOException {
|
private File getFolderForWorld(ServerWorld world) throws IOException {
|
||||||
File worldFolder = world.getSaveHandler().getWorldDirectory();
|
MinecraftServer server = world.getServer();
|
||||||
|
String worldName = server.func_240793_aU_().getWorldName();
|
||||||
int dimensionId = world.getDimension().getType().getId();
|
File worldFolder = new File(world.getServer().getDataDirectory(), worldName);
|
||||||
if (dimensionId != 0) {
|
File dimensionFolder = DimensionType.func_236031_a_(world.func_234923_W_(), worldFolder);
|
||||||
worldFolder = new File(worldFolder, "DIM" + dimensionId);
|
return dimensionFolder.getCanonicalFile();
|
||||||
}
|
|
||||||
|
|
||||||
return worldFolder.getCanonicalFile();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,6 +20,6 @@ A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebG
|
|||||||
[[dependencies.bluemap]]
|
[[dependencies.bluemap]]
|
||||||
modId="minecraft"
|
modId="minecraft"
|
||||||
mandatory=true
|
mandatory=true
|
||||||
versionRange="[1.15.2]"
|
versionRange="[1.16.1]"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="SERVER"
|
side="SERVER"
|
@ -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": []
|
|
||||||
}
|
|
||||||
]
|
|
6
BlueMapForge/src/main/resources/pack.mcmeta
Normal file
6
BlueMapForge/src/main/resources/pack.mcmeta
Normal 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
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user