re-add level event parameters

This commit is contained in:
James Seibel
2022-09-16 22:55:21 -05:00
parent 9adf2a75f8
commit d0f43a6760
2 changed files with 8 additions and 8 deletions
@@ -58,7 +58,7 @@ import java.util.concurrent.TimeUnit;
* Specifically for the client.
*
* @author James Seibel
* @version 2022-9-10
* @version 2022-9-16
*/
public class ClientApi
{
@@ -155,7 +155,7 @@ public class ClientApi
//TODO: Implement
// TODO: potentially add a list of chunks that were updated during the save
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(level));
}
}
@@ -166,7 +166,7 @@ public class ClientApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.unloadLevel(level);
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelUnloadEvent.class, new DhApiLevelUnloadEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelUnloadEvent.class, new DhApiLevelUnloadEvent.EventParam(level));
}
}
@@ -177,7 +177,7 @@ public class ClientApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.getOrLoadLevel(level);
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelLoadEvent.class, new DhApiLevelLoadEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelLoadEvent.class, new DhApiLevelLoadEvent.EventParam(level));
}
}
@@ -42,7 +42,7 @@ import java.lang.invoke.MethodHandles;
* Forge, etc.). Specifically server events.
*
* @author James Seibel
* @version 2022-8-23
* @version 2022-9-16
*/
public class ServerApi
{
@@ -102,7 +102,7 @@ public class ServerApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.getOrLoadLevel(level);
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelLoadEvent.class, new DhApiLevelLoadEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelLoadEvent.class, new DhApiLevelLoadEvent.EventParam(level));
}
}
public void serverLevelUnloadEvent(IServerLevelWrapper level) {
@@ -110,7 +110,7 @@ public class ServerApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.unloadLevel(level);
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelUnloadEvent.class, new DhApiLevelUnloadEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelUnloadEvent.class, new DhApiLevelUnloadEvent.EventParam(level));
}
}
@@ -123,7 +123,7 @@ public class ServerApi
for (ILevel level : SharedApi.currentWorld.getAllLoadedLevels())
{
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(null)); // TODO create a wrapper object to pass back
DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(level.getLevelWrapper()));
}
}
}