Skip to content

Commit

Permalink
Added LazyDFU back because it's good for running the dev env, removed…
Browse files Browse the repository at this point in the history
… some debug statements and tested the mod, runs from 1.19 to 1.19.3
  • Loading branch information
RaydanOMGr committed Mar 17, 2024
1 parent c50cea8 commit 4fd635e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}"

modImplementation "curse.maven:lazydfu-433518:3821870"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.andreasmelone.glowingeyes.common.component;

import com.mojang.logging.LogUtils;
import dev.onyxstudios.cca.api.v3.component.ComponentKey;
import dev.onyxstudios.cca.api.v3.component.ComponentRegistry;
import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry;
Expand All @@ -16,7 +17,7 @@ public class ComponentHandler implements EntityComponentInitializer {

@Override
public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) {
System.out.println("Registering Glowing Eyes component");
LogUtils.getLogger().info("Registering Glowing Eyes component");
registry.registerForPlayers(GLOWING_EYES, player -> new GlowingEyesImpl(), RespawnCopyStrategy.ALWAYS_COPY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static void sendUpdate(ServerPlayer updatedPlayer) {
* @param receivingPlayer another player who will receive the update
*/
public static void sendUpdate(ServerPlayer updatedPlayer, ServerPlayer receivingPlayer) {
System.out.println("Sending update about " + updatedPlayer.getName().getString() + " to " + receivingPlayer.getName().getString());
new CapabilityUpdatePacket(updatedPlayer, getComponent(updatedPlayer)).sendToClient(receivingPlayer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ public void deserialize(FriendlyByteBuf buf) {
glowingEyes = new GlowingEyesImpl();
glowingEyes.setToggledOn(buf.readBoolean());
glowingEyes.setGlowingEyesMap(Util.deserializeMap(buf.readByteArray()));
System.out.println("Deserialized the packet");
System.out.println("The player UUID is " + playerUUID);
System.out.println("The glowing eyes map is " + glowingEyes.getGlowingEyesMap());
System.out.println("The toggled on status is " + glowingEyes.isToggledOn());
}

public void sendToServer() {
FriendlyByteBuf buf = PacketByteBufs.create();
buf.writeUUID(this.playerUUID);
buf.writeBoolean(glowingEyes.isToggledOn());
buf.writeByteArray(Util.serializeMap(glowingEyes.getGlowingEyesMap()));
System.out.println("Sending packet to server");
ClientPlayNetworking.send(ID, buf);
}

Expand All @@ -58,7 +53,6 @@ public void sendToClient(ServerPlayer player) {
buf.writeUUID(this.playerUUID);
buf.writeBoolean(glowingEyes.isToggledOn());
buf.writeByteArray(Util.serializeMap(glowingEyes.getGlowingEyesMap()));
System.out.println("Sending packet to client " + player.getName().getString());
ServerPlayNetworking.send(player, ID, buf);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"depends": {
"fabricloader": ">=${loader_version}",
"fabric": "*",
"minecraft": "1.19.*"
"minecraft": ">=1.19 <=1.19.3"
},
"custom": {
"cardinal-components": [
Expand Down

0 comments on commit 4fd635e

Please sign in to comment.