mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
@@ -59,6 +59,11 @@ public class ScriptTemplateService extends AbstractService implements
|
||||
|
||||
public void addTemplate(Class<? extends Template<?>> t) {
|
||||
final Template<?> template = injector.getInstance(t);
|
||||
if (templates.containsKey(template.getID()))
|
||||
throw new TemplateException("Template with ID" + template.getID()
|
||||
+ " is already registered for "
|
||||
+ templates.get(template.getID()));
|
||||
|
||||
if (template.getID() != null)
|
||||
templates.put(template.getID(), template);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.l2jserver.service.game.template;
|
||||
|
||||
public class TemplateException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TemplateException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TemplateException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public TemplateException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public TemplateException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user