Skip to content

Commit 768f28f

Browse files
committed
Merge branch 'mc/1.13' into mc/1.12
2 parents 0ffd46c + d172d0f commit 768f28f

File tree

26 files changed

+774
-38
lines changed

26 files changed

+774
-38
lines changed

.github/workflows/gradle.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ jobs:
1515
run: ./gradlew test
1616
- name: Build with Gradle
1717
run: ./gradlew build
18-
- uses: actions/upload-artifact@v1
19-
with:
20-
name: artifact
21-
path: build/libs/BlueMap.jar

BlueMapBukkit/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,28 @@ dependencies {
1313
compile group: 'org.bstats', name: 'bstats-bukkit-lite', version: '1.5'
1414
compile project(':BlueMapCommon')
1515
}
16+
17+
build.dependsOn shadowJar {
18+
destinationDir = file '../build/release'
19+
archiveFileName = "BlueMap-${version}-bukkit.jar"
20+
21+
relocate 'com.google', 'de.bluecolored.bluemap.google'
22+
relocate 'com.flowpowered', 'de.bluecolored.bluemap.flowpowered'
23+
relocate 'com.typesafe', 'de.bluecolored.bluemap.typesafe'
24+
relocate 'net.querz', 'de.bluecolored.bluemap.querz'
25+
relocate 'ninja', 'de.bluecolored.bluemap.ninja'
26+
relocate 'org.apache', 'de.bluecolored.bluemap.apache'
27+
relocate 'org.yaml', 'de.bluecolored.bluemap.yaml'
28+
29+
relocate 'org.bstats.bukkit', 'de.bluecolored.bluemap.bstats.bukkit'
30+
}
31+
32+
processResources {
33+
from(sourceSets.main.resources.srcDirs) {
34+
include 'plugin.yml'
35+
36+
expand (
37+
version: project.version
38+
)
39+
}
40+
}

BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void sendMessage(Text text) {
2626
return;
2727
}
2828

29-
delegate.sendMessage(text.toFormattingCodedString('§'));
29+
delegate.sendMessage(text.toPlainString());
3030
});
3131
}
3232

BlueMapBukkit/src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: BlueMap
22
description: "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)"
33
main: de.bluecolored.bluemap.bukkit.BukkitPlugin
4-
version: "0.5.1-mc1.12"
4+
version: ${version}
55
author: "Blue (TBlueF / Lukas Rieger)"
66
authors: [Blue (TBlueF / Lukas Rieger)]
77
website: "https://github.com/BlueMap-Minecraft"

BlueMapCLI/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,22 @@ dependencies {
22
compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
33
compile project(':BlueMapCommon')
44
}
5+
6+
jar {
7+
manifest {
8+
attributes 'Main-Class' : "de.bluecolored.bluemap.cli.BlueMapCLI"
9+
}
10+
}
11+
12+
build.dependsOn shadowJar {
13+
destinationDir = file '../build/release'
14+
archiveFileName = "BlueMap-${version}-cli.jar"
15+
16+
relocate 'com.google', 'de.bluecolored.bluemap.google'
17+
relocate 'com.flowpowered', 'de.bluecolored.bluemap.flowpowered'
18+
relocate 'com.typesafe', 'de.bluecolored.bluemap.typesafe'
19+
relocate 'net.querz', 'de.bluecolored.bluemap.querz'
20+
relocate 'ninja', 'de.bluecolored.bluemap.ninja'
21+
relocate 'org.apache', 'de.bluecolored.bluemap.apache'
22+
relocate 'org.yaml', 'de.bluecolored.bluemap.yaml'
23+
}

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import de.bluecolored.bluemap.common.MapType;
2626
import de.bluecolored.bluemap.common.RenderManager;
2727
import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface;
28-
import de.bluecolored.bluemap.core.BlueMap;
2928
import de.bluecolored.bluemap.core.config.ConfigManager;
3029
import de.bluecolored.bluemap.core.config.MainConfig;
3130
import de.bluecolored.bluemap.core.config.MainConfig.MapConfig;
@@ -48,7 +47,6 @@ public class Plugin {
4847

4948
public static final String PLUGIN_ID = "bluemap";
5049
public static final String PLUGIN_NAME = "BlueMap";
51-
public static final String PLUGIN_VERSION = BlueMap.VERSION;
5250

5351
private static Plugin instance;
5452

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/text/Text.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public String toJSONString() {
4949
if (hoverText != null) {
5050
sb.append(quote("hoverEvent")).append(":{");
5151
sb.append(quote("action")).append(":").append(quote("show_text")).append(',');
52-
sb.append(quote("value")).append(":").append(quote(hoverText.toFormattingCodedString('§')));
52+
sb.append(quote("value")).append(":").append(quote(hoverText.toFormattingCodedString('\u00a7')));
5353
sb.append("},");
5454
}
5555

@@ -131,7 +131,7 @@ private String quote(String value) {
131131
private String escape(String value) {
132132
value = value.replace("\\", "\\\\");
133133
value = value.replace("\"", "\\\"");
134-
value = value.replace("§", "\\u00a7");
134+
value = value.replace("\u00a7", "\\u00a7");
135135
value = value.replace("\n", "\\n");
136136
return value;
137137
}

BlueMapCore/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ dependencies {
1616
testCompile 'junit:junit:4.12'
1717
}
1818

19+
processResources {
20+
from(sourceSets.main.resources.srcDirs) {
21+
include 'core.json'
22+
23+
expand (
24+
version: project.version
25+
)
26+
}
27+
}
28+
1929
node {
2030
version = '12.14.1'
2131
download = true
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
package de.bluecolored.bluemap.core;
22

3+
import java.io.IOException;
4+
5+
import de.bluecolored.bluemap.core.logger.Logger;
6+
import ninja.leaping.configurate.gson.GsonConfigurationLoader;
7+
38
public class BlueMap {
49

5-
public static final String VERSION = "0.5.1-mc1.12";
10+
public static final String VERSION;
11+
static {
12+
String version = "DEV";
13+
try {
14+
version = GsonConfigurationLoader.builder().setURL(BlueMap.class.getResource("/core.json")).build().load().getNode("version").getString("DEV");
15+
} catch (IOException ex) {
16+
Logger.global.logError("Failed to load core.json from resources!", ex);
17+
}
18+
19+
if (version.equals("${version}")) version = "DEV";
20+
21+
VERSION = version;
22+
}
623

724
}

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/ChunkAnvil112.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
import de.bluecolored.bluemap.core.world.Biome;
3232
import de.bluecolored.bluemap.core.world.BlockState;
3333
import de.bluecolored.bluemap.core.world.LightData;
34+
import net.querz.nbt.ByteArrayTag;
3435
import net.querz.nbt.CompoundTag;
36+
import net.querz.nbt.IntArrayTag;
3537
import net.querz.nbt.ListTag;
38+
import net.querz.nbt.Tag;
3639
import net.querz.nbt.mca.MCAUtil;
3740

3841
public class ChunkAnvil112 extends Chunk {
@@ -41,7 +44,7 @@ public class ChunkAnvil112 extends Chunk {
4144

4245
private boolean isGenerated;
4346
private Section[] sections;
44-
private byte[] biomes;
47+
private int[] biomes;
4548

4649
@SuppressWarnings("unchecked")
4750
public ChunkAnvil112(MCAWorld world, CompoundTag chunkTag) {
@@ -62,10 +65,21 @@ public ChunkAnvil112(MCAWorld world, CompoundTag chunkTag) {
6265
sections[section.getSectionY()] = section;
6366
}
6467

65-
biomes = levelData.getByteArray("Biomes");
68+
Tag<?> tag = levelData.get("Biomes"); //tag can be byte-array or int-array
69+
if (tag instanceof ByteArrayTag) {
70+
byte[] bs = ((ByteArrayTag) tag).getValue();
71+
biomes = new int[bs.length];
72+
73+
for (int i = 0; i < bs.length; i++) {
74+
biomes[i] = bs[i] & 0xFF;
75+
}
76+
}
77+
else if (tag instanceof IntArrayTag) {
78+
biomes = ((IntArrayTag) tag).getValue();
79+
}
6680

6781
if (biomes == null || biomes.length == 0) {
68-
biomes = new byte[2048];
82+
biomes = new int[2048];
6983
}
7084
}
7185

0 commit comments

Comments
 (0)