n-noguchi / FatCatMOD

MinecraftのデブネコMODです
http://forum.minecraftuser.jp/viewtopic.php?f=13&t=28511
MIT License
0 stars 0 forks source link

minecraft1.12移行 net.minecraft.world.World.playSoundEffect() #1

Open n-noguchi opened 5 years ago

n-noguchi commented 5 years ago

minecraft1.8の下記コードを1.12へ移行する

cat.world.playSoundEffect(cat.posX+0.5D, cat.posY+0.5D, cat.posZ+0.5D, "random.eat", 1.0F, 1.0F);
n-noguchi commented 5 years ago

下記オーバーロードを利用する。

public void playSound(@Nullable EntityPlayer player, double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch)

修正後

cat.world.playSound(null,cat.posX+0.5D, cat.posY+0.5D, cat.posZ+0.5D, new SoundEvent(new ResourceLocation("random.eat")), SoundCategory.NEUTRAL, 1.0F, 1.0F);
n-noguchi commented 5 years ago

https://mcforge.readthedocs.io/en/latest/effects/sounds/