mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-04 00:46:01 +02:00
Replace abstract class with class and a private constructor to prevent instantiation of a class.
This commit is contained in:
@@ -5,7 +5,10 @@ import com.yes.yes.utils.exceptions.AlreadyExistsException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public abstract class EntityRegistry {
|
public class EntityRegistry {
|
||||||
|
private EntityRegistry() {
|
||||||
|
}
|
||||||
|
|
||||||
private static final HashMap<String, RegistryEntry> entities = new HashMap<>();
|
private static final HashMap<String, RegistryEntry> entities = new HashMap<>();
|
||||||
|
|
||||||
public static void register(RegistryEntry entry) throws AlreadyExistsException {
|
public static void register(RegistryEntry entry) throws AlreadyExistsException {
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ package com.yes.yes.utils;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public abstract class GlobalEventHandler {
|
public class GlobalEventHandler {
|
||||||
|
private GlobalEventHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
private static final EventHandler handler = new EventHandler();
|
private static final EventHandler handler = new EventHandler();
|
||||||
|
|
||||||
public static <T> void addListener(String eventName, Consumer<T> function) {
|
public static <T> void addListener(String eventName, Consumer<T> function) {
|
||||||
|
|||||||
Reference in New Issue
Block a user