-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/coltonk9043/Aoba-MC-Hacke…
- Loading branch information
Showing
19 changed files
with
634 additions
and
33 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 |
---|---|---|
|
@@ -25,6 +25,9 @@ jobs: | |
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Fetch Build Time | ||
run: echo "time=$(date + "%Y-%m-%d")" >> $GITHUB_ENV | ||
|
||
- name: Build | ||
run: ./gradlew build | ||
|
||
|
@@ -34,8 +37,8 @@ jobs: | |
- uses: "0xDylan/[email protected]" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: nightly-${{ github.run_number }} | ||
automatic_release_tag: nightly-${{ env.TIME }} | ||
prerelease: true | ||
title: Nightly Build ${{ github.run_number }} | ||
title: Nightly Build ${{ env.TIME }} | ||
files: | | ||
./build/libs/*.jar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package net.aoba.cmd.commands; | ||
|
||
import net.aoba.Aoba; | ||
import net.aoba.cmd.Command; | ||
import net.aoba.cmd.CommandManager; | ||
import net.minecraft.util.Formatting; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class CmdHistory extends Command { | ||
|
||
private static final int HISTORY_PER_PAGE = 5; | ||
|
||
public CmdHistory() { | ||
super("history", "Shows the command history.", "[page]"); | ||
} | ||
|
||
@Override | ||
public void runCommand(String[] parameters) { | ||
if (parameters.length == 0) { | ||
showHistory(1); | ||
} else if (StringUtils.isNumeric(parameters[0])) { | ||
int page = Integer.parseInt(parameters[0]); | ||
showHistory(page); | ||
} else { | ||
CommandManager.sendChatMessage("Invalid parameter. Usage: .aoba history [page]"); | ||
} | ||
} | ||
|
||
private void showHistory(int page) { | ||
CommandManager cm = Aoba.getInstance().commandManager; | ||
ArrayList<String> history = new ArrayList<>(cm.getCommandHistory()); | ||
int totalPages = (int) Math.ceil((double) history.size() / HISTORY_PER_PAGE); | ||
|
||
if (page < 1 || page > totalPages) { | ||
CommandManager.sendChatMessage("Page " + page + " does not exist. There are only " + totalPages + " pages."); | ||
return; | ||
} | ||
|
||
String title = "------------ Command History [Page " + page + " of " + totalPages + "] ------------"; | ||
CommandManager.sendChatMessage(title); | ||
|
||
int startIndex = (page - 1) * HISTORY_PER_PAGE; | ||
int endIndex = Math.min(startIndex + HISTORY_PER_PAGE, history.size()); | ||
|
||
for (int i = startIndex; i < endIndex; i++) { | ||
CommandManager.sendChatMessage((i + 1) + ": " + history.get(i)); | ||
} | ||
|
||
CommandManager.sendChatMessage("-".repeat(title.length() - 2)); // Adjust for Minecraft font width | ||
} | ||
|
||
@Override | ||
public String[] getAutocorrect(String previousParameter) { | ||
return new String[0]; // No autocorrect needed for history command | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/net/aoba/event/events/SendMovementPacketEvent.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,39 @@ | ||
package net.aoba.event.events; | ||
|
||
import net.aoba.event.listeners.AbstractListener; | ||
import net.aoba.event.listeners.SendMovementPacketListener; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SendMovementPacketEvent { | ||
public static class Pre extends AbstractEvent { | ||
@Override | ||
public void Fire(ArrayList<? extends AbstractListener> listeners) { | ||
for (AbstractListener listener : List.copyOf(listeners)) { | ||
SendMovementPacketListener sendMovementPacketListener = (SendMovementPacketListener) listener; | ||
sendMovementPacketListener.onSendMovementPacket(this); | ||
} | ||
} | ||
|
||
@Override | ||
public Class<SendMovementPacketListener> GetListenerClassType() { | ||
return SendMovementPacketListener.class; | ||
} | ||
} | ||
|
||
public static class Post extends AbstractEvent { | ||
@Override | ||
public void Fire(ArrayList<? extends AbstractListener> listeners) { | ||
for (AbstractListener listener : List.copyOf(listeners)) { | ||
SendMovementPacketListener sendMovementPacketListener = (SendMovementPacketListener) listener; | ||
sendMovementPacketListener.onSendMovementPacket(this); | ||
} | ||
} | ||
|
||
@Override | ||
public Class<SendMovementPacketListener> GetListenerClassType() { | ||
return SendMovementPacketListener.class; | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/net/aoba/event/listeners/SendMovementPacketListener.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,8 @@ | ||
package net.aoba.event.listeners; | ||
|
||
import net.aoba.event.events.SendMovementPacketEvent; | ||
|
||
public interface SendMovementPacketListener extends AbstractListener { | ||
public abstract void onSendMovementPacket(SendMovementPacketEvent.Pre event); | ||
public abstract void onSendMovementPacket(SendMovementPacketEvent.Post event); | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/java/net/aoba/interfaces/IClientPlayerInteractionManager.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,5 @@ | ||
package net.aoba.interfaces; | ||
|
||
public interface IClientPlayerInteractionManager { | ||
void aoba$syncSelected(); | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/net/aoba/mixin/interfaces/IPlayerMoveC2SPacket.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,17 @@ | ||
package net.aoba.mixin.interfaces; | ||
|
||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Mutable; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(PlayerMoveC2SPacket.class) | ||
public interface IPlayerMoveC2SPacket { | ||
@Mutable | ||
@Accessor("y") | ||
void setY(double y); | ||
|
||
@Mutable | ||
@Accessor("onGround") | ||
void setOnGround(boolean onGround); | ||
} |
Oops, something went wrong.