Skip to content

Commit

Permalink
Send experience packets to support Bedrock via Geyser (#337)
Browse files Browse the repository at this point in the history
* Send experience packets to support Bedrock via Geyser

Send experience packets to support Bedrock via Geyser

* Requested changes

* Increment version
  • Loading branch information
PikaMug authored Jul 4, 2024
1 parent ae7b777 commit a7cac4b
Show file tree
Hide file tree
Showing 64 changed files with 303 additions and 45 deletions.
1 change: 0 additions & 1 deletion .mvn/jvm.config

This file was deleted.

2 changes: 1 addition & 1 deletion 1_10_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_10_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_11_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_11_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_12_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_12_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_13_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_13_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_13_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_13_R2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_14_4_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_14_4_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 1_14_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_14_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_15_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_15_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_16_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_16_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_16_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_16_R2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_16_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_16_R3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).playerConnection.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_17_1_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_17_1_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 1_17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_17_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow;
import net.minecraft.network.protocol.game.PacketPlayOutExperience;
import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.world.IInventory;
Expand Down Expand Up @@ -62,6 +63,14 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).b.sendPacket(new PacketPlayOutCloseWindow(containerId));
}

/**
* {@inheritDoc}
*/
@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).b.sendPacket(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

/**
* {@inheritDoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion 1_18_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_18_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow;
import net.minecraft.network.protocol.game.PacketPlayOutExperience;
import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.world.IInventory;
Expand Down Expand Up @@ -51,6 +52,11 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).b.a(new PacketPlayOutCloseWindow(containerId));
}

@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).b.a(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

@Override
public void setActiveContainerDefault(Player player) {
(toNMS(player)).bW = (toNMS(player)).bV;
Expand Down
2 changes: 1 addition & 1 deletion 1_18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_18_R2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow;
import net.minecraft.network.protocol.game.PacketPlayOutExperience;
import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.world.IInventory;
Expand Down Expand Up @@ -51,6 +52,11 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).b.a(new PacketPlayOutCloseWindow(containerId));
}

@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).b.a(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

@Override
public void setActiveContainerDefault(Player player) {
(toNMS(player)).bV = (toNMS(player)).bU;
Expand Down
2 changes: 1 addition & 1 deletion 1_19_1_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_19_1_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 1_19_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_19_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.core.BlockPosition;
import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.network.protocol.game.PacketPlayOutCloseWindow;
import net.minecraft.network.protocol.game.PacketPlayOutExperience;
import net.minecraft.network.protocol.game.PacketPlayOutOpenWindow;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.world.IInventory;
Expand Down Expand Up @@ -58,6 +59,11 @@ public void sendPacketCloseWindow(Player player, int containerId) {
toNMS(player).b.a(new PacketPlayOutCloseWindow(containerId));
}

@Override
public void sendPacketExperienceChange(Player player, int experienceLevel) {
toNMS(player).b.a(new PacketPlayOutExperience(0f, 0, experienceLevel));
}

@Override
public void setActiveContainerDefault(Player player) {
toNMS(player).bU = toNMS(player).bT;
Expand Down
2 changes: 1 addition & 1 deletion 1_19_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui-parent</artifactId>
<version>1.9.6-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>
</parent>

<artifactId>anvilgui-1_19_R2</artifactId>
Expand Down
Loading

0 comments on commit a7cac4b

Please sign in to comment.