Skip to content

Commit

Permalink
update packets
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jan 12, 2022
1 parent 931f7b0 commit d92d920
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 76 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ yarn_mappings=1.18.1+build.18
loader_version=0.12.12
fabric_version=0.45.2+1.18

mod_version = 3.0.0
mod_version = 3.0.1
maven_group = net.ludocrypt
archives_base_name = limlib

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

import com.mojang.authlib.GameProfile;

import net.ludocrypt.limlib.api.sound.TravelSoundPacket;
import net.ludocrypt.limlib.impl.sound.LiminalTravelSounds;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand All @@ -37,7 +38,7 @@ public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile
public void limlib$moveToWorld(ServerWorld to, CallbackInfoReturnable<Entity> ci) {
Optional<SoundEvent> optional = LiminalTravelSounds.getCurrent(((ServerPlayerEntity) (Object) this).getWorld(), to);
if (optional.isPresent()) {
this.networkHandler.sendPacket(new TravelSoundPacket(optional.get()));
this.networkHandler.sendPacket(new PlaySoundS2CPacket(optional.get(), SoundCategory.AMBIENT, this.getX(), this.getY(), this.getZ(), world.getRandom().nextFloat() * 0.4F + 0.8F, 0.25F));
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/limlib.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"ServerPlayerEntityMixin"
],
"client": [
"ClientPlayNetworkHandlerMixin",
"DimensionEffectsMixin",
"SoundManagerAccessor",
"SoundSystemAccessor",
Expand Down

0 comments on commit d92d920

Please sign in to comment.