mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-28 02:11:34 +01:00
Merge branch 'mc/1.13' into mc/1.15
This commit is contained in:
commit
e4de12c4ec
@ -265,7 +265,7 @@ public void readState(DataInputStream in, Collection<MapType> mapTypes) throws I
|
|||||||
tiles.add(tile);
|
tiles.add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
createTickets(mapType, tiles);
|
if (mapType != null) createTickets(mapType, tiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
//read tasks
|
//read tasks
|
||||||
|
@ -87,7 +87,7 @@ public void init() {
|
|||||||
// commands
|
// commands
|
||||||
LiteralCommandNode<S> baseCommand =
|
LiteralCommandNode<S> baseCommand =
|
||||||
literal("bluemap")
|
literal("bluemap")
|
||||||
.requires(requirements("bluemap.status"))
|
.requires(requirementsUnloaded("bluemap.status"))
|
||||||
.executes(this::statusCommand)
|
.executes(this::statusCommand)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ private Optional<World> parseWorld(String worldName) {
|
|||||||
|
|
||||||
private Optional<MapType> parseMap(String mapId) {
|
private Optional<MapType> parseMap(String mapId) {
|
||||||
for (MapType map : plugin.getMapTypes()) {
|
for (MapType map : plugin.getMapTypes()) {
|
||||||
if (map.getName().equalsIgnoreCase(mapId)) {
|
if (map.getId().equalsIgnoreCase(mapId)) {
|
||||||
return Optional.of(map);
|
return Optional.of(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -277,6 +277,11 @@ private Optional<UUID> parseUUID(String uuidString) {
|
|||||||
public int statusCommand(CommandContext<S> context) {
|
public int statusCommand(CommandContext<S> context) {
|
||||||
CommandSource source = commandSourceInterface.apply(context.getSource());
|
CommandSource source = commandSourceInterface.apply(context.getSource());
|
||||||
|
|
||||||
|
if (!plugin.isLoaded()) {
|
||||||
|
source.sendMessage(Text.of(TextColor.RED, "BlueMap is not loaded! Try /bluemap reload"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
source.sendMessages(helper.createStatusMessage());
|
source.sendMessages(helper.createStatusMessage());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -189,8 +189,17 @@ private void createElementFace(BlockStateModel model, TransformedBlockModelResou
|
|||||||
Texture texture = face.getTexture();
|
Texture texture = face.getTexture();
|
||||||
int textureId = texture.getId();
|
int textureId = texture.getId();
|
||||||
|
|
||||||
ExtendedFace f1 = new ExtendedFace(c0, c1, c2, uvs[0], uvs[1], uvs[2], textureId);
|
ExtendedFace f1;
|
||||||
ExtendedFace f2 = new ExtendedFace(c0, c2, c3, uvs[0], uvs[2], uvs[3], textureId);
|
ExtendedFace f2;
|
||||||
|
|
||||||
|
try {
|
||||||
|
f1 = new ExtendedFace(c0, c1, c2, uvs[0], uvs[1], uvs[2], textureId);
|
||||||
|
f2 = new ExtendedFace(c0, c2, c3, uvs[0], uvs[2], uvs[3], textureId);
|
||||||
|
} catch (ArithmeticException ex) {
|
||||||
|
// This error is thrown when a model defined a face that has no surface (all 3 points are on one line)
|
||||||
|
// we catch it here and simply ignore the face
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//tint the face
|
//tint the face
|
||||||
Vector3f color = Vector3f.ONE;
|
Vector3f color = Vector3f.ONE;
|
||||||
|
@ -269,7 +269,6 @@ private BlockModelResource buildNoReset(String modelPath, boolean renderElements
|
|||||||
|
|
||||||
for (Entry<Object, ? extends ConfigurationNode> entry : config.getNode("textures").getChildrenMap().entrySet()) {
|
for (Entry<Object, ? extends ConfigurationNode> entry : config.getNode("textures").getChildrenMap().entrySet()) {
|
||||||
if (entry.getKey().equals(JSON_COMMENT)) continue;
|
if (entry.getKey().equals(JSON_COMMENT)) continue;
|
||||||
|
|
||||||
textures.putIfAbsent(entry.getKey().toString(), entry.getValue().getString(null));
|
textures.putIfAbsent(entry.getKey().toString(), entry.getValue().getString(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,6 +425,8 @@ private Vector4f readVector4f(ConfigurationNode node) throws ParseResourceExcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Texture getTexture(String key) throws NoSuchElementException, FileNotFoundException, IOException {
|
private Texture getTexture(String key) throws NoSuchElementException, FileNotFoundException, IOException {
|
||||||
|
if (key.isEmpty() || key.equals("#")) throw new NoSuchElementException("Empty texture key or name!");
|
||||||
|
|
||||||
if (key.charAt(0) == '#') {
|
if (key.charAt(0) == '#') {
|
||||||
String value = textures.get(key.substring(1));
|
String value = textures.get(key.substring(1));
|
||||||
if (value == null) throw new NoSuchElementException("There is no texture defined for the key " + key);
|
if (value == null) throw new NoSuchElementException("There is no texture defined for the key " + key);
|
||||||
|
Loading…
Reference in New Issue
Block a user