-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
192 additions
and
44 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
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 |
---|---|---|
|
@@ -355,3 +355,40 @@ jobs: | |
name: ${{github.ref_name}}-1.21(.1) - Fabric | ||
files: 'versions/1.21-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' | ||
game-versions: 1.21.x | ||
- name: Publish-1.21.2-neoforge-Curseforge | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
curseforge-id: 448233 | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
loaders: neoforge | ||
name: ${{github.ref_name}}-1.21.2 - NeoForge | ||
version-type: beta | ||
files: 'versions/1.21.2-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' | ||
game-versions: 1.21.2 | ||
- name: Publish-1.21.2-neoforge-Modrinth | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: NNAgCjsB | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
loaders: neoforge | ||
name: ${{github.ref_name}}-1.21.2 - NeoForge | ||
files: 'versions/1.21.2-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' | ||
game-versions: 1.21.2 | ||
- name: Publish-1.21.2-fabric-Curseforge | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
curseforge-id: 448233 | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
loaders: fabric | ||
name: ${{github.ref_name}}-1.21.2 - Fabric | ||
files: 'versions/1.21.2-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' | ||
game-versions: 1.21.2 | ||
- name: Publish-1.21.2-fabric-Modrinth | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: NNAgCjsB | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
loaders: fabric | ||
name: ${{github.ref_name}}-1.21.2 - Fabric | ||
files: 'versions/1.21.2-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' | ||
game-versions: 1.21.2 |
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
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
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
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
59 changes: 59 additions & 0 deletions
59
src/main/java/dev/tr7zw/entityculling/NMSCullingHelper.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,59 @@ | ||
package dev.tr7zw.entityculling; | ||
|
||
import dev.tr7zw.entityculling.access.EntityRendererInter; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.renderer.entity.EntityRenderer; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.phys.AABB; | ||
import net.minecraft.world.phys.Vec3; | ||
|
||
public class NMSCullingHelper { | ||
|
||
private final static Minecraft MC = Minecraft.getInstance(); | ||
|
||
@SuppressWarnings("unchecked") | ||
public static boolean ignoresCulling(Entity entity) { | ||
// spotless:off | ||
//#if MC <= 12101 | ||
//$$ return entity.noCulling; | ||
//#else | ||
return ((EntityRendererInter<Entity>) MC.getEntityRenderDispatcher().getRenderer(entity)) | ||
.ignoresCulling(entity); | ||
//#endif | ||
//spotless:on | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static AABB getCullingBox(Entity entity) { | ||
// spotless:off | ||
//#if MC <= 12101 | ||
//$$ return entity.getBoundingBoxForCulling(); | ||
//#else | ||
return ((EntityRendererInter<Entity>) MC.getEntityRenderDispatcher().getRenderer(entity)).getCullingBox(entity); | ||
//#endif | ||
//spotless:on | ||
} | ||
|
||
public static Vec3 getRenderOffset(EntityRenderer entityRenderer, Entity entity, float tickDelta) { | ||
// spotless:off | ||
//#if MC <= 12101 | ||
//$$ return entityRenderer.getRenderOffset(entity, tickDelta); | ||
//#else | ||
return entityRenderer.getRenderOffset(entityRenderer.createRenderState(entity, tickDelta)); | ||
//#endif | ||
//spotless:on | ||
} | ||
|
||
public static void sendChatMessage(Component message) { | ||
// spotless:off | ||
//#if MC <= 12101 | ||
//$$ if (MC.player != null) | ||
//$$ MC.player.sendSystemMessage(message); | ||
//#else | ||
MC.getChatListener().handleSystemMessage(message, false); | ||
//#endif | ||
//spotless:on | ||
} | ||
|
||
} |
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
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
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.21-fabric | ||
1.21.2-fabric |