Skip to content

Commit

Permalink
Translate more new level events
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Jun 16, 2021
1 parent 2c9cd7e commit c413142
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<dependency>
<groupId>com.github.GeyserMC</groupId>
<artifactId>MCProtocolLib</artifactId>
<version>dd606b4</version>
<version>7248769</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class JavaPlayEffectTranslator extends PacketTranslator<ServerPlayEffectP

@Override
public void translate(ServerPlayEffectPacket packet, GeyserSession session) {
System.out.println(packet.toString());
// Separate case since each RecordEffectData in Java is an individual track in Bedrock
if (packet.getEffect() == SoundEffect.RECORD) {
RecordEffectData recordEffectData = (RecordEffectData) packet.getData();
Expand Down Expand Up @@ -228,6 +229,7 @@ public void translate(ServerPlayEffectPacket packet, GeyserSession session) {
effectPacket.setType(LevelEventType.PARTICLE_MOB_BLOCK_SPAWN); // TODO: Check, but I don't think I really verified this ever went into effect on Java
break;
}
case BONEMEAL_GROW_WITH_SOUND: // Note that there is no particle without sound in Bedrock. If you wanted to implement the sound, send a PlaySoundPacket with "item.bone_meal.use" and volume and pitch at 1.0F
case BONEMEAL_GROW: {
effectPacket.setType(LevelEventType.PARTICLE_CROP_GROWTH);

Expand Down Expand Up @@ -274,6 +276,10 @@ public void translate(ServerPlayEffectPacket packet, GeyserSession session) {
session.sendUpstreamPacket(soundEventPacket);
break;
}
case DRIPSTONE_DRIP: {
effectPacket.setType(LevelEventType.PARTICLE_DRIPSTONE_DRIP);
break;
}
case ELECTRIC_SPARK: {
// Matches with a Bedrock server but doesn't seem to match up with Java
effectPacket.setType(LevelEventType.PARTICLE_ELECTRIC_SPARK);
Expand Down
2 changes: 1 addition & 1 deletion connector/src/main/resources/mappings
Submodule mappings updated 1 files
+16 −0 effects.json

0 comments on commit c413142

Please sign in to comment.