Skip to content

Commit 66ddc1e

Browse files
committed
Switch to official-like and build on all versions
1 parent db5c54a commit 66ddc1e

File tree

8 files changed

+59
-35
lines changed

8 files changed

+59
-35
lines changed

build.gradle.kts

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

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

2323
usePolyMixin = true
2424
polyMixinVersion = "0.8.4+build.7"

gradle.properties

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
1-
# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
2-
org.gradle.daemon=true
3-
org.gradle.parallel=true
4-
org.gradle.configureoncommand=true
5-
org.gradle.parallel.threads=4
6-
org.gradle.jvmargs=-Xmx2G
7-
1+
### Mod Properties ###
2+
# The name used to produce your mod's JAR file, also appearing in Bloom processed files and the mod's metadata.
83
mod.name=PolySprint
4+
# Your mod's ID, which is used in the mod's metadata and for identifying the mod in the game. Must be unique from other mods.
95
mod.id=polysprint
6+
# The version of your mod, which is used in the mod's metadata and for version checks.
107
mod.version=1.1.0-alpha.1
11-
mod.group=org.polyfrost
8+
# The Maven group ID for your mod, which is used in the mod's metadata and for dependency management.
9+
mod.group=org.polyfrost
10+
######################
11+
12+
### DGT Configuration ###
13+
# Switches the mappings for all our versions to use MCP and mojmap.
14+
dgt.loom.mappings=official-like
15+
# Sets the DGT automatic Minecraft dependency list to revision 3. Update this to latest if you want to use the latest recommended versions of libraries.
16+
dgt.minecraft.revision=3
17+
#########################
18+
19+
#####################################################################################
20+
### DO NOT EDIT THE PROPERTIES BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ###
21+
#####################################################################################
22+
23+
### Gradle Configuration ###
24+
# Sets JVM arguments for Gradle to improve performance and stability.
25+
# Adjust memory settings as needed based on your system's capabilities.
26+
# If you're supporting the template's full version range, do not reduce these values any further, they're already quite low.
27+
org.gradle.jvmargs=-Xmx6144m -Dfile.encoding=UTF-8
28+
############################
29+
30+
### Loom Configuration ###
31+
# Allows us to use dependencies built with newer Loom by ignoring that it was built against a differing Loom version.
32+
# This is absolutely necessary because we use an older fork of Loom to enable Legacy Forge support.
33+
# As far as can be seen, there are absolutely no negative side effects to doing this. If you encounter any,
34+
# feel free to report them to the template's issue tracker and comment this line out to see if it resolves them.
35+
# You won't be able to use any dependencies built by newer Loom without this line, however.
36+
loom.ignoreDependencyLoomVersionValidation=true
37+
##########################

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pluginManagement {
2424

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

src/main/kotlin/org/polyfrost/polysprint/client/PolySprintConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.polyfrost.polyui.input.KeybindHelper
2929

3030
//#if MC >= 1.16.5
3131
//$$ import dev.deftu.omnicore.api.client.client
32+
//$$ import org.polyfrost.oneconfig.api.config.v1.Property
3233
//#endif
3334

3435
object PolySprintConfig : Config(

versions/1.12.2-fabric/src/main/java/org/polyfrost/polysprint/mixins/event/Mixin_FlyEvent_2EletricBoogaloo.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@
1818

1919
package org.polyfrost.polysprint.mixins.event;
2020

21-
import net.minecraft.entity.player.PlayerAbilities;
22-
import net.minecraft.world.GameMode;
23-
import net.minecraft.world.level.LevelInfo;
21+
import net.minecraft.entity.player.PlayerCapabilities;
22+
import net.minecraft.world.GameType;
2423
import org.polyfrost.oneconfig.api.event.v1.EventManager;
2524
import org.polyfrost.oneconfig.api.event.v1.events.Event;
2625
import org.polyfrost.polysprint.client.SprintStateEvent;
2726
import org.spongepowered.asm.mixin.Mixin;
2827
import org.spongepowered.asm.mixin.injection.At;
2928
import org.spongepowered.asm.mixin.injection.Redirect;
3029

31-
@Mixin(GameMode.class)
30+
@Mixin(GameType.class)
3231
public abstract class Mixin_FlyEvent_2EletricBoogaloo {
33-
@Redirect(method = "gameModeAbilities", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerAbilities;flying:Z"))
34-
private void onSetFlying(PlayerAbilities instance, boolean state) {
35-
instance.flying = state;
32+
@Redirect(method = "configurePlayerCapabilities", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerCapabilities;isFlying:Z"))
33+
private void onSetFlying(PlayerCapabilities instance, boolean state) {
34+
instance.isFlying = state;
3635
Event event;
3736
if (state) {
3837
event = new SprintStateEvent.Start(SprintStateEvent.Type.FLY);

versions/1.12.2-fabric/src/main/java/org/polyfrost/polysprint/mixins/event/Mixin_RideEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030

3131
@Mixin(Entity.class)
3232
public abstract class Mixin_RideEvent {
33-
@Inject(method = "startRiding", at = @At("HEAD"))
33+
@Inject(method = "startRiding(Lnet/minecraft/entity/Entity;Z)Z", at = @At("HEAD"))
3434
private void onMount(Entity entityIn, boolean force, CallbackInfoReturnable<Boolean> cir) {
3535
//noinspection ConstantConditions
3636
if ((Object) this == OmniClient.getPlayer()) {
3737
EventManager.INSTANCE.post(new SprintStateEvent.Start(SprintStateEvent.Type.RIDE));
3838
}
3939
}
4040

41-
@Inject(method = "stopRiding", at = @At("HEAD"))
41+
@Inject(method = "dismountRidingEntity", at = @At("HEAD"))
4242
private void onDismount(CallbackInfo ci) {
4343
//noinspection ConstantConditions
4444
if ((Object) this == OmniClient.getPlayer()) {

versions/1.20.1-fabric/src/main/java/org/polyfrost/polysprint/mixins/Mixin_SetFlyBoost.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
package org.polyfrost.polysprint.mixins;
2020

2121
import com.mojang.authlib.GameProfile;
22-
import net.minecraft.client.world.ClientWorld;
23-
import net.minecraft.client.network.AbstractClientPlayerEntity;
24-
import net.minecraft.client.input.Input;
25-
import net.minecraft.client.network.ClientPlayerEntity;
22+
import net.minecraft.client.multiplayer.ClientLevel;
23+
import net.minecraft.client.player.AbstractClientPlayer;
24+
import net.minecraft.client.player.Input;
25+
import net.minecraft.client.player.LocalPlayer;
2626
import org.polyfrost.polysprint.client.PolySprintConfig;
2727
import org.polyfrost.polysprint.client.SprintState;
2828
import org.spongepowered.asm.mixin.Mixin;
@@ -31,26 +31,26 @@
3131
import org.spongepowered.asm.mixin.injection.Inject;
3232
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
3333

34-
@Mixin(ClientPlayerEntity.class)
35-
public abstract class Mixin_SetFlyBoost extends AbstractClientPlayerEntity {
34+
@Mixin(LocalPlayer.class)
35+
public abstract class Mixin_SetFlyBoost extends AbstractClientPlayer {
3636
@Shadow public Input input;
3737

38-
public Mixin_SetFlyBoost(ClientWorld level, GameProfile profile) {
38+
public Mixin_SetFlyBoost(ClientLevel level, GameProfile profile) {
3939
super(level, profile);
4040
}
4141

42-
@Inject(method = "tickMovement", at = @At("HEAD"))
42+
@Inject(method = "aiStep", at = @At("HEAD"))
4343
private void polysprint$modifyFlightSpeed(CallbackInfo ci) {
4444
if (!SprintState.isFlyBoosting()) {
45-
this.getAbilities().setFlySpeed(0.05f);
45+
this.getAbilities().setFlyingSpeed(0.05f);
4646
return;
4747
}
4848

4949
float boost = PolySprintConfig.getFlyBoostAmount();
50-
this.getAbilities().setFlySpeed(0.05f * boost);
50+
this.getAbilities().setFlyingSpeed(0.05f * boost);
5151
if (this.getAbilities().flying) {
5252
double yDelta = 0.0;
53-
if (this.input.sneaking) {
53+
if (this.input.shiftKeyDown) {
5454
yDelta -= 0.15 * boost;
5555
}
5656

@@ -59,7 +59,7 @@ public Mixin_SetFlyBoost(ClientWorld level, GameProfile profile) {
5959
}
6060

6161
if (yDelta != 0.0) {
62-
this.setVelocity(this.getVelocity().add(0.0D, yDelta, 0.0D));
62+
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, yDelta, 0.0D));
6363
}
6464
}
6565
}

versions/1.20.1-fabric/src/main/java/org/polyfrost/polysprint/mixins/event/Mixin_SprintEvent_2EletricBoogaloo.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
package org.polyfrost.polysprint.mixins.event;
2020

2121
import dev.deftu.omnicore.api.client.OmniClient;
22-
import net.minecraft.client.network.ClientPlayerEntity;
23-
import net.minecraft.entity.LivingEntity;
22+
import net.minecraft.world.entity.LivingEntity;
2423
import org.polyfrost.oneconfig.api.event.v1.EventManager;
25-
import org.polyfrost.oneconfig.api.event.v1.events.Event;
2624
import org.polyfrost.polysprint.client.SprintStateEvent;
2725
import org.spongepowered.asm.mixin.Mixin;
2826
import org.spongepowered.asm.mixin.injection.At;

0 commit comments

Comments
 (0)