Skip to content

Commit fdd987e

Browse files
committed
2.3.3 Hotfix
1 parent 9791948 commit fdd987e

18 files changed

+466
-60
lines changed

changelog.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
# 2.3.2 Hotfix
1+
# 2.3.3 Hotfix
22

33
## Warning:
44

55
* **This is a major update with extensive changes. While everything has been tested privately, the sheer size means bugs
66
may still occur. Please report any issues on GitHub or message `@me_alam` on Discord.**
77
* **The version will remain minor until stability and feature completeness are confirmed.**
88

9+
## Changed
10+
11+
* All the Rendering NullPointerExceptions are now Custom Exceptions for better debugging.
12+
913
## Fixed
1014

11-
* Annotated Model(Layers) and Renderers to only be called on the Client on the Fabric and NeoForge Side. This should
12-
prevent any issues with the server trying to call the rendering methods.
15+
* If a Mod has a broken Controller JSON, it will now be ignored instead of causing the game to crash.
1316

1417
## Epilogue
1518

common/src/main/java/software/bluelib/BlueLibConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static <T> ServiceLoader<T> loadAll(@NotNull Class<T> pClazz) {
5959
public static final String MOD_NAME = "BlueLib";
6060

6161
@NotNull
62-
public static final String VERSION = "2.3.2";
62+
public static final String VERSION = "2.3.3";
6363

6464
@Nullable
6565
public static MinecraftServer server;
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class AnimatableNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public AnimatableNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public AnimatableNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public AnimatableNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new AnimatableNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "AnimatableNullException: " + getLocalizedMessage();
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class EntityNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public EntityNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public EntityNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public EntityNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new EntityNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "EntityNullException: " + getLocalizedMessage();
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class EquipmentSlotNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public EquipmentSlotNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public EquipmentSlotNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public EquipmentSlotNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new EquipmentSlotNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "EquipmentSlotNullException: " + getLocalizedMessage();
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class ItemDisplayContextNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public ItemDisplayContextNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public ItemDisplayContextNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public ItemDisplayContextNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new ItemDisplayContextNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "ItemDisplayContextNullException: " + getLocalizedMessage();
50+
}
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class ItemStackNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public ItemStackNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public ItemStackNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public ItemStackNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new ItemStackNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "ItemStackNullException: " + getLocalizedMessage();
50+
}
51+
}

common/src/main/java/software/bluelib/api/exception/AnimatableException.java renamed to common/src/main/java/software/bluelib/api/exception/nulls/ModelNullException.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* If a copy of the MIT License was not distributed with this file,
66
* You can obtain one at https://opensource.org/licenses/MIT.
77
*/
8-
package software.bluelib.api.exception;
8+
package software.bluelib.api.exception.nulls;
99

1010
import java.util.ArrayList;
1111
import java.util.Collections;
@@ -14,25 +14,25 @@
1414
import org.jetbrains.annotations.NotNull;
1515

1616
@SuppressWarnings({ "unused" })
17-
public class AnimatableException extends NullPointerException {
17+
public class ModelNullException extends NullPointerException {
1818

1919
private final List<String> messages;
2020

21-
public AnimatableException(String pMessage) {
21+
public ModelNullException(String pMessage) {
2222
super(pMessage);
2323
this.messages = Collections.singletonList(pMessage);
2424
}
2525

26-
public AnimatableException(List<String> pMessages) {
26+
public ModelNullException(List<String> pMessages) {
2727
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
2828
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
2929
}
3030

3131
@NotNull
32-
public AnimatableException withMessage(String pMessage) {
32+
public ModelNullException withMessage(String pMessage) {
3333
List<String> newMessages = new ArrayList<>(this.messages);
3434
newMessages.add(pMessage);
35-
return new AnimatableException(newMessages);
35+
return new ModelNullException(newMessages);
3636
}
3737

3838
@Override
@@ -46,6 +46,6 @@ public String getLocalizedMessage() {
4646

4747
@Override
4848
public String toString() {
49-
return "AnimatableException: " + getLocalizedMessage();
49+
return "ModelNullException: " + getLocalizedMessage();
5050
}
5151
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2024 BlueLib Contributors
3+
*
4+
* This Source Code Form is subject to the terms of the MIT License.
5+
* If a copy of the MIT License was not distributed with this file,
6+
* You can obtain one at https://opensource.org/licenses/MIT.
7+
*/
8+
package software.bluelib.api.exception.nulls;
9+
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
import java.util.StringJoiner;
14+
import org.jetbrains.annotations.NotNull;
15+
16+
@SuppressWarnings({ "unused" })
17+
public class RenderTypeNullException extends NullPointerException {
18+
19+
private final List<String> messages;
20+
21+
public RenderTypeNullException(String pMessage) {
22+
super(pMessage);
23+
this.messages = Collections.singletonList(pMessage);
24+
}
25+
26+
public RenderTypeNullException(List<String> pMessages) {
27+
super(pMessages != null && !pMessages.isEmpty() ? pMessages.getFirst() : null);
28+
this.messages = pMessages == null ? Collections.emptyList() : Collections.unmodifiableList(pMessages);
29+
}
30+
31+
@NotNull
32+
public RenderTypeNullException withMessage(String pMessage) {
33+
List<String> newMessages = new ArrayList<>(this.messages);
34+
newMessages.add(pMessage);
35+
return new RenderTypeNullException(newMessages);
36+
}
37+
38+
@Override
39+
public String getLocalizedMessage() {
40+
StringJoiner joiner = new StringJoiner("\n");
41+
for (int i = 0; i < messages.size(); i++) {
42+
joiner.add((i == 0 ? "" : "-> ") + messages.get(i));
43+
}
44+
return joiner.toString();
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "RenderTypeNullException: " + getLocalizedMessage();
50+
}
51+
}

0 commit comments

Comments
 (0)