Skip to content

Commit

Permalink
サウンドの互換性チェック
Browse files Browse the repository at this point in the history
  • Loading branch information
Gakuto1112 committed Oct 11, 2024
1 parent ca8a6cf commit 612d733
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 85 deletions.
4 changes: 2 additions & 2 deletions scripts/action_wheel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ events.TICK:register(function ()
if ActionWheel.PlayerNameState ~= ActionWheel.CurrentPlayerNameState then
pings.main4_action2(ActionWheel.PlayerNameState)
Config.saveConfig("name", ActionWheel.PlayerNameState)
sounds:playSound("minecraft:ui.cartography_table.take_result", player:getPos())
sounds:playSound(CompatibilityUtils:checkSound("minecraft:ui.cartography_table.take_result"), player:getPos())
print(Language.getTranslate("action_wheel__main_4__action_2__done_first")..Nameplate.NameList[ActionWheel.PlayerNameState]..Language.getTranslate("action_wheel__main_4__action_2__done_last"))
end
if ActionWheel.SkullState ~= ActionWheel.CurrentSkullState then
pings.main4_action3(ActionWheel.SkullState)
Config.saveConfig("skull", ActionWheel.SkullState)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecrarft:entity.item.pickup"), player:getPos(), 1, 0.5)
print(Language.getTranslate("action_wheel__main_4__action_3__done_first")..Language.getTranslate("skull__"..Skull.SkullList[ActionWheel.SkullState])..Language.getTranslate("action_wheel__main_4__action_3__done_last"))
end
end
Expand Down
8 changes: 4 additions & 4 deletions scripts/actions/broom_cleaning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ BroomCleaning = General.instance({
play = function(self)
AnimationAction.play(self)
models.models.broom_cleaning.Dust:setOpacity(1)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = false
Arms.hideHeldItem(true)
end,

---箒掃除アニメーションを停止する。
stop = function(self)
AnimationAction.stop(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = true
end,

---アニメーション再生中に毎チック実行される関数
onAnimationTick = function(self)
AnimationAction.onAnimationTick(self)
if (self.AnimationCount + 8) % 17 == 0 and self.AnimationCount > 49 then
sounds:playSound("entity.cat.hiss", player:getPos(), 0.5, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.cat.hiss"), player:getPos(), 0.5, 2)
models.models.broom_cleaning.Dust:setOpacity(models.models.broom_cleaning.Dust:getOpacity() - 0.14)
local dustParticlePivot = models.models.broom_cleaning.Dust.DustParticlePivot:partToWorldMatrix()
for _ = 1, 5 do
Expand All @@ -29,7 +29,7 @@ BroomCleaning = General.instance({
elseif self.AnimationCount == 41 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
6 changes: 3 additions & 3 deletions scripts/actions/cloth_cleaning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ ClothCleaning = General.instance({
---雑巾がけアニメーションを再生する。
play = function (self)
AnimationAction.play(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = false
Arms.hideHeldItem(true)
end,

---雑巾がけアニメーションを停止する。
stop = function (self)
AnimationAction.stop(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = true
end,

Expand All @@ -23,7 +23,7 @@ ClothCleaning = General.instance({
elseif self.AnimationCount == 40 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
16 changes: 8 additions & 8 deletions scripts/actions/ear_cuddling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ EarCuddling = General.instance({
---お耳モフモフアニメーションを再生する。
play = function (self)
AnimationAction.play(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
FaceParts.setComplexion("BLUSH", 382, true)
Physics.EnablePyhsics[1] = false
end,

---お耳モフモフアニメーションを停止する。
stop = function (self)
if self.AnimationCount > 102 then
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
end
AnimationAction.stop(self)
Physics.EnablePyhsics[1] = true
Expand All @@ -26,25 +26,25 @@ EarCuddling = General.instance({
if self.AnimationCount <= 252 and self.AnimationCount > 142 and (self.AnimationCount - 252) % 20 == 0 then
if self.AnimationCount == 252 then
FaceParts.setEmotion("SURPLISED", "SURPLISED", "NONE", 120, true)
sounds:playSound("entity.experience_orb.pickup", player:getPos(), 0.25, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.experience_orb.pickup"), player:getPos(), 0.25, 1.5)
end
sounds:playSound("block.wool.step", player:getPos(), 0.5, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.wool.step"), player:getPos(), 0.5, 1)
end
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
elseif self.AnimationCount == 132 then
FaceParts.setEmotion("SURPLISED", "SURPLISED", "OPENED", 30, true)
sounds:playSound("entity.player.attack.strong", player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.attack.strong"), player:getPos(), 1, 1)
elseif self.AnimationCount <= 102 and self.AnimationCount > 60 then
if self.AnimationCount == 102 then
sounds:playSound("entity.lightning_bolt.thunder", player:getPos(), 1, 1)
sounds:playSound("entity.lightning_bolt.impact", player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.lightning_bolt.thunder"), player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.lightning_bolt.impact"), player:getPos(), 1, 1)
models.models.dummy_player:setVisible(false)
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "CLOSED", 42, true)
end
sounds:playSound("entity.experience_orb.pickup", player:getPos(), 0.25, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.experience_orb.pickup"), player:getPos(), 0.25, 1.5)
elseif self.AnimationCount == 60 then
FaceParts.setEmotion("TEAR", "TEAR", "NONE", 60, true)
local playerPos = player:getPos()
Expand Down
6 changes: 3 additions & 3 deletions scripts/actions/earpick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Earpick = General.instance({
---耳かきアニメーションを再生する。
play = function (self)
AnimationAction.play(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Arms.RightArmRotOffset = vectors.vec3(-20, -10, 15)
Arms.LeftArmRotOffset = vectors.vec3(-20, 10, -15)
Arms.hideHeldItem(true)
Expand All @@ -12,7 +12,7 @@ Earpick = General.instance({
---耳かきアニメーションを停止する。
stop = function (self)
AnimationAction.stop(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
end,

---アニメーション再生中に毎チック実行される関数
Expand All @@ -26,7 +26,7 @@ Earpick = General.instance({
FaceParts.setEmotion("CLOSED", "CLOSED", "CLOSED", 40, true)
elseif self.AnimationCount == 41 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
6 changes: 3 additions & 3 deletions scripts/actions/fox_jump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ FoxJump = General.instance({
onAnimationTick = function (self)
AnimationAction.onAnimationTick(self)
if self.AnimationCount == 98 then
sounds:playSound("entity.snowball.throw", player:getPos(), 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.snowball.throw"), player:getPos(), 1, 1.5)
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "OPENED", 11, true)
elseif self.AnimationCount == 87 or (self.AnimationCount <= 83 and self.AnimationCount >= 32 and (self.AnimationCount - 83) % 3 == 0) or self.AnimationCount == 18 then
sounds:playSound("block.snow.break", player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.snow.break"), player:getPos(), 1, 1)
for _ = 1, 5 do
particles:newParticle(CompatibilityUtils.getBlockParticleId(CompatibilityUtils:checkBlock("minecraft:snow")), FoxJump.TargetPos)
end
if self.AnimationCount == 87 then
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "CLOSED", 69, true)
elseif self.AnimationCount == 18 then
sounds:playSound("entity.snowball.throw", player:getPos(), 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.snowball.throw"), player:getPos(), 1, 1.5)
end
elseif self.AnimationCount == 1 then
self:stop()
Expand Down
20 changes: 10 additions & 10 deletions scripts/actions/hair_cut.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HairCut = General.instance({
---散髪アニメーションを再生する。
play = function (self)
AnimationAction.play(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = false
Arms.hideHeldItem(true)
end,
Expand All @@ -17,7 +17,7 @@ HairCut = General.instance({
stop = function (self)
AnimationAction.stop(self)
HairCut.ScissorsItem:setVisible(false)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Sleeve.Moving = true
end,

Expand All @@ -32,7 +32,7 @@ HairCut = General.instance({
end
end
if self.AnimationCount <= 468 and self.AnimationCount >= 398 and (self.AnimationCount - 468) % 15 == 0 then
sounds:playSound("entity.cat.hiss", player:getPos(), 0.25, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.cat.hiss"), player:getPos(), 0.25, 2)
local splashPos = vectors.rotateAroundAxis(-(player:getBodyYaw() % 360), 0, 0, 0.3, 0, 1):add(player:getPos():add(0, 1))
for _ = 1, 5 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:splash"), splashPos)
Expand All @@ -42,32 +42,32 @@ HairCut = General.instance({
modelPart:setVisible(false)
end
HairCut.ScissorsItem:setVisible(true)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
elseif (self.AnimationCount <= 373 and self.AnimationCount >= 330 and (self.AnimationCount - 373) % 6 == 0) or (self.AnimationCount <= 320 and self.AnimationCount >= 303 and (self.AnimationCount - 320) % 6 == 0) or (self.AnimationCount <= 196 and self.AnimationCount >= 153 and (self.AnimationCount - 196) % 6 == 0) or (self.AnimationCount <= 143 and self.AnimationCount >= 100 and (self.AnimationCount - 143) % 6 == 0) then
sounds:playSound("entity.sheep.shear", player:getPos(), 0.25, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.sheep.shear"), player:getPos(), 0.25, 1)
elseif self.AnimationCount == 296 then
local playerPos = player:getPos()
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:smoke"), playerPos:copy():add((math.random() - 0.5) * 2, (math.random() - 0.5) * 2 + 1, (math.random() - 0.5) * 2))
end
sounds:playSound("entity.sheep.shear", player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.sheep.shear"), player:getPos(), 1, 1)
FaceParts.setEmotion("SURPLISED", "SURPLISED", "CLOSED", 60, false)
models.models.main.Avatar.UpperBody.Arms.LeftArm.LeftArmBottom.HairCutLAB.HairPiece:setVisible(true)
elseif self.AnimationCount == 276 then
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
elseif self.AnimationCount == 236 then
sounds:playSound("entity.wolf.shake", player:getPos(), 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.wolf.shake"), player:getPos(), 1, 1.5)
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "CLOSED", 20, true)
elseif self.AnimationCount == 216 then
models.models.main.Avatar.UpperBody.Arms.LeftArm.LeftArmBottom.HairCutLAB.HairPiece:setVisible(false)
elseif self.AnimationCount == 90 then
HairCut.ScissorsItem:setVisible(false)
elseif self.AnimationCount <= 80 and self.AnimationCount >= 53 and (self.AnimationCount - 80) % 13 == 0 then
sounds:playSound("block.grass.step", player:getPos(), 0.5, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.grass.step"), player:getPos(), 0.5, 1)
elseif self.AnimationCount == 40 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
8 changes: 4 additions & 4 deletions scripts/actions/kotatsu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Kotatsu = General.instance({
---@diagnostic disable-next-line: undefined-field
SitDown:stop()
end
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
if host:isHost() and General.ShowMessage then
print(Language.getTranslate("action_wheel__main_1__action_7__start"))
end
Expand All @@ -37,7 +37,7 @@ Kotatsu = General.instance({
---こたつアニメーションを停止する。
stop = function (self)
PermanentAnimationAction.stop(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
if not Armor.ArmorVisible[3] then
if Costume.CurrentCostume == "MAID_A" then

Expand All @@ -59,9 +59,9 @@ Kotatsu = General.instance({
onAnimationTick = function (self)
PermanentAnimationAction.onAnimationTick(self)
if self.AnimationCount == 282 then
sounds:playSound("block.grass.step", player:getPos(), 1, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.grass.step"), player:getPos(), 1, 1)
elseif self.AnimationCount == 275 or self.AnimationCount == 287 then
sounds:playSound("block.grass.step", player:getPos(), 0.5, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.grass.step"), player:getPos(), 0.5, 1)
elseif self.AnimationCount == 300 then
self.AnimationCount = 1
end
Expand Down
8 changes: 4 additions & 4 deletions scripts/actions/massage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Massage = General.instance({
---マッサージのアニメーションを再生する。
play = function (self)
AnimationAction.play(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Arms.RightArmRotOffset = vectors.vec3(-20, -10, 15)
Arms.LeftArmRotOffset = vectors.vec3(-20, 10, -15)
Arms.hideHeldItem(true)
Expand All @@ -12,7 +12,7 @@ Massage = General.instance({
---マッサージのアニメーションを停止する。
stop = function (self)
AnimationAction.stop(self)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
Arms.resetArmRotOffset()
end,

Expand All @@ -24,10 +24,10 @@ Massage = General.instance({
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
if (self.AnimationCount <= 403 and self.AnimationCount >= 373 and (self.AnimationCount - 403) % 15 == 0) or (self.AnimationCount <= 341 and self.AnimationCount >= 311 and (self.AnimationCount - 341) % 15 == 0) or (self.AnimationCount <= 279 and self.AnimationCount >= 249 and (self.AnimationCount - 279) % 15 == 0) or (self.AnimationCount <= 151 and self.AnimationCount >= 59 and (self.AnimationCount - 151) % 8 == 0) then
sounds:playSound("block.wool.step", player:getPos(), 0.5, 1)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.wool.step"), player:getPos(), 0.5, 1)
if self.AnimationCount == 95 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/shake_body.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ShakeBody = General.instance({
play = function (self, snowParticle)
AnimationAction.play(self)
Umbrella.Enabled = true
sounds:playSound("entity.wolf.shake", player:getPos(), 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.wolf.shake"), player:getPos(), 1, 1.5)
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "CLOSED", 20, true)
ShakeBody.SnowParticle = snowParticle
end,
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/smile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Smile = General.instance({
EmotionAction.play(self)
if playSoundParticle then
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
Expand Down
Loading

0 comments on commit 612d733

Please sign in to comment.