Skip to content

Commit db5c54a

Browse files
committed
get ported on!!!
1 parent 9fcec7d commit db5c54a

38 files changed

+1271
-456
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ plugins {
1717

1818
toolkitLoomHelper {
1919
useOneConfig {
20-
version = "1.0.0-alpha.70"
21-
loaderVersion = "1.1.0-alpha.44"
20+
version = "1.0.0-alpha.169"
21+
loaderVersion = "1.1.0-alpha.49"
2222

2323
usePolyMixin = true
24-
polyMixinVersion = "0.8.4+build.2"
24+
polyMixinVersion = "0.8.4+build.7"
2525

2626
applyLoaderTweaker = true
2727

root.gradle.kts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,40 @@ preprocess {
2828
// "1.8.9-forge"(10809, "srg")
2929
// }
3030

31-
"1.12.2-forge"(11202, "srg") {
32-
"1.12.2-fabric"(11202, "yarn") {
33-
"1.8.9-fabric"(10809, "yarn") {
34-
"1.8.9-forge"(10809, "srg")
31+
"1.21.8-fabric"(1_21_08, "yarn") {
32+
"1.21.8-neoforge"(1_21_08, "srg") {
33+
"1.21.5-neoforge"(1_21_05, "srg") {
34+
"1.21.5-fabric"(1_21_05, "yarn") {
35+
"1.21.4-fabric"(1_21_04, "yarn") {
36+
"1.21.4-neoforge"(1_21_04, "srg") {
37+
"1.21.1-neoforge"(1_21_01, "srg") {
38+
"1.21.1-fabric"(1_21_01, "yarn") {
39+
"1.20.4-fabric"(1_20_04, "yarn") {
40+
"1.20.4-neoforge"(1_20_04, "srg") {
41+
"1.20.4-forge"(1_20_04, "srg") {
42+
"1.20.1-forge"(1_20_01, "srg") {
43+
"1.20.1-fabric"(1_20_01, "yarn") {
44+
"1.16.5-fabric"(1_16_05, "yarn") {
45+
"1.16.5-forge"(1_16_05, "srg") {
46+
"1.12.2-forge"(1_12_02, "srg") {
47+
"1.12.2-fabric"(1_12_02, "yarn") {
48+
"1.8.9-fabric"(1_08_09, "yarn") {
49+
"1.8.9-forge"(1_08_09, "srg")
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
3565
}
3666
}
3767
}

settings.gradle.kts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pluginManagement {
2323
}
2424

2525
plugins {
26-
kotlin("jvm") version("2.0.0")
27-
id("dev.deftu.gradle.multiversion-root") version("2.35.0")
26+
kotlin("jvm") version("2.2.10")
27+
id("dev.deftu.gradle.multiversion-root") version("2.58.0")
2828
}
2929
}
3030

@@ -42,8 +42,31 @@ rootProject.buildFileName = "root.gradle.kts"
4242
listOf(
4343
"1.8.9-forge",
4444
"1.8.9-fabric",
45-
"1.12.2-fabric",
45+
4646
"1.12.2-forge",
47+
"1.12.2-fabric",
48+
49+
"1.16.5-forge",
50+
"1.16.5-fabric",
51+
52+
"1.20.1-forge",
53+
"1.20.1-fabric",
54+
55+
"1.20.4-forge",
56+
"1.20.4-neoforge",
57+
"1.20.4-fabric",
58+
59+
"1.21.1-neoforge",
60+
"1.21.1-fabric",
61+
62+
"1.21.4-neoforge",
63+
"1.21.4-fabric",
64+
65+
"1.21.5-neoforge",
66+
"1.21.5-fabric",
67+
68+
"1.21.8-neoforge",
69+
"1.21.8-fabric",
4770
).forEach { version ->
4871
include(":$version")
4972
project(":$version").apply {

src/main/java/org/polyfrost/polysprint/mixins/EntityPlayerSPMixin.java

Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* PolySprint - Toggle sprint and sneak with a keybind.
3+
* Copyright (C) 2023 Polyfrost
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package org.polyfrost.polysprint.mixins;
20+
21+
import net.minecraft.client.entity.EntityPlayerSP;
22+
import org.polyfrost.polysprint.client.PolySprintConfig;
23+
import org.spongepowered.asm.mixin.Mixin;
24+
import org.spongepowered.asm.mixin.Shadow;
25+
import org.spongepowered.asm.mixin.injection.At;
26+
import org.spongepowered.asm.mixin.injection.Inject;
27+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
28+
29+
@Mixin(EntityPlayerSP.class)
30+
public abstract class Mixin_DisableWTap {
31+
@Shadow protected int sprintToggleTimer;
32+
33+
@Inject(method = "onLivingUpdate", at = @At("HEAD"))
34+
private void polysprint$disableDoubleTap(CallbackInfo ci) {
35+
if (PolySprintConfig.isEnabled() && PolySprintConfig.getDisableWTapSprint()) {
36+
this.sprintToggleTimer = 0;
37+
}
38+
}
39+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* PolySprint - Toggle sprint and sneak with a keybind.
3+
* Copyright (C) 2023 Polyfrost
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package org.polyfrost.polysprint.mixins;
20+
21+
import com.mojang.authlib.GameProfile;
22+
import net.minecraft.client.entity.AbstractClientPlayer;
23+
import net.minecraft.client.entity.EntityPlayerSP;
24+
import net.minecraft.util.MovementInput;
25+
import net.minecraft.world.World;
26+
import org.polyfrost.polysprint.client.PolySprintConfig;
27+
import org.polyfrost.polysprint.client.SprintState;
28+
import org.spongepowered.asm.mixin.Mixin;
29+
import org.spongepowered.asm.mixin.Shadow;
30+
import org.spongepowered.asm.mixin.injection.At;
31+
import org.spongepowered.asm.mixin.injection.Inject;
32+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
33+
34+
@Mixin(EntityPlayerSP.class)
35+
public abstract class Mixin_SetFlyBoost extends AbstractClientPlayer {
36+
@Shadow public MovementInput movementInput;
37+
38+
public Mixin_SetFlyBoost(World worldIn, GameProfile playerProfile) {
39+
super(worldIn, playerProfile);
40+
}
41+
42+
@Inject(
43+
method = "onLivingUpdate",
44+
at = @At(
45+
value = "FIELD",
46+
target = "Lnet/minecraft/entity/player/PlayerCapabilities;allowFlying:Z",
47+
ordinal = 1
48+
)
49+
)
50+
private void modifyFlightSpeed(CallbackInfo ci) {
51+
if (!SprintState.isFlyBoosting()) {
52+
this.capabilities.setFlySpeed(0.05f);
53+
return;
54+
}
55+
56+
float boost = PolySprintConfig.getFlyBoostAmount();
57+
this.capabilities.setFlySpeed(0.05f * boost);
58+
if (this.capabilities.isFlying) {
59+
double yDelta = 0.0;
60+
if (this.movementInput.sneak) {
61+
yDelta -= 0.15 * boost;
62+
}
63+
64+
if (this.movementInput.jump) {
65+
yDelta += 0.15 * boost;
66+
}
67+
68+
if (yDelta != 0.0) {
69+
this.motionY += yDelta;
70+
}
71+
}
72+
}
73+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* PolySprint - Toggle sprint and sneak with a keybind.
3+
* Copyright (C) 2023 Polyfrost
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package org.polyfrost.polysprint.mixins;
20+
21+
// no-op below 1.16.5

0 commit comments

Comments
 (0)