Skip to content

Commit 1bb4641

Browse files
committed
Merge branch 'mc/1.13' into mc/1.12
2 parents d723dcd + 4fbd785 commit 1bb4641

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public void readState(DataInputStream in, Collection<MapType> mapTypes) throws I
265265
tiles.add(tile);
266266
}
267267

268-
createTickets(mapType, tiles);
268+
if (mapType != null) createTickets(mapType, tiles);
269269
}
270270

271271
//read tasks

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void init() {
8787
// commands
8888
LiteralCommandNode<S> baseCommand =
8989
literal("bluemap")
90-
.requires(requirements("bluemap.status"))
90+
.requires(requirementsUnloaded("bluemap.status"))
9191
.executes(this::statusCommand)
9292
.build();
9393

@@ -255,7 +255,7 @@ private Optional<World> parseWorld(String worldName) {
255255

256256
private Optional<MapType> parseMap(String mapId) {
257257
for (MapType map : plugin.getMapTypes()) {
258-
if (map.getName().equalsIgnoreCase(mapId)) {
258+
if (map.getId().equalsIgnoreCase(mapId)) {
259259
return Optional.of(map);
260260
}
261261
}
@@ -277,6 +277,11 @@ private Optional<UUID> parseUUID(String uuidString) {
277277
public int statusCommand(CommandContext<S> context) {
278278
CommandSource source = commandSourceInterface.apply(context.getSource());
279279

280+
if (!plugin.isLoaded()) {
281+
source.sendMessage(Text.of(TextColor.RED, "BlueMap is not loaded! Try /bluemap reload"));
282+
return 0;
283+
}
284+
280285
source.sendMessages(helper.createStatusMessage());
281286
return 1;
282287
}

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/render/hires/blockmodel/ResourceModelBuilder.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,17 @@ private void createElementFace(BlockStateModel model, TransformedBlockModelResou
189189
Texture texture = face.getTexture();
190190
int textureId = texture.getId();
191191

192-
ExtendedFace f1 = new ExtendedFace(c0, c1, c2, uvs[0], uvs[1], uvs[2], textureId);
193-
ExtendedFace f2 = new ExtendedFace(c0, c2, c3, uvs[0], uvs[2], uvs[3], textureId);
192+
ExtendedFace f1;
193+
ExtendedFace f2;
194+
195+
try {
196+
f1 = new ExtendedFace(c0, c1, c2, uvs[0], uvs[1], uvs[2], textureId);
197+
f2 = new ExtendedFace(c0, c2, c3, uvs[0], uvs[2], uvs[3], textureId);
198+
} catch (ArithmeticException ex) {
199+
// This error is thrown when a model defined a face that has no surface (all 3 points are on one line)
200+
// we catch it here and simply ignore the face
201+
return;
202+
}
194203

195204
//tint the face
196205
Vector3f color = Vector3f.ONE;

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/BlockModelResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ private BlockModelResource buildNoReset(String modelPath, boolean renderElements
269269

270270
for (Entry<Object, ? extends ConfigurationNode> entry : config.getNode("textures").getChildrenMap().entrySet()) {
271271
if (entry.getKey().equals(JSON_COMMENT)) continue;
272-
273272
textures.putIfAbsent(entry.getKey().toString(), entry.getValue().getString(null));
274273
}
275274

@@ -428,6 +427,8 @@ private Vector4f readVector4f(ConfigurationNode node) throws ParseResourceExcept
428427
}
429428

430429
private Texture getTexture(String key) throws NoSuchElementException, FileNotFoundException, IOException {
430+
if (key.isEmpty() || key.equals("#")) throw new NoSuchElementException("Empty texture key or name!");
431+
431432
if (key.charAt(0) == '#') {
432433
String value = textures.get(key.substring(1));
433434
if (value == null) throw new NoSuchElementException("There is no texture defined for the key " + key);

0 commit comments

Comments
 (0)