Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jun 14, 2024
1 parent 1089d97 commit 59c4563
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 14 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,59 @@ jobs:
name: ${{github.ref_name}}-1.20.6 - Fabric
files: 'versions/1.20.6-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.20.6
- name: Publish-1.21-forge-Curseforge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 448233
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
loaders: forge
name: ${{github.ref_name}}-1.21 - Forge
version-type: beta
files: 'versions/1.21-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
- name: Publish-1.21-forge-Modrinth
uses: Kir-Antipov/[email protected]
with:
modrinth-id: NNAgCjsB
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
loaders: forge
name: ${{github.ref_name}}-1.21 - Forge
files: 'versions/1.21-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
- name: Publish-1.21-neoforge-Curseforge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 448233
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
loaders: neoforge
name: ${{github.ref_name}}-1.21 - NeoForge
version-type: beta
files: 'versions/1.21-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
- name: Publish-1.21-neoforge-Modrinth
uses: Kir-Antipov/[email protected]
with:
modrinth-id: NNAgCjsB
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
loaders: neoforge
name: ${{github.ref_name}}-1.21 - NeoForge
files: 'versions/1.21-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
- name: Publish-1.21-fabric-Curseforge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 448233
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
loaders: fabric
name: ${{github.ref_name}}-1.21 - Fabric
files: 'versions/1.21-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
- name: Publish-1.21-fabric-Modrinth
uses: Kir-Antipov/[email protected]
with:
modrinth-id: NNAgCjsB
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
loaders: fabric
name: ${{github.ref_name}}-1.21 - Fabric
files: 'versions/1.21-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar'
game-versions: 1.21
5 changes: 4 additions & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"1.20.4-fabric",
"1.20.6-forge",
"1.20.6-neoforge",
"1.20.6-fabric"
"1.20.6-fabric",
"1.21-forge",
"1.21-neoforge",
"1.21-fabric"
]
}
6 changes: 3 additions & 3 deletions src/main/java/dev/tr7zw/entityculling/CullTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void run() {
Thread.sleep(sleepDelay);
if (EntityCullingVersionlessBase.enabled && client.level != null && client.player != null
&& client.player.tickCount > 10) {
Vec3 cameraMC = EntityCullingModBase.instance.config.debugMode
? client.player.getEyePosition(client.getDeltaFrameTime())
// getEyePosition can use a fixed delta as its debug only anyway
Vec3 cameraMC = EntityCullingModBase.instance.config.debugMode ? client.player.getEyePosition(0)
: client.gameRenderer.getMainCamera().getPosition();

if (requestCull
Expand Down Expand Up @@ -143,7 +143,7 @@ private void cullBlockEntities(Vec3 cameraMC, Vec3d camera) {
} catch (NullPointerException | ConcurrentModificationException ex) {
break; // We are not synced to the main thread, so NPE's/CME are allowed here and way
// less
// overhead probably than trying to sync stuff up for no really good reason
// overhead probably than trying to sync stuff up for no really good reason
}
if (blockEntityWhitelist.contains(entry.getValue().getType())) {
continue;
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//$$ import net.neoforged.fml.IExtensionPoint;
//$$ import net.neoforged.fml.ModLoadingContext;
//$$ import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
//$$ import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
//$$ import net.neoforged.neoforge.common.NeoForge;
//#else
//$$ import net.minecraftforge.common.MinecraftForge;
Expand Down Expand Up @@ -57,13 +56,9 @@ public void initModloader() {
//$$ public class EntityCullingMod extends EntityCullingModBase {
//$$
//$$ public EntityCullingMod() {
//$$ FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
//$$ ModLoaderUtil.registerClientSetupListener(this::onInitialize);
//$$ }
//$$
//$$ private void setup(final FMLCommonSetupEvent event) {
//$$ onInitialize();
//$$ }
//$$
//$$ @Override
//$$ public void initModloader() {
//$$ ModLoaderUtil.registerKeybind(keybind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.logisticscraft.occlusionculling.OcclusionCullingInstance;

import dev.tr7zw.entityculling.versionless.EntityCullingVersionlessBase;
import dev.tr7zw.util.NMSHelper;
import net.minecraft.ChatFormatting;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -58,21 +59,21 @@ public void clientTick() {
cullThread.start();
for (String blockId : config.blockEntityWhitelist) {
Optional<BlockEntityType<?>> block = BuiltInRegistries.BLOCK_ENTITY_TYPE
.getOptional(new ResourceLocation(blockId));
.getOptional(NMSHelper.getResourceLocation(blockId));
block.ifPresent(b -> {
blockEntityWhitelist.add(b);
});
}
for (String entityType : config.tickCullingWhitelist) {
Optional<EntityType<?>> entity = BuiltInRegistries.ENTITY_TYPE
.getOptional(new ResourceLocation(entityType));
.getOptional(NMSHelper.getResourceLocation(entityType));
entity.ifPresent(e -> {
entityWhistelist.add(e);
});
}
for (String entityType : config.entityWhitelist) {
Optional<EntityType<?>> entity = BuiltInRegistries.ENTITY_TYPE
.getOptional(new ResourceLocation(entityType));
.getOptional(NMSHelper.getResourceLocation(entityType));
entity.ifPresent(e -> {
entityWhistelist.add(e);
});
Expand Down
2 changes: 1 addition & 1 deletion versions/mainProject
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.6-fabric
1.21-fabric

0 comments on commit 59c4563

Please sign in to comment.