Skip to content

Commit

Permalink
Remove mixin.experimental.entity.block_caching.fluid_pushing from neo…
Browse files Browse the repository at this point in the history
…forge version due to incompatibility
  • Loading branch information
2No2Name committed Oct 10, 2024
1 parent cefd1af commit b39a6b6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
1 change: 0 additions & 1 deletion common/src/main/resources/lithium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"experimental.entity.block_caching.block_support.EntityMixin",
"experimental.entity.block_caching.block_touching.EntityMixin",
"experimental.entity.block_caching.fire_lava_touching.EntityMixin",
"experimental.entity.block_caching.fluid_pushing.EntityMixin",
"experimental.entity.block_caching.suffocation.EntityMixin",
"experimental.entity.item_entity_merging.ItemEntityMixin",
"experimental.spawning.EntitySectionAccessor",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package net.caffeinemc.mods.lithium.mixin.experimental.entity.block_caching.fluid_pushing;
package net.caffeinemc.mods.lithium.fabric.mixin.experimental.entity.block_caching.fluid_pushing;

import com.llamalad7.mixinextras.sugar.Local;
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
import net.caffeinemc.mods.lithium.common.entity.block_tracking.BlockCache;
import net.caffeinemc.mods.lithium.common.entity.block_tracking.BlockCacheProvider;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

@Mixin(Entity.class)
public abstract class EntityMixin implements BlockCacheProvider {
@Shadow
public abstract AABB getBoundingBox();

@Shadow
protected Object2DoubleMap<TagKey<Fluid>> fluidHeight;

Expand All @@ -38,12 +34,11 @@ private void skipFluidSearchUsingCache(TagKey<Fluid> fluid, double speed, Callba
}
}

@SuppressWarnings("InvalidInjectorMethodSignature")
@Inject(
method = "updateFluidHeightAndDoFluidPushing(Lnet/minecraft/tags/TagKey;D)Z", locals = LocalCapture.CAPTURE_FAILHARD,
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;length()D", ordinal = 0, shift = At.Shift.BEFORE)
method = "updateFluidHeightAndDoFluidPushing(Lnet/minecraft/tags/TagKey;D)Z",
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/phys/Vec3;length()D", ordinal = 0)
)
private void cacheFluidSearchResult(TagKey<Fluid> fluid, double speed, CallbackInfoReturnable<Boolean> cir, AABB box, int i1, int i2, int i3, int i4, int i5, int i6, double fluidHeight, boolean isPushedbyFluids, boolean touchingFluid, Vec3 fluidPush, int i7) {
private void cacheFluidSearchResult(TagKey<Fluid> fluid, double speed, CallbackInfoReturnable<Boolean> cir, @Local(ordinal = 1) double fluidHeight, @Local(ordinal = 1) boolean touchingFluid, @Local Vec3 fluidPush) {
BlockCache bc = this.lithium$getBlockCache();
if (bc.isTracking() && fluidPush.lengthSqr() == 0d) {
if (touchingFluid == (fluidHeight == 0d)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@MixinConfigOption(description = "Use the block listening system to cache entity fluid interaction when not touching fluid currents.",
depends = @MixinConfigDependency(dependencyPath = "mixin.util.block_tracking"))
package net.caffeinemc.mods.lithium.mixin.experimental.entity.block_caching.fluid_pushing;
package net.caffeinemc.mods.lithium.fabric.mixin.experimental.entity.block_caching.fluid_pushing;

import net.caffeinemc.gradle.MixinConfigDependency;
import net.caffeinemc.gradle.MixinConfigOption;
3 changes: 2 additions & 1 deletion fabric/src/main/resources/lithium-fabric.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"package" : "net.caffeinemc.mods.lithium.fabric.mixin",
"required" : true,
"compatibilityLevel" : "JAVA_21",
"plugin": "net.caffeinemc.mods.lithium.mixin.LithiumMixinPlugin",
"plugin" : "net.caffeinemc.mods.lithium.mixin.LithiumMixinPlugin",
"refmap" : "lithium-fabric.refmap.json",
"injectors" : {
"defaultRequire" : 1
Expand All @@ -15,6 +15,7 @@
"compat.transfer_api.TransferApiHelperMixin",
"compat.worldedit.LevelChunkMixin",
"entity.collisions.fluid.EntityMixin",
"experimental.entity.block_caching.fluid_pushing.EntityMixin",
"util.inventory_change_listening.ChestBlockEntityMixin"
],
"client" : [
Expand Down
6 changes: 0 additions & 6 deletions lithium-neoforge-mixin-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,6 @@ Requirements:
(default: `true`)
Skip searching for fire or lava in the burn time countdown logic when they are not on fire and the result does not make a difference. Also use the block listening system to cache whether the entity is touching fire or lava.

### `mixin.experimental.entity.block_caching.fluid_pushing`
(default: `true`)
Use the block listening system to cache entity fluid interaction when not touching fluid currents.
Requirements:
- `mixin.util.block_tracking=true`

### `mixin.experimental.entity.block_caching.suffocation`
(default: `true`)
Use the block listening system to cache the entity suffocation check.
Expand Down

0 comments on commit b39a6b6

Please sign in to comment.