forked from Jorbon/cool_elytra
-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forge users will see this and just be like "hell yea"
- Loading branch information
Showing
16 changed files
with
97 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
- Added support for Forge & NeoForge 1.20.1. | ||
- Removed dependency on Forgified Fabric API. |
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
14 changes: 14 additions & 0 deletions
14
common/src/main/java/nl/enjarai/doabarrelroll/EventCallbacks.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,14 @@ | ||
package nl.enjarai.doabarrelroll; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.network.ServerPlayNetworkHandler; | ||
|
||
public class EventCallbacks { | ||
public static void serverTick(MinecraftServer server) { | ||
DoABarrelRoll.HANDSHAKE_SERVER.tick(server); | ||
} | ||
|
||
public static void playerDisconnected(ServerPlayNetworkHandler handler) { | ||
DoABarrelRoll.HANDSHAKE_SERVER.playerDisconnected(handler); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
common/src/main/java/nl/enjarai/doabarrelroll/EventCallbacksClient.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,50 @@ | ||
package nl.enjarai.doabarrelroll; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.DrawContext; | ||
import nl.enjarai.doabarrelroll.api.RollEntity; | ||
import nl.enjarai.doabarrelroll.api.RollMouse; | ||
import nl.enjarai.doabarrelroll.config.ModConfig; | ||
import nl.enjarai.doabarrelroll.impl.key.InputContextImpl; | ||
import nl.enjarai.doabarrelroll.render.HorizonLineWidget; | ||
import nl.enjarai.doabarrelroll.render.MomentumCrosshairWidget; | ||
import nl.enjarai.doabarrelroll.util.StarFoxUtil; | ||
import org.joml.Vector2d; | ||
|
||
public class EventCallbacksClient { | ||
public static void clientTick(MinecraftClient client) { | ||
InputContextImpl.getContexts().forEach(InputContextImpl::tick); | ||
|
||
if (!DoABarrelRollClient.isFallFlying()) { | ||
DoABarrelRollClient.clearValues(); | ||
} | ||
|
||
ModKeybindings.clientTick(client); | ||
|
||
StarFoxUtil.clientTick(client); | ||
} | ||
|
||
public static void clientDisconnect() { | ||
DoABarrelRollClient.HANDSHAKE_CLIENT.reset(); | ||
} | ||
|
||
public static void onRenderCrosshair(DrawContext context, float tickDelta, int scaledWidth, int scaledHeight) { | ||
if (!DoABarrelRollClient.isFallFlying()) return; | ||
|
||
var matrices = context.getMatrices(); | ||
var entity = MinecraftClient.getInstance().getCameraEntity(); | ||
var rollEntity = ((RollEntity) entity); | ||
if (entity != null) { | ||
if (ModConfig.INSTANCE.getShowHorizon()) { | ||
HorizonLineWidget.render(matrices, scaledWidth, scaledHeight, | ||
rollEntity.doABarrelRoll$getRoll(tickDelta), entity.getPitch(tickDelta)); | ||
} | ||
|
||
if (ModConfig.INSTANCE.getMomentumBasedMouse() && ModConfig.INSTANCE.getShowMomentumWidget()) { | ||
var rollMouse = (RollMouse) MinecraftClient.getInstance().mouse; | ||
|
||
MomentumCrosshairWidget.render(matrices, scaledWidth, scaledHeight, new Vector2d(rollMouse.doABarrelRoll$getMouseTurnVec())); | ||
} | ||
} | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
...rai/doabarrelroll/net/RollSyncServer.java → ...rrelroll/net/register/RollSyncServer.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
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