-
Notifications
You must be signed in to change notification settings - Fork 26
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
11 changed files
with
96 additions
and
23 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
8 changes: 0 additions & 8 deletions
8
src/main/java/net/himeki/mcmtfabric/mixin/CheckedRandomMixin.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/main/java/net/himeki/mcmtfabric/mixin/LockHelperMixin.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,18 @@ | ||
package net.himeki.mcmtfabric.mixin; | ||
|
||
import net.minecraft.util.thread.LockHelper; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.concurrent.Semaphore; | ||
|
||
@Mixin(LockHelper.class) | ||
public abstract class LockHelperMixin { | ||
|
||
@Shadow | ||
@Final | ||
@Mutable | ||
private Semaphore semaphore = new Semaphore(255); | ||
} |
11 changes: 10 additions & 1 deletion
11
src/main/java/net/himeki/mcmtfabric/mixin/NearestLivingEntitiesSensorMixin.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,8 +1,17 @@ | ||
package net.himeki.mcmtfabric.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.ai.brain.sensor.NearestLivingEntitiesSensor; | ||
import net.minecraft.server.world.ServerWorld; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(NearestLivingEntitiesSensor.class) | ||
public class NearestLivingEntitiesSensorMixin { | ||
public class NearestLivingEntitiesSensorMixin<T extends LivingEntity> { | ||
|
||
@WrapMethod(method = "sense") | ||
private synchronized void syncSense(ServerWorld world, T entity, Operation<Void> original) { | ||
original.call(world, entity); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/net/himeki/mcmtfabric/mixin/PathNodeNavigatorMixin.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,8 +1,21 @@ | ||
package net.himeki.mcmtfabric.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import net.minecraft.entity.ai.pathing.Path; | ||
import net.minecraft.entity.ai.pathing.PathNodeNavigator; | ||
import net.minecraft.entity.mob.MobEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.chunk.ChunkCache; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import java.util.Set; | ||
|
||
@Mixin(PathNodeNavigator.class) | ||
public class PathNodeNavigatorMixin { | ||
@WrapMethod(method = "findPathToAny(Lnet/minecraft/world/chunk/ChunkCache;Lnet/minecraft/entity/mob/MobEntity;Ljava/util/Set;FIF)Lnet/minecraft/entity/ai/pathing/Path;") | ||
private synchronized @Nullable Path syncFindPathToAny(ChunkCache world, MobEntity mob, Set<BlockPos> positions, float followRange, int distance, float rangeMultiplier, Operation<Path> original) { | ||
return original.call(world, mob, positions, followRange, distance, rangeMultiplier); | ||
} | ||
} |
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