generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
insanebehaviors
config options insaneBehaviorsIncrement
and…
… `insaneBehaviorsSkipVisitedPoints`, which both alter the behavior of the `insaneBehaviors` iterator. Added semi-experimental survival carpet rule `VerticalRocketsFromStandStill` with accompanying config `verticalRocketPower` Bump version to 2.2.0
- Loading branch information
1 parent
3566163
commit 1b9781a
Showing
12 changed files
with
201 additions
and
7 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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/com/joacarpet/mixin/miscSurvival/VerticalRocketsFromStandstillMixin1.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,49 @@ | ||
/* | ||
* This file is part of the JoaCarpet project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 Joa and contributors | ||
* | ||
* JoaCarpet is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* JoaCarpet is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with JoaCarpet. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.joacarpet.mixin.miscSurvival; | ||
|
||
import com.google.common.collect.Iterables; | ||
import com.joacarpet.JoaCarpetSettings; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.FireworkRocketItem; | ||
import net.minecraft.world.item.Items; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import static com.google.common.collect.Iterables.get; | ||
|
||
@Mixin(FireworkRocketItem.class) | ||
public class VerticalRocketsFromStandstillMixin1 { | ||
|
||
@WrapOperation( | ||
method = "use", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;isFallFlying()Z") | ||
) | ||
private boolean requireOnGround(Player player, Operation<Boolean> original) { | ||
if (JoaCarpetSettings.verticalRocketsFromStandstill.equals("true")) | ||
return player.onGround() | ||
&& Iterables.get(player.getArmorSlots(), 2).is(Items.ELYTRA) | ||
&& Iterables.get(player.getArmorSlots(), 2).getDamageValue() < 431; | ||
return original.call(player); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/joacarpet/mixin/miscSurvival/VerticalRocketsFromStandstillMixin2.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,56 @@ | ||
/* | ||
* This file is part of the JoaCarpet project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 Joa and contributors | ||
* | ||
* JoaCarpet is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* JoaCarpet is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with JoaCarpet. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.joacarpet.mixin.miscSurvival; | ||
|
||
import com.joacarpet.JoaCarpetSettings; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.entity.projectile.FireworkRocketEntity; | ||
import net.minecraft.world.phys.Vec3; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyArgs; | ||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args; | ||
|
||
@Mixin(FireworkRocketEntity.class) | ||
public class VerticalRocketsFromStandstillMixin2 { | ||
|
||
@WrapOperation( | ||
method = "tick", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;isFallFlying()Z") | ||
) | ||
private boolean ignoreIsFallFlying(LivingEntity livingEntity, Operation<Boolean> original) { | ||
if (JoaCarpetSettings.verticalRocketsFromStandstill.equals("true")){ | ||
return true; | ||
} | ||
return original.call(livingEntity); | ||
} | ||
|
||
@ModifyArgs( | ||
method = "tick", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;setDeltaMovement(Lnet/minecraft/world/phys/Vec3;)V") | ||
) | ||
private void rocketStraightUp(Args args) { | ||
if (JoaCarpetSettings.verticalRocketsFromStandstill.equals("true")) | ||
args.set(0, new Vec3(0.0, JoaCarpetSettings.verticalRocketPower, 0.0)); | ||
} | ||
} |
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,9 +1,11 @@ | ||
{ | ||
"carpet.rule.insaneBehaviors.desc": "Makes the random velocities of droppers and projectiles (as well as both the position and velocity of blocks broken by pistons) systematically iterate through the most extreme values possible, and then repeatedly iterate through all the halfway points in between, in a sense attempting every point in a 3d/5d \"grid\" that slowly increases in resolution.\nFor droppers and projectiles, this setting determines whether the max value corresponds to the old gaussian randomness limits (\"extreme\"), or the limits of the triangular randomness introduced in 1.19 (\"sensible\"). Both settings function the same for blocks being broken by pistons.\nFor the `/insanebehaviors <reset/getstate/setstate>` command, see `/carpet commandInsaneBehaviors`.\nDo note that insaneBehaviors works on a global iterator: any triggering event will step through an iteration from all other insaneBehaviors events, too.", | ||
"carpet.rule.insaneBehaviorsSkipVisitedPoints.desc": "Makes the `insaneBehaviors` rule skip points that coincide with previous resolutions, reducing the overall search space by a fraction that approaches 1/(2^resolution)", | ||
"carpet.rule.insaneBehaviorsIncrement.desc": "Determines the incrementing behavior of the `insaneBehaviors` rule. If set to normal, the counter increments normally until all points of the current resolution have been exhausted, then step to the next resolution.\n`loopCurrentResolution` will instead restart at the beginning of the current resolution.\n`Freeze` will stop both the counter and resolution from incrementing.", | ||
"carpet.rule.insaneBehaviorsIncrement.desc": "Determines the incrementing behavior of the `insaneBehaviors` rule. If set to `normal`, the counter increments normally until all points of the current resolution have been exhausted, then step to the next resolution.\n`loopCurrentResolution` will instead restart at the beginning of the current resolution.\n`Freeze` will stop both the counter and resolution from incrementing.", | ||
"carpet.rule.commandInsaneBehaviors.desc": "The command used for the `insaneBehaviors` rule.\n\"reset\" sets the `resolution` and `counter` back to the default values. \"getstate\" and \"setstate\" are used to manually read and write the current iteration state.", | ||
"carpet.rule.commandBlockTickling.desc": "Controls who can use the `/blocktickling` command, which lets you send manual block and/or shape updates to blocks using a feather item. Updates are sent from the block in front of the face you're clicking on. Useful if you're working with budded blocks, with /carpet interactionUpdates off, or with intricarpet's /interaction command.", | ||
"carpet.rule.disableEndermanGriefing.desc": "Disables enderman griefing.", | ||
"carpet.rule.disableElytraRockets.desc": "Disables using rockets with elytra." | ||
"carpet.rule.disableElytraRockets.desc": "Disables using rockets with elytra.", | ||
"carpet.rule.verticalRocketsFromStandstill.desc": "Makes rocket flying only activate while standing on the ground, and makes it only propel you upwards. Disables using rockets while already flying.\nOnly works in singleplayer, or with JoaCarpet installed both serverside and clientside.", | ||
"carpet.rule.verticalRocketPower.desc": "The vertical acceleration power used with the `verticalRocketsFromStandstill` rule." | ||
} |
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