-
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.
fix: get roll from external mods instead of matrix in RollComputer
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
- Loading branch information
1 parent
04e9713
commit da13d43
Showing
7 changed files
with
56 additions
and
43 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
12 changes: 7 additions & 5 deletions
12
src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRInterface.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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
package ru.octol1ttle.flightassistant.compatibility.doabarrelroll; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import nl.enjarai.doabarrelroll.api.RollEntity; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
@ApiStatus.Internal | ||
public class DaBRInterface { | ||
public static void setRoll(float newRoll) { | ||
if (MinecraftClient.getInstance().player != null) { | ||
((RollEntity) MinecraftClient.getInstance().player).doABarrelRoll$setRoll(newRoll); | ||
} | ||
static float getRoll(PlayerEntity player) { | ||
return ((RollEntity) player).doABarrelRoll$getRoll(); | ||
} | ||
|
||
static void setRoll(PlayerEntity player, float newRoll) { | ||
((RollEntity) player).doABarrelRoll$setRoll(newRoll); | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
...main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRRollActuator.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRRollHandler.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,30 @@ | ||
package ru.octol1ttle.flightassistant.compatibility.doabarrelroll; | ||
|
||
import org.jetbrains.annotations.ApiStatus; | ||
import ru.octol1ttle.flightassistant.computers.api.IRollHandler; | ||
import ru.octol1ttle.flightassistant.computers.impl.AirDataComputer; | ||
import ru.octol1ttle.flightassistant.registries.ComputerRegistry; | ||
|
||
@ApiStatus.Internal | ||
public class DaBRRollHandler implements IRollHandler { | ||
private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); | ||
|
||
@Override | ||
public float getRoll() { | ||
return DaBRInterface.getRoll(data.player()); | ||
} | ||
|
||
@Override | ||
public void setRoll(float newRoll) { | ||
DaBRInterface.setRoll(data.player(), newRoll); | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return "dabr_roll"; | ||
} | ||
|
||
@Override | ||
public void reset() { | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
...ssistant/computers/api/IRollActuator.java → ...assistant/computers/api/IRollHandler.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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package ru.octol1ttle.flightassistant.computers.api; | ||
|
||
public interface IRollActuator extends IComputer { | ||
public interface IRollHandler extends IComputer { | ||
float getRoll(); | ||
void setRoll(float newRoll); | ||
} |
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