Make event parameter objects internal classes
This commit is contained in:
+24
-4
@@ -1,16 +1,17 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.methods.events.parameterObjects.DhApiAfterRenderParam;
|
||||
import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
import com.seibel.lod.core.api.external.methods.events.sharedParameterObjects.DhApiRenderParam;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-7-17
|
||||
*/
|
||||
public abstract class DhApiAfterRenderEvent implements IDhApiEvent<DhApiAfterRenderParam>
|
||||
public abstract class DhApiAfterRenderEvent implements IDhApiEvent<DhApiAfterRenderEvent.Parameter>
|
||||
{
|
||||
/** Fired after Distant Horizons finishes rendering fake chunks. */
|
||||
public abstract void afterRender(DhApiAfterRenderParam input);
|
||||
public abstract void afterRender(Parameter input);
|
||||
|
||||
|
||||
//=========================//
|
||||
@@ -18,7 +19,7 @@ public abstract class DhApiAfterRenderEvent implements IDhApiEvent<DhApiAfterRen
|
||||
//=========================//
|
||||
|
||||
@Override
|
||||
public final boolean onEvent(DhApiAfterRenderParam input)
|
||||
public final boolean onEvent(Parameter input)
|
||||
{
|
||||
afterRender(input);
|
||||
return false;
|
||||
@@ -26,4 +27,23 @@ public abstract class DhApiAfterRenderEvent implements IDhApiEvent<DhApiAfterRen
|
||||
|
||||
@Override
|
||||
public final boolean getCancelable() { return false; }
|
||||
|
||||
|
||||
//==================//
|
||||
// parameter object //
|
||||
//==================//
|
||||
|
||||
public static class Parameter extends DhApiRenderParam
|
||||
{
|
||||
public Parameter(
|
||||
DhApiMat4f newMinecraftProjectionMatrix, DhApiMat4f newMinecraftModelViewMatrix,
|
||||
DhApiMat4f newDistantHorizonsProjectionMatrix, DhApiMat4f newDistantHorizonsModelViewMatrix,
|
||||
float newPartialTicks)
|
||||
{
|
||||
super(newMinecraftProjectionMatrix, newMinecraftModelViewMatrix,
|
||||
newDistantHorizonsProjectionMatrix, newDistantHorizonsModelViewMatrix,
|
||||
newPartialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.methods.events.parameterObjects.DhApiAfterRenderParam;
|
||||
import com.seibel.lod.core.api.external.methods.events.sharedParameterObjects.DhApiAfterRenderParam;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
|
||||
+24
-4
@@ -1,20 +1,21 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.methods.events.parameterObjects.DhApiBeforeRenderParam;
|
||||
import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
import com.seibel.lod.core.api.external.methods.events.sharedParameterObjects.DhApiRenderParam;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-7-17
|
||||
*/
|
||||
public abstract class DhApiBeforeRenderEvent implements IDhApiEvent<DhApiBeforeRenderParam>
|
||||
public abstract class DhApiBeforeRenderEvent implements IDhApiEvent<DhApiBeforeRenderEvent.Parameter>
|
||||
{
|
||||
/**
|
||||
* Fired before Distant Horizons finishes rendering fake chunks.
|
||||
*
|
||||
* @return whether the event should be canceled or not.
|
||||
*/
|
||||
public abstract boolean beforeRender(DhApiBeforeRenderParam input);
|
||||
public abstract boolean beforeRender(Parameter input);
|
||||
|
||||
|
||||
//=========================//
|
||||
@@ -22,11 +23,30 @@ public abstract class DhApiBeforeRenderEvent implements IDhApiEvent<DhApiBeforeR
|
||||
//=========================//
|
||||
|
||||
@Override
|
||||
public final boolean onEvent(DhApiBeforeRenderParam input)
|
||||
public final boolean onEvent(Parameter input)
|
||||
{
|
||||
return beforeRender(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean getCancelable() { return true; }
|
||||
|
||||
|
||||
//==================//
|
||||
// parameter object //
|
||||
//==================//
|
||||
|
||||
public static class Parameter extends DhApiRenderParam
|
||||
{
|
||||
public Parameter(
|
||||
DhApiMat4f newMinecraftProjectionMatrix, DhApiMat4f newMinecraftModelViewMatrix,
|
||||
DhApiMat4f newDistantHorizonsProjectionMatrix, DhApiMat4f newDistantHorizonsModelViewMatrix,
|
||||
float newPartialTicks)
|
||||
{
|
||||
super(newMinecraftProjectionMatrix, newMinecraftModelViewMatrix,
|
||||
newDistantHorizonsProjectionMatrix, newDistantHorizonsModelViewMatrix,
|
||||
newPartialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.parameterObjects;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
|
||||
/**
|
||||
* Parameter passed into the After Render event.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 7-17-2022
|
||||
*/
|
||||
public class DhApiAfterRenderParam extends DhApiRenderParam
|
||||
{
|
||||
|
||||
public DhApiAfterRenderParam(
|
||||
DhApiMat4f newMinecraftProjectionMatrix, DhApiMat4f newMinecraftModelViewMatrix,
|
||||
DhApiMat4f newDistantHorizonsProjectionMatrix, DhApiMat4f newDistantHorizonsModelViewMatrix,
|
||||
float newPartialTicks)
|
||||
{
|
||||
super(newMinecraftProjectionMatrix, newMinecraftModelViewMatrix,
|
||||
newDistantHorizonsProjectionMatrix, newDistantHorizonsModelViewMatrix,
|
||||
newPartialTicks);
|
||||
}
|
||||
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.parameterObjects;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
|
||||
/**
|
||||
* Parameter passed into the Before Render event.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 7-17-2022
|
||||
*/
|
||||
public class DhApiBeforeRenderParam extends DhApiRenderParam
|
||||
{
|
||||
|
||||
public DhApiBeforeRenderParam(
|
||||
DhApiMat4f newMinecraftProjectionMatrix, DhApiMat4f newMinecraftModelViewMatrix,
|
||||
DhApiMat4f newDistantHorizonsProjectionMatrix, DhApiMat4f newDistantHorizonsModelViewMatrix,
|
||||
float newPartialTicks)
|
||||
{
|
||||
super(newMinecraftProjectionMatrix, newMinecraftModelViewMatrix,
|
||||
newDistantHorizonsProjectionMatrix, newDistantHorizonsModelViewMatrix,
|
||||
newPartialTicks);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.parameterObjects;
|
||||
package com.seibel.lod.core.api.external.methods.events.sharedParameterObjects;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.seibel.lod.core.api.external.items.objects.math.DhApiMat4f;
|
||||
* @author James Seibel
|
||||
* @version 7-17-2022
|
||||
*/
|
||||
class DhApiRenderParam // default visibility so this class isn't visible outside the package
|
||||
public class DhApiRenderParam
|
||||
{
|
||||
/** The projection matrix Minecraft is using to render this frame. */
|
||||
public final DhApiMat4f MinecraftProjectionMatrix;
|
||||
Reference in New Issue
Block a user