use of net.minecraft.resources.ResourceLocation in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method stopSound.
@Override
public void stopSound(Player player, String sound, SoundCategory category) {
ResourceLocation soundKey = sound == null ? null : new ResourceLocation(sound);
net.minecraft.sounds.SoundSource nmsCategory = category == null ? null : net.minecraft.sounds.SoundSource.valueOf(category.name());
((CraftPlayer) player).getHandle().connection.send(new ClientboundStopSoundPacket(soundKey, nmsCategory));
}
use of net.minecraft.resources.ResourceLocation in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelperImpl method showDebugTestMarker.
@Override
public void showDebugTestMarker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
ResourceLocation packetKey = new ResourceLocation("minecraft", "debug/game_test_add_marker");
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
buf.writeBlockPos(new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
int colorInt = color.getColor().getBlue() | (color.getColor().getGreen() << 8) | (color.getColor().getRed() << 16) | (alpha << 24);
buf.writeInt(colorInt);
buf.writeByteArray(name.getBytes(StandardCharsets.UTF_8));
buf.writeInt(time);
ClientboundCustomPayloadPacket packet = new ClientboundCustomPayloadPacket(packetKey, buf);
send(player, packet);
}
use of net.minecraft.resources.ResourceLocation in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelperImpl method sendBrand.
@Override
public void sendBrand(Player player, String brand) {
ResourceLocation packetKey = new ResourceLocation("minecraft", "brand");
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
buf.writeUtf(brand);
ClientboundCustomPayloadPacket packet = new ClientboundCustomPayloadPacket(packetKey, buf);
send(player, packet);
}
use of net.minecraft.resources.ResourceLocation in project MyPet by xXKeyleXx.
the class EntityMyVillager method updateVisuals.
@Override
public void updateVisuals() {
this.getEntityData().set(AGE_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
this.getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getVillagerLevel()));
}
use of net.minecraft.resources.ResourceLocation in project MyPet by xXKeyleXx.
the class EntityMyVillager method updateVisuals.
@Override
public void updateVisuals() {
this.getEntityData().set(AGE_WATCHER, getMyPet().isBaby());
String professionKey = MyVillager.Profession.values()[getMyPet().getProfession()].getKey();
VillagerProfession profession = Registry.VILLAGER_PROFESSION.get(new ResourceLocation(professionKey));
// TODO
VillagerType type = Registry.VILLAGER_TYPE.get(new ResourceLocation(getMyPet().getType().getKey()));
this.getEntityData().set(PROFESSION_WATCHER, new VillagerData(type, profession, getMyPet().getVillagerLevel()));
}
Aggregations