-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
2e3b4f9
commit 9dc4848
Showing
7 changed files
with
69 additions
and
0 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/club/mcams/carpet/mixin/rule/fasterMovement/PlayerEntityMixin.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,26 @@ | ||
package club.mcams.carpet.mixin.rule.fasterMovement; | ||
|
||
import club.mcams.carpet.AmsServerSettings; | ||
|
||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
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.CallbackInfoReturnable; | ||
|
||
import java.util.Objects; | ||
|
||
@Mixin(PlayerEntity.class) | ||
public abstract class PlayerEntityMixin { | ||
@Inject(method = "getMovementSpeed", at = @At("HEAD"), cancellable = true) | ||
public void getMovementSpeed(CallbackInfoReturnable<Float> cir) { | ||
if (Objects.equals(AmsServerSettings.fasterMovement, "Ⅰ")) { | ||
cir.setReturnValue(0.2F); | ||
} else if (Objects.equals(AmsServerSettings.fasterMovement, "Ⅱ")) { | ||
cir.setReturnValue(0.3F); | ||
} else if (Objects.equals(AmsServerSettings.fasterMovement, "Ⅲ")) { | ||
cir.setReturnValue(0.4F); | ||
} | ||
} | ||
} |
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