-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out client-side events into their own dispatcher, to avoid Error
if running server-side
- Loading branch information
1 parent
a52319f
commit eb12caa
Showing
3 changed files
with
38 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/me/planetguy/remaininmotion/core/interop/EventPoolClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package me.planetguy.remaininmotion.core.interop; | ||
|
||
import net.minecraft.client.renderer.RenderBlocks; | ||
import net.minecraft.tileentity.TileEntity; | ||
import me.planetguy.remaininmotion.api.event.PostRenderDuringMovementEvent; | ||
import me.planetguy.remaininmotion.api.event.PreRenderDuringMovementEvent; | ||
|
||
public class EventPoolClient { | ||
|
||
private static PreRenderDuringMovementEvent thePreRenderDuringMovementEvent=new PreRenderDuringMovementEvent(); | ||
private static PostRenderDuringMovementEvent thePostRenderDuringMovementEvent=new PostRenderDuringMovementEvent(); | ||
|
||
public static boolean postPreRenderDuringMovementEvent(RenderBlocks blockRenderer, int x, int y, int z, TileEntity entity, int pass) { | ||
thePreRenderDuringMovementEvent.renderBlocks=blockRenderer; | ||
thePreRenderDuringMovementEvent.x=x; | ||
thePreRenderDuringMovementEvent.y=y; | ||
thePreRenderDuringMovementEvent.z=z; | ||
thePreRenderDuringMovementEvent.tile=entity; | ||
thePreRenderDuringMovementEvent.pass=pass; | ||
EventPool.postEvent(thePreRenderDuringMovementEvent); | ||
return thePreRenderDuringMovementEvent.isCanceled(); | ||
} | ||
|
||
public static void postPostRenderDuringMovementEvent(RenderBlocks blockRenderer, int x, int y, int z, TileEntity entity, int pass) { | ||
thePostRenderDuringMovementEvent.renderBlocks=blockRenderer; | ||
thePostRenderDuringMovementEvent.x=x; | ||
thePostRenderDuringMovementEvent.y=y; | ||
thePostRenderDuringMovementEvent.z=z; | ||
thePostRenderDuringMovementEvent.tile=entity; | ||
thePostRenderDuringMovementEvent.pass=pass; | ||
EventPool.postEvent(thePostRenderDuringMovementEvent); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters