generated from RubixDev/CarpetAddonTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental
minecartMaxSpeedMultiplier
rule
- Loading branch information
Showing
5 changed files
with
60 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
18 changes: 18 additions & 0 deletions
18
src/main/java/de/rubixdev/rug/mixins/AbstractMinecartEntityMixin.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 de.rubixdev.rug.mixins; | ||
|
||
import de.rubixdev.rug.RugSettings; | ||
import net.minecraft.entity.vehicle.AbstractMinecartEntity; | ||
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; | ||
|
||
@Mixin(AbstractMinecartEntity.class) | ||
public class AbstractMinecartEntityMixin { | ||
@Inject(method = "getMaxSpeed", at = @At("RETURN"), cancellable = true) | ||
private void applyMultiplier(CallbackInfoReturnable<Double> cir) { | ||
if (RugSettings.minecartMaxSpeedMultiplier != 1.0) { | ||
cir.setReturnValue(cir.getReturnValueD() * RugSettings.minecartMaxSpeedMultiplier); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/de/rubixdev/rug/mixins/FurnaceMinecartEntityMixin.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 de.rubixdev.rug.mixins; | ||
|
||
import de.rubixdev.rug.RugSettings; | ||
import net.minecraft.entity.vehicle.FurnaceMinecartEntity; | ||
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; | ||
|
||
@Mixin(FurnaceMinecartEntity.class) | ||
public class FurnaceMinecartEntityMixin { | ||
@Inject(method = "getMaxSpeed", at = @At("RETURN"), cancellable = true) | ||
private void applyMultiplier(CallbackInfoReturnable<Double> cir) { | ||
if (RugSettings.minecartMaxSpeedMultiplier != 1.0) { | ||
cir.setReturnValue(cir.getReturnValueD() * RugSettings.minecartMaxSpeedMultiplier); | ||
} | ||
} | ||
} |
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