-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started implementing packets; more Actions work
- Loading branch information
1 parent
440968c
commit 4b3671b
Showing
29 changed files
with
304 additions
and
214 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
2 changes: 1 addition & 1 deletion
2
...itions/actions/util/EvaluatorContext.java → ...ns/actions/util/EvaluatorEnvironment.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
3 changes: 0 additions & 3 deletions
3
content/src/main/java/com/fqf/mario_qua_mario/actions/grounded/SubWalk.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
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
25 changes: 25 additions & 0 deletions
25
mod/src/client/java/com/fqf/mario_qua_mario/packets/MarioClientPacketReceivers.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,25 @@ | ||
package com.fqf.mario_qua_mario.packets; | ||
|
||
import com.fqf.mario_qua_mario.mariodata.MarioPlayerData; | ||
import com.fqf.mario_qua_mario.registries.RegistryManager; | ||
import com.fqf.mario_qua_mario.registries.actions.AbstractParsedAction; | ||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
import java.util.Objects; | ||
|
||
public class MarioClientPacketReceivers { | ||
public static void registerClientReceivers() { | ||
// SetActionS2CPayload Receiver | ||
ClientPlayNetworking.registerGlobalReceiver(MarioDataPackets.SetActionS2CPayload.ID, (payload, context) -> { | ||
MarioPlayerData data = getMarioFromID(context, payload.marioID()).mqm$getMarioData(); | ||
AbstractParsedAction action = RegistryManager.ACTIONS.get(payload.newAction()); | ||
if(payload.doTransition()) data.setActionInternal(action, payload.seed(), true); | ||
else data.setActionTransitionlessInternal(action); | ||
}); | ||
} | ||
|
||
public static PlayerEntity getMarioFromID(ClientPlayNetworking.Context context, int marioID) { | ||
return (PlayerEntity) Objects.requireNonNull(context.player().getWorld().getEntityById(marioID)); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
mod/src/main/java/com/fqf/mario_qua_mario/MarioAbstractClientHelper.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,6 +1,5 @@ | ||
package com.fqf.mario_qua_mario; | ||
|
||
public abstract class MarioAbstractClientHelper { | ||
public static MarioAbstractClientHelper instance = new MarioAbstractClientHelper() { | ||
}; | ||
public static MarioAbstractClientHelper instance = null; | ||
} |
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
Oops, something went wrong.