-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt at fixing block state flags and path node caching
- Loading branch information
Showing
14 changed files
with
68 additions
and
35 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 |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
public interface BlockStateFlagHolder { | ||
int lithium$getAllFlags(); | ||
|
||
void lithium$initializeFlags(); | ||
} |
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
23 changes: 23 additions & 0 deletions
23
common/src/main/java/net/caffeinemc/mods/lithium/mixin/ai/pathing/BootstrapMixin.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,23 @@ | ||
package net.caffeinemc.mods.lithium.mixin.ai.pathing; | ||
|
||
import net.caffeinemc.mods.lithium.common.ai.pathing.BlockStatePathingCache; | ||
import net.minecraft.server.Bootstrap; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(Bootstrap.class) | ||
public class BootstrapMixin { | ||
@Inject( | ||
method = "bootStrap", | ||
at = @At("RETURN") | ||
) | ||
private static void afterBootstrap(CallbackInfo ci) { | ||
for (BlockState blockState : Block.BLOCK_STATE_REGISTRY) { | ||
((BlockStatePathingCache) blockState).lithium$initializePathNodeTypeCache(); | ||
} | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
...n/src/main/java/net/caffeinemc/mods/lithium/mixin/util/block_tracking/BootstrapMixin.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,23 @@ | ||
package net.caffeinemc.mods.lithium.mixin.util.block_tracking; | ||
|
||
import net.caffeinemc.mods.lithium.common.block.BlockStateFlagHolder; | ||
import net.minecraft.server.Bootstrap; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = Bootstrap.class, priority = 1010) | ||
public class BootstrapMixin { | ||
@Inject( | ||
method = "bootStrap", | ||
at = @At("RETURN") | ||
) | ||
private static void afterBootstrap(CallbackInfo ci) { | ||
for (BlockState blockState : Block.BLOCK_STATE_REGISTRY) { | ||
((BlockStateFlagHolder) blockState).lithium$initializeFlags(); | ||
} | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
common/src/main/java/net/caffeinemc/mods/lithium/mixin/world/inline_height/package-info.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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
@MixinConfigOption(description = "Reduces indirection by inlining world height access methods", enabled = false) //TODO find out why this crashes the render thread | ||
@MixinConfigOption( | ||
description = "Reduces indirection by inlining world height access methods", | ||
enabled = false //TODO find out why this crashes the render thread | ||
) | ||
package net.caffeinemc.mods.lithium.mixin.world.inline_height; | ||
|
||
import net.caffeinemc.gradle.MixinConfigOption; |
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
2 changes: 1 addition & 1 deletion
2
.../main/java/net/caffeinemc/mods/lithium/fabric/mixin/compat/transfer_api/package-info.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
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