Merge branch 'master' into mc/1.12

This commit is contained in:
Blue (Lukas Rieger) 2020-01-21 23:35:33 +01:00
commit 9bc63142dc
6 changed files with 29 additions and 27 deletions

View File

@ -40,6 +40,7 @@ public void onEnable() {
new MetricsLite(this);
//save world so the level.dat is present on new worlds
Logger.global.logInfo("Saving all worlds once, to make sure the level.dat is present...");
for (World world : getServer().getWorlds()) {
world.save();
}

View File

@ -1,8 +1,7 @@
name: BlueMap
description: "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)"
main: de.bluecolored.bluemap.bukkit.BukkitPlugin
version: 0.2.1
api-version: 1.12.2
version: "0.3.0-mc1.12"
author: "Blue (TBlueF / Lukas Rieger)"
authors: [Blue (TBlueF / Lukas Rieger)]
website: "https://github.com/BlueMap-Minecraft"

View File

@ -2,7 +2,7 @@
{
"modid": "bluemap",
"name": "BlueMap",
"version": "0.2.1-mc1.12",
"version": "0.3.0-mc1.12",
"description": "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)",
"url": "https://github.com/BlueMap-Minecraft",
"authorList": [

View File

@ -2,6 +2,6 @@
public class BlueMap {
public static final String VERSION = "0.2.1-mc1.12";
public static final String VERSION = "0.3.0-mc1.12";
}

View File

@ -475,15 +475,15 @@ export default class BlueMap {
let displayAlert = () => {
let alert = $(`<div class="alert box" data-alert-id="${id}" style="display: none;"><div class="alert-close-button"></div>${content}</div>`).appendTo(alertBox);
alert.find('.alert-close-button').click(() => {
alert.fadeOut(200, () => alert.remove());
alert.stop().fadeOut(200, () => alert.remove());
});
alert.fadeIn(200);
alert.stop().fadeIn(200);
};
if (id !== undefined) {
let sameAlert = alertBox.find(`.alert[data-alert-id=${id}]`);
if (sameAlert.length > 0) {
alertBox.fadeOut(200, () => {
alertBox.stop().fadeOut(200, () => {
alertBox.html('');
alertBox.show();
});
@ -493,7 +493,7 @@ export default class BlueMap {
let oldAlerts = alertBox.find('.alert');
if (oldAlerts.length > 0){
alertBox.fadeOut(200, () => {
alertBox.stop().fadeOut(200, () => {
alertBox.html('');
alertBox.show();
displayAlert();

View File

@ -215,41 +215,43 @@ export default class Controls {
}
updateHeights() {
function between(n, min, max) {
return n >= min && n < max;
}
function between(n, min, max) {
return n >= min && n < max;
}
let inTile = (pos, thisPos) => {
return between(pos.x, thisPos.x - this.tileSize.x, thisPos.x) &&
between(pos.z, thisPos.z - this.tileSize.z, thisPos.z);
};
let inTile = (pos, thisPos) => {
return between(pos.x, thisPos.x - this.tileSize.x, thisPos.x) &&
between(pos.z, thisPos.z - this.tileSize.z, thisPos.z);
};
let tileChildren = (targetPos) => {
return this.heightScene.children.filter(child => inTile(child.position, targetPos))
};
let tileChildren = (targetPos) => {
return this.heightScene.children.filter(child => inTile(child.position, targetPos))
};
// check hight at target
try {
let rayStart = new Vector3(this.targetPosition.x, 300, this.targetPosition.z);
this.raycaster.set(rayStart, this.rayDirection);
this.raycaster.near = 1;
this.raycaster.far = 300;
let intersects = this.raycaster.intersectObjects(tileChildren(this.targetPosition));
if (intersects.length > 0){
if (intersects.length > 0) {
this.minHeight = intersects[0].point.y;
//this.targetPosition.y = this.minHeight;
} else {
//this.targetPosition.y = 0;
}
} catch (ignore){}
rayStart.set(this.camera.position.x, 300, this.camera.position.z);
// check height at camera
try {
let rayStart = new Vector3(this.camera.position.x, 300, this.camera.position.z);
this.raycaster.set(rayStart, this.rayDirection);
intersects.length = 0;
intersects = this.raycaster.intersectObjects(tileChildren(this.camera.position));
if (intersects.length > 0){
if (intersects[0].point.y > this.minHeight){
let intersects = this.raycaster.intersectObjects(tileChildren(this.camera.position));
if (intersects.length > 0) {
if (intersects[0].point.y > this.minHeight) {
this.minHeight = intersects[0].point.y;
}
}
} catch (ignore){}
}
updateMouseMoves = () => {