Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public void initialize() {
getLifecycleManager().getDataManager().registerConnection("ormConnection", DatabaseType.MYSQL, "player_data_rw");
ormContext = getLifecycleManager().getDataManager().createORMContext("ormConnection",
ChatMessageEntity.class,
ReportedChatMessageEntity.class).orElseThrow();
ReportedChatMessageEntity.class).orElseThrow(() -> new IllegalStateException(
"ChatLog requires the MYSQL/player_data_rw connection and could not create its ORM context."
));

reportHandler = new ReportHandler(this);
getLifecycleManager().getListenerManager().registerListener(new ChatListener(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public void initialize() {
ormContext = getLifecycleManager().getDataManager().createORMContext(
"ormConnection",
CommandExecutionEntity.class
).orElseThrow();
).orElseThrow(() -> new IllegalStateException(
"CommandLogger requires the MYSQL/player_data_rw connection and could not create its ORM context."
));

this.commandLogService = new CommandLogService(this);

Expand All @@ -61,5 +63,4 @@ public ORMContext getOrmContext() {
public CommandLogService getCommandLogService() {
return commandLogService;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public void initialize() {
ormContext = getLifecycleManager().getDataManager().createORMContext(
"glowOrmConnection",
PlayerGlowStateEntity.class
).orElseThrow();
).orElseThrow(() -> new IllegalStateException(
"Glow requires the MYSQL/player_data_rw connection and could not create its ORM context."
));

this.registry = new GlowRegistry();
this.glowHandler = new GlowHandler(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void initialize() {
getLifecycleManager().getDataManager().registerConnection("ormConnection", DatabaseType.MYSQL, "player_data_rw");
this.ormContext = getLifecycleManager().getDataManager()
.createORMContext("ormConnection", PlayerNametagEntity.class)
.orElseThrow();
.orElseThrow(() -> new IllegalStateException(
"Nametags requires the MYSQL/player_data_rw connection and could not create its ORM context."
));
this.repository = new NametagDBService(this);

// Runtime manager
Expand All @@ -84,7 +86,9 @@ public void initialize() {

@Override
public void disable() {
this.nametagManager.removeAllNametags();
if (this.nametagManager != null) {
this.nametagManager.removeAllNametags();
}
}

public NametagManager getNametagManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public void initialize() {
getLifecycleManager().getDataManager().registerConnection(
"orm", DatabaseType.MYSQL, "player_data_rw");
orm = getLifecycleManager().getDataManager()
.createORMContext("orm",
SanctionEntity.class)
.orElseThrow();
.createORMContext("orm", SanctionEntity.class)
.orElseThrow(() -> new IllegalStateException(
"Sanctions requires the MYSQL/player_data_rw connection and could not create its ORM context."
));

this.service = new SanctionsDataService(this);
this.muteRegistry = new MuteRegistry(service);
Expand Down Expand Up @@ -94,5 +95,4 @@ public ORMContext getOrm() {
public SanctionsDataService getService() {
return service;
}

}