Added better debug method
This commit is contained in:
parent
4044e6ca53
commit
59c7187bab
@ -67,11 +67,12 @@ public class Plugin extends PluginBase {
|
|||||||
|
|
||||||
|
|
||||||
for (String blockName : blockNames) {
|
for (String blockName : blockNames) {
|
||||||
System.out.println("§aLoading custom block " + blockName + "...");
|
getLogger().info("§aLoading custom block " + blockName + "...");
|
||||||
try {
|
try {
|
||||||
Class<? extends CustomBlock> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_blocks." + blockName).asSubclass(CustomBlock.class);
|
Class<? extends CustomBlock> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_blocks." + blockName).asSubclass(CustomBlock.class);
|
||||||
Block.registerCustomBlock(Collections.singletonList(clazz)).assertOK();
|
Block.registerCustomBlock(Collections.singletonList(clazz)).assertOK();
|
||||||
} catch (AssertionError | ClassNotFoundException e) {
|
} catch (AssertionError | ClassNotFoundException e) {
|
||||||
|
getLogger().error("§cFailed to load custom block " + blockName + "!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,11 +88,12 @@ public class Plugin extends PluginBase {
|
|||||||
.collect(Collectors.toSet());*/
|
.collect(Collectors.toSet());*/
|
||||||
|
|
||||||
for (String itemName : itemNames) {
|
for (String itemName : itemNames) {
|
||||||
System.out.println("§aLoading custom item " + itemName + "...");
|
getLogger().info("§aLoading custom item " + itemName + "...");
|
||||||
try {
|
try {
|
||||||
Class<? extends CustomItem> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_items." + itemName).asSubclass(CustomItem.class);
|
Class<? extends CustomItem> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_items." + itemName).asSubclass(CustomItem.class);
|
||||||
Item.registerCustomItem(clazz).assertOK();
|
Item.registerCustomItem(clazz).assertOK();
|
||||||
} catch (AssertionError | ClassNotFoundException e) {
|
} catch (AssertionError | ClassNotFoundException e) {
|
||||||
|
getLogger().error("§cFailed to load custom item " + itemName + "!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,17 +109,18 @@ public class Plugin extends PluginBase {
|
|||||||
.collect(Collectors.toSet());*/
|
.collect(Collectors.toSet());*/
|
||||||
|
|
||||||
for (String entityName : entityNames) {
|
for (String entityName : entityNames) {
|
||||||
System.out.println("§aLoading custom entity " + entityName + "...");
|
getLogger().info("§aLoading custom entity " + entityName + "...");
|
||||||
try {
|
try {
|
||||||
Class<? extends Entity> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_entities." + entityName).asSubclass(Entity.class);
|
Class<? extends Entity> clazz = Class.forName("com.cimeyclust.addonreader.resources.custom_entities." + entityName).asSubclass(Entity.class);
|
||||||
Entity.registerCustomEntity(new CustomClassEntityProvider(clazz)).assertOK();
|
Entity.registerCustomEntity(new CustomClassEntityProvider(clazz)).assertOK();
|
||||||
this.entities.add(clazz);
|
this.entities.add(clazz);
|
||||||
} catch (AssertionError | ClassNotFoundException e) {
|
} catch (AssertionError | ClassNotFoundException e) {
|
||||||
|
getLogger().error("§cFailed to load custom entity " + entityName + "!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("CustomResources has been enabled!");
|
getLogger().info("CustomResources has been enabled!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void tickComponents(Entity entity) {
|
public static void tickComponents(Entity entity) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user