diff --git a/src/generated/resources/.cache/2d64935085b86659cb7857bad9701dbf9bab6e4c b/src/generated/resources/.cache/2d64935085b86659cb7857bad9701dbf9bab6e4c index 85dd3fdf2b..d16d55bbd7 100644 --- a/src/generated/resources/.cache/2d64935085b86659cb7857bad9701dbf9bab6e4c +++ b/src/generated/resources/.cache/2d64935085b86659cb7857bad9701dbf9bab6e4c @@ -1,4 +1,4 @@ -// 1.20.1 2024-12-28T14:25:56.9899499 Registrate Provider for create [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)] +// 1.20.1 2025-01-05T12:20:44.8131117 Registrate Provider for create [Recipes, Advancements, Loot Tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)] 60bbdf92d2ac9824ea6144955c74043a6005f79d assets/create/blockstates/acacia_window.json 6a67703c2697d81b7dc83e9d72a66f9c9ff08383 assets/create/blockstates/acacia_window_pane.json c3ae87b62e81d8e9476eccd793bb1548d74c66a1 assets/create/blockstates/adjustable_chain_gearshift.json @@ -642,8 +642,8 @@ b0d8f08968763a5f74e5cd5644377a76a9f39753 assets/create/blockstates/yellow_toolbo fe8c497aacc641c2f01cec90bba9f19e59cc2ed2 assets/create/blockstates/yellow_valve_handle.json e819e93fdcbe9fd9c050a052d2718ff3b3539365 assets/create/blockstates/zinc_block.json 64121dcb216381c83b4fe28aa361ea07c24c9ad0 assets/create/blockstates/zinc_ore.json -6a5bfb3525f178e198ef8fd4c0cb1a941c021ff5 assets/create/lang/en_ud.json -d3402f8a5a75f8c1f7ea6d2dfa56218d5f55d112 assets/create/lang/en_us.json +908484cff8ec27c3b4cf39ac683b6b7a5528e470 assets/create/lang/en_ud.json +7401dfd627e4b0177b75aff4068be5d249e326f2 assets/create/lang/en_us.json a97e1060e00ae701a02e39cd4ef8054cf345fac4 assets/create/models/block/acacia_window.json 103e032c0b1a0a6a27c67da8c91179a564bd281c assets/create/models/block/acacia_window_pane_noside.json fb00b627abda76ad4fea867ca57dbfadd24fffa3 assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/.cache/c24b4d2b8d15abff51c78bd94f4403d9eae6c139 b/src/generated/resources/.cache/c24b4d2b8d15abff51c78bd94f4403d9eae6c139 index eae1118802..6ce167281b 100644 --- a/src/generated/resources/.cache/c24b4d2b8d15abff51c78bd94f4403d9eae6c139 +++ b/src/generated/resources/.cache/c24b4d2b8d15abff51c78bd94f4403d9eae6c139 @@ -1,2 +1,2 @@ -// 1.20.1 2024-10-29T20:48:43.0728938 Create's Custom Sounds -95f92936f1028973cacb7aade6eb6acf582aaa8f assets/create/sounds.json +// 1.20.1 2025-01-05T12:20:44.8111168 Create's Custom Sounds +b55aef763ad0b3df0d27e53c2a4c656c942cfa7a assets/create/sounds.json diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index 640e0e3f1f..fad428307f 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -2699,7 +2699,7 @@ "create.station.train_not_aligned_1": "pǝubıןɐ sǝbɐıɹɹɐɔ ןןɐ ʇou", "create.stock_keeper.cash_register_full": "ɹǝʇsıbǝᴚ ɥsɐƆ uı ǝɔɐds ɥbnouǝ ʇoN :pǝןןǝɔuɐɔ ǝsɐɥɔɹnԀ", "create.stock_keeper.keeper_missing": "buıssıɯ ɹǝdǝǝʞ ʞɔoʇS", - "create.stock_keeper.limited_stock": "ǝןqɐןıɐʌɐ ʞɔoʇs pǝʇıɯıꞀ", + "create.stock_keeper.limited_stock": "pǝɥɔɐǝɹ ʇıɯıן ʞɔoʇS", "create.stock_keeper.locked": "pǝʞɔoן uǝǝq sɐɥ ssǝɔɔɐ ʇɔǝɹıp 'ʇsıן buıddoɥS ɐ buısn ʇɔɐɹǝʇuI", "create.stock_keeper.no_price_set": "ʇsɹıɟ ǝɔıɹd ɐ ʇǝs ʇsnɯ ɹǝuʍo doɥS", "create.stock_keeper.out_of_stock": "ʞɔoʇS ɟo ʇnO", @@ -2713,6 +2713,7 @@ "create.subtitle.cardboard_bonk": "ʞuoq ʇuɐuosǝᴚ", "create.subtitle.cogs": "ǝןqɯnɹ sןǝǝɥʍboƆ", "create.subtitle.confirm": "buıp ǝʌıʇɐɯɹıɟɟⱯ", + "create.subtitle.confirm_2": "buıp ǝʌıʇɐɯɹıɟɟⱯ", "create.subtitle.contraption_assemble": "sǝʌoɯ uoıʇdɐɹʇuoƆ", "create.subtitle.contraption_disassemble": "sdoʇs uoıʇdɐɹʇuoƆ", "create.subtitle.controller_click": "sʞɔıןɔ ɹǝןןoɹʇuoƆ", @@ -2727,6 +2728,13 @@ "create.subtitle.depot_plop": "spuɐן ɯǝʇI", "create.subtitle.depot_slide": "sǝpıןs ɯǝʇI", "create.subtitle.desk_bell": "sbuıp ןןǝq uoıʇdǝɔǝᴚ", + "create.subtitle.frogport_catch_1": "ǝbɐʞɔɐd sǝɥɔʇɐɔ ʇɹodboɹℲ", + "create.subtitle.frogport_catch_2": "ǝbɐʞɔɐd sǝɥɔʇɐɔ ʇɹodboɹℲ", + "create.subtitle.frogport_catch_3": "ǝbɐʞɔɐd sǝɥɔʇɐɔ ʇɹodboɹℲ", + "create.subtitle.frogport_catch_4": "ǝbɐʞɔɐd sǝɥɔʇɐɔ ʇɹodboɹℲ", + "create.subtitle.frogport_close": "sʇnɥs ʇɹodboɹℲ", + "create.subtitle.frogport_deposit": "ǝbɐʞɔɐd sǝɔɐןd ʇɹodboɹℲ", + "create.subtitle.frogport_open": "suǝdo ʇɹodboɹℲ", "create.subtitle.funnel_flap": "sdɐןɟ ןǝuunℲ", "create.subtitle.fwoomp": "dɯooʍɟ ʇuɐuosǝᴚ", "create.subtitle.haunted_bell_convert": "suǝʞɐʍɐ ןןǝᗺ pǝʇunɐH", @@ -2748,6 +2756,8 @@ "create.subtitle.slime_added": "sǝɥsınbs ǝɯıןS", "create.subtitle.spout": "sʇɹnds ʇnodS", "create.subtitle.steam": "sǝsıou ɯɐǝʇS", + "create.subtitle.stock_ticker_request": "sʇsǝnbǝɹ ɹǝʞɔıʇ ʞɔoʇS", + "create.subtitle.stock_ticker_trade": ",¡buıɥɔ-ɐʞ, sǝob ɹǝʞɔıʇ ʞɔoʇS", "create.subtitle.train": "ǝןqɯnɹ sןǝǝɥʍ ʎǝboᗺ", "create.subtitle.train3": "pǝןɟɟnɯ ǝןqɯnɹ sןǝǝɥʍ ʎǝboᗺ", "create.subtitle.whistle": "buıןʇsıɥM", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index a645aa8924..1c05daf002 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -2699,7 +2699,7 @@ "create.station.train_not_aligned_1": "not all carriages aligned", "create.stock_keeper.cash_register_full": "Purchase cancelled: Not enough space in Cash Register", "create.stock_keeper.keeper_missing": "Stock keeper missing", - "create.stock_keeper.limited_stock": "Limited stock available", + "create.stock_keeper.limited_stock": "Stock limit reached", "create.stock_keeper.locked": "Interact using a Shopping list, direct access has been locked", "create.stock_keeper.no_price_set": "Shop owner must set a price first", "create.stock_keeper.out_of_stock": "Out of Stock", @@ -2713,6 +2713,7 @@ "create.subtitle.cardboard_bonk": "Resonant bonk", "create.subtitle.cogs": "Cogwheels rumble", "create.subtitle.confirm": "Affirmative ding", + "create.subtitle.confirm_2": "Affirmative ding", "create.subtitle.contraption_assemble": "Contraption moves", "create.subtitle.contraption_disassemble": "Contraption stops", "create.subtitle.controller_click": "Controller clicks", @@ -2727,6 +2728,13 @@ "create.subtitle.depot_plop": "Item lands", "create.subtitle.depot_slide": "Item slides", "create.subtitle.desk_bell": "Reception bell dings", + "create.subtitle.frogport_catch_1": "Frogport catches package", + "create.subtitle.frogport_catch_2": "Frogport catches package", + "create.subtitle.frogport_catch_3": "Frogport catches package", + "create.subtitle.frogport_catch_4": "Frogport catches package", + "create.subtitle.frogport_close": "Frogport shuts", + "create.subtitle.frogport_deposit": "Frogport places package", + "create.subtitle.frogport_open": "Frogport opens", "create.subtitle.funnel_flap": "Funnel flaps", "create.subtitle.fwoomp": "Resonant fwoomp", "create.subtitle.haunted_bell_convert": "Haunted Bell awakens", @@ -2748,6 +2756,8 @@ "create.subtitle.slime_added": "Slime squishes", "create.subtitle.spout": "Spout spurts", "create.subtitle.steam": "Steam noises", + "create.subtitle.stock_ticker_request": "Stock ticker requests", + "create.subtitle.stock_ticker_trade": "Stock ticker goes 'ka-ching!'", "create.subtitle.train": "Bogey wheels rumble", "create.subtitle.train3": "Bogey wheels rumble muffled", "create.subtitle.whistle": "Whistling", diff --git a/src/generated/resources/assets/create/sounds.json b/src/generated/resources/assets/create/sounds.json index 2aa793f370..0da7bc9c54 100644 --- a/src/generated/resources/assets/create/sounds.json +++ b/src/generated/resources/assets/create/sounds.json @@ -59,6 +59,15 @@ ], "subtitle": "create.subtitle.confirm" }, + "confirm_2": { + "sounds": [ + { + "type": "file", + "name": "create:confirm_2" + } + ], + "subtitle": "create.subtitle.confirm_2" + }, "contraption_assemble": { "sounds": [ { @@ -226,6 +235,69 @@ ], "subtitle": "create.subtitle.desk_bell" }, + "frogport_catch_1": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_catch_1" + } + ], + "subtitle": "create.subtitle.frogport_catch_1" + }, + "frogport_catch_2": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_catch_2" + } + ], + "subtitle": "create.subtitle.frogport_catch_2" + }, + "frogport_catch_3": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_catch_3" + } + ], + "subtitle": "create.subtitle.frogport_catch_3" + }, + "frogport_catch_4": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_catch_4" + } + ], + "subtitle": "create.subtitle.frogport_catch_4" + }, + "frogport_close": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_close" + } + ], + "subtitle": "create.subtitle.frogport_close" + }, + "frogport_deposit": { + "sounds": [ + { + "type": "event", + "name": "minecraft:entity.frog.tongue" + } + ], + "subtitle": "create.subtitle.frogport_deposit" + }, + "frogport_open": { + "sounds": [ + { + "type": "file", + "name": "create:frogport_open" + } + ], + "subtitle": "create.subtitle.frogport_open" + }, "funnel_flap": { "sounds": [ { @@ -488,6 +560,24 @@ ], "subtitle": "create.subtitle.steam" }, + "stock_ticker_request": { + "sounds": [ + { + "type": "file", + "name": "create:stock_ticker_request" + } + ], + "subtitle": "create.subtitle.stock_ticker_request" + }, + "stock_ticker_trade": { + "sounds": [ + { + "type": "file", + "name": "create:stock_ticker_trade" + } + ], + "subtitle": "create.subtitle.stock_ticker_trade" + }, "train": { "sounds": [ { diff --git a/src/main/java/com/simibubi/create/AllSoundEvents.java b/src/main/java/com/simibubi/create/AllSoundEvents.java index 4f38c5bb93..c6a9137eca 100644 --- a/src/main/java/com/simibubi/create/AllSoundEvents.java +++ b/src/main/java/com/simibubi/create/AllSoundEvents.java @@ -116,6 +116,10 @@ public class AllSoundEvents { .category(SoundSource.PLAYERS) .build(), + CONFIRM_2 = create("confirm_2").subtitle("Affirmative ding") + .category(SoundSource.PLAYERS) + .build(), + DENY = create("deny").subtitle("Declining boop") .playExisting(SoundEvents.NOTE_BLOCK_BASS, 1f, 0.5f) .category(SoundSource.PLAYERS) @@ -132,6 +136,35 @@ public class AllSoundEvents { CARDBOARD_SWORD = create("cardboard_bonk").subtitle("Resonant bonk") .category(SoundSource.PLAYERS) .build(), + + FROGPORT_OPEN = create("frogport_open").subtitle("Frogport opens") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_CLOSE = create("frogport_close").subtitle("Frogport shuts") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_CATCH_1 = create("frogport_catch_1").subtitle("Frogport catches package") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_CATCH_2 = create("frogport_catch_2").subtitle("Frogport catches package") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_CATCH_3 = create("frogport_catch_3").subtitle("Frogport catches package") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_CATCH_4 = create("frogport_catch_4").subtitle("Frogport catches package") + .category(SoundSource.BLOCKS) + .build(), + + FROGPORT_DEPOSIT = create("frogport_deposit").subtitle("Frogport places package") + .playExisting(SoundEvents.FROG_TONGUE, 1f, 1f) + .category(SoundSource.BLOCKS) + .build(), POTATO_HIT = create("potato_hit").subtitle("Vegetable impacts") .playExisting(SoundEvents.ITEM_FRAME_BREAK, .75f, .75f) @@ -326,7 +359,15 @@ public class AllSoundEvents { HAUNTED_BELL_USE = create("haunted_bell_use").subtitle("Haunted Bell tolls") .category(SoundSource.BLOCKS) - .build(), + .build(), + + STOCK_TICKER_REQUEST = create("stock_ticker_request").subtitle("Stock ticker requests") + .category(SoundSource.BLOCKS) + .build(), + + STOCK_TICKER_TRADE = create("stock_ticker_trade").subtitle("Stock ticker goes 'ka-ching!'") + .category(SoundSource.BLOCKS) + .build(), CLIPBOARD_CHECKMARK = create("clipboard_check").noSubtitle() .category(SoundSource.BLOCKS) @@ -367,8 +408,9 @@ public class AllSoundEvents { } public static void playItemPickup(Player player) { - player.level().playSound(null, player.blockPosition(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, .2f, - 1f + Create.RANDOM.nextFloat()); + player.level() + .playSound(null, player.blockPosition(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, .2f, + 1f + player.level().random.nextFloat()); } // @SubscribeEvent diff --git a/src/main/java/com/simibubi/create/content/contraptions/pulley/AbstractPulleyVisual.java b/src/main/java/com/simibubi/create/content/contraptions/pulley/AbstractPulleyVisual.java index 28855da304..e5ea0c911e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/pulley/AbstractPulleyVisual.java +++ b/src/main/java/com/simibubi/create/content/contraptions/pulley/AbstractPulleyVisual.java @@ -6,7 +6,6 @@ import org.joml.Quaternionf; import org.joml.Quaternionfc; import com.mojang.math.Axis; -import com.simibubi.create.AllSpriteShifts; import com.simibubi.create.content.kinetics.base.KineticBlockEntity; import com.simibubi.create.content.kinetics.base.ShaftVisual; import com.simibubi.create.content.processing.burner.ScrollInstance; diff --git a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintOverlayRenderer.java b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintOverlayRenderer.java index e291a6aa96..4f2f60f470 100644 --- a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintOverlayRenderer.java +++ b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintOverlayRenderer.java @@ -349,7 +349,7 @@ public class BlueprintOverlayRenderer { TooltipRenderUtil.renderTooltipBackground(graphics, x - 2, y + 1, w + 4, 19, 0, 0x55_000000, 0x55_000000, 0, 0); - AllGuiTextures.TRADE_OVERLAY.render(graphics, width / 2 - 49, y - 19); + AllGuiTextures.TRADE_OVERLAY.render(graphics, width / 2 - 48, y - 19); if (shopContext.purchases() > 0) { graphics.renderItem(AllItems.SHOPPING_LIST.asStack(), width / 2 + 20, y - 20); graphics.drawString(mc.font, Components.literal("x" + shopContext.purchases()), width / 2 + 20 + 16, diff --git a/src/main/java/com/simibubi/create/content/logistics/packagePort/PackagePortBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/packagePort/PackagePortBlockEntity.java index 696f79d7a7..0c33762fda 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packagePort/PackagePortBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/packagePort/PackagePortBlockEntity.java @@ -145,11 +145,17 @@ public abstract class PackagePortBlockEntity extends SmartBlockEntity implements return InteractionResult.PASS; if (player instanceof FakePlayer) return InteractionResult.PASS; - if (level.isClientSide) - return InteractionResult.SUCCESS; - + ItemStack mainHandItem = player.getMainHandItem(); - if (AllBlocks.CLIPBOARD.isIn(mainHandItem)) { + boolean clipboard = AllBlocks.CLIPBOARD.isIn(mainHandItem); + + if (level.isClientSide) { + if (!clipboard) + onOpenedManually(); + return InteractionResult.SUCCESS; + } + + if (clipboard) { addAddressToClipboard(player, mainHandItem); return InteractionResult.SUCCESS; } @@ -158,6 +164,8 @@ public abstract class PackagePortBlockEntity extends SmartBlockEntity implements return InteractionResult.SUCCESS; } + protected void onOpenedManually() {}; + private void addAddressToClipboard(Player player, ItemStack mainHandItem) { if (addressFilter == null || addressFilter.isBlank()) return; diff --git a/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportBlockEntity.java index f378330bdf..1b78e71ef0 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportBlockEntity.java @@ -45,9 +45,11 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave public float passiveYaw; private boolean failedLastExport; + private FrogportSounds sounds; public FrogportBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); + sounds = new FrogportSounds(); animationProgress = LerpedFloat.linear(); anticipationProgress = LerpedFloat.linear(); manualOpenAnimationProgress = LerpedFloat.linear() @@ -106,10 +108,14 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave anticipationProgress.updateChaseTarget(0); manualOpenAnimationProgress.updateChaseTarget(openTracker.openCount > 0 ? 1 : 0); + boolean wasOpen = manualOpenAnimationProgress.getValue() > 0; anticipationProgress.tickChaser(); manualOpenAnimationProgress.tickChaser(); + if (level.isClientSide() && wasOpen && manualOpenAnimationProgress.getValue() == 0) + sounds.close(level, worldPosition); + if (!isAnimationInProgress()) return; @@ -135,6 +141,7 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave anticipationProgress.startWithValue(0); animationProgress.startWithValue(0); if (level.isClientSide()) { +// sounds.close(level, worldPosition); animatedPackage = null; return; } @@ -161,13 +168,18 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave animatedPackage = box; currentlyDepositing = deposit; - if (level != null && level.isClientSide() && !currentlyDepositing) { - Vec3 vec = target.getExactTargetLocation(this, level, worldPosition); - if (vec != null) { - for (int i = 0; i < 5; i++) { - level.addParticle(new BlockParticleOption(ParticleTypes.BLOCK, AllBlocks.ROPE.getDefaultState()), - vec.x, vec.y - level.random.nextFloat() * 0.25, vec.z, 0, 0, 0); - } + if (level != null && level.isClientSide()) { + if (currentlyDepositing) { + sounds.depositPackage(level, worldPosition); + + } else { + sounds.catchPackage(level, worldPosition); + Vec3 vec = target.getExactTargetLocation(this, level, worldPosition); + if (vec != null) + for (int i = 0; i < 5; i++) + level.addParticle( + new BlockParticleOption(ParticleTypes.BLOCK, AllBlocks.ROPE.getDefaultState()), vec.x, + vec.y - level.random.nextFloat() * 0.25, vec.z, 0, 0, 0); } } @@ -298,4 +310,10 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave return true; } + @Override + protected void onOpenedManually() { + if (level.isClientSide()) + sounds.open(level, worldPosition); + } + } diff --git a/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportSounds.java b/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportSounds.java new file mode 100644 index 0000000000..2909918166 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportSounds.java @@ -0,0 +1,46 @@ +package com.simibubi.create.content.logistics.packagePort.frogport; + +import java.util.List; + +import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.AllSoundEvents.SoundEntry; + +import net.minecraft.client.Minecraft; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; + +public class FrogportSounds { + + private static final List CATCH_SOUNDS = List.of(AllSoundEvents.FROGPORT_CATCH_1, + AllSoundEvents.FROGPORT_CATCH_2, AllSoundEvents.FROGPORT_CATCH_3, AllSoundEvents.FROGPORT_CATCH_4); + + public void open(Level level, BlockPos pos) { + AllSoundEvents.FROGPORT_OPEN.playAt(level, Vec3.atCenterOf(pos), 1, 1, false); + } + + public void close(Level level, BlockPos pos) { + if (!isPlayerNear(pos)) + return; + AllSoundEvents.FROGPORT_CLOSE.playAt(level, Vec3.atCenterOf(pos), 0.5f, 1.25f + level.random.nextFloat() * 0.25f, + true); + } + + public void catchPackage(Level level, BlockPos pos) { + if (!isPlayerNear(pos)) + return; + CATCH_SOUNDS.get(level.random.nextInt(CATCH_SOUNDS.size())) + .playAt(level, Vec3.atCenterOf(pos), 1, 1, false); + } + + public void depositPackage(Level level, BlockPos pos) { + if (!isPlayerNear(pos)) + return; + AllSoundEvents.FROGPORT_DEPOSIT.playAt(level, Vec3.atCenterOf(pos), 1, 1, false); + } + + private boolean isPlayerNear(BlockPos pos) { + return pos.closerThan(Minecraft.getInstance().player.blockPosition(), 20); + } + +} diff --git a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java index 31d2b31a16..a01c4492ca 100644 --- a/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/packager/PackagerBlock.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.logistics.packager; import com.simibubi.create.AllBlockEntityTypes; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; +import com.simibubi.create.AllSoundEvents; import com.simibubi.create.content.equipment.wrench.IWrenchable; import com.simibubi.create.content.logistics.box.PackageItem; import com.simibubi.create.foundation.block.IBE; @@ -97,6 +98,7 @@ public class PackagerBlock extends WrenchableDirectionalBlock implements IBE requests = findPackagersForRequest(freqId, order, null, ignoredHandler, address); diff --git a/src/main/java/com/simibubi/create/content/logistics/stockTicker/PackageOrderRequestPacket.java b/src/main/java/com/simibubi/create/content/logistics/stockTicker/PackageOrderRequestPacket.java index f73e21217a..70fe0a3aa0 100644 --- a/src/main/java/com/simibubi/create/content/logistics/stockTicker/PackageOrderRequestPacket.java +++ b/src/main/java/com/simibubi/create/content/logistics/stockTicker/PackageOrderRequestPacket.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.logistics.stockTicker; +import com.simibubi.create.AllSoundEvents; import com.simibubi.create.content.logistics.packagerLink.LogisticallyLinkedBehaviour.RequestType; import com.simibubi.create.content.logistics.redstoneRequester.RedstoneRequesterBlock; import com.simibubi.create.foundation.networking.BlockEntityConfigurationPacket; @@ -44,6 +45,9 @@ public class PackageOrderRequestPacket extends BlockEntityConfigurationPacket dcbe.use(player, ray)); } diff --git a/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java b/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java index b2622ec6b4..8aca06925c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java @@ -21,6 +21,7 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour; import com.simibubi.create.foundation.utility.CreateLang; +import net.createmod.catnip.utility.IntAttached; import net.createmod.catnip.utility.NBTHelper; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; @@ -103,6 +104,8 @@ public class TableClothBlockEntity extends SmartBlockEntity { public InteractionResult use(Player player, BlockHitResult ray) { if (isShop()) return useShop(player); + if (level.isClientSide()) + return InteractionResult.SUCCESS; ItemStack heldItem = player.getItemInHand(InteractionHand.MAIN_HAND); @@ -110,7 +113,8 @@ public class TableClothBlockEntity extends SmartBlockEntity { if (manuallyAddedItems.isEmpty()) return InteractionResult.SUCCESS; player.setItemInHand(InteractionHand.MAIN_HAND, manuallyAddedItems.remove(manuallyAddedItems.size() - 1)); - + level.playSound(null, worldPosition, SoundEvents.ITEM_FRAME_REMOVE_ITEM, SoundSource.BLOCKS, 0.5f, 1f); + if (manuallyAddedItems.isEmpty()) { level.setBlock(worldPosition, getBlockState().setValue(TableClothBlock.HAS_BE, false), 3); AllPackets.getChannel() @@ -124,8 +128,10 @@ public class TableClothBlockEntity extends SmartBlockEntity { if (manuallyAddedItems.size() >= 4) return InteractionResult.SUCCESS; + level.playSound(null, worldPosition, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 0.5f, 1f); manuallyAddedItems.add(heldItem.copyWithCount(1)); - facing = player.getDirection().getOpposite(); + facing = player.getDirection() + .getOpposite(); heldItem.shrink(1); if (heldItem.isEmpty()) player.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY); @@ -140,12 +146,10 @@ public class TableClothBlockEntity extends SmartBlockEntity { } public InteractionResult useShop(Player player) { - if (level.isClientSide()) - return InteractionResult.SUCCESS; - ItemStack itemInHand = player.getItemInHand(InteractionHand.MAIN_HAND); ItemStack prevListItem = ItemStack.EMPTY; boolean addOntoList = false; + boolean clientSide = level.isClientSide(); // Remove other lists from inventory for (int i = 0; i < 9; i++) { @@ -155,8 +159,9 @@ public class TableClothBlockEntity extends SmartBlockEntity { continue; prevListItem = item; addOntoList = true; - player.getInventory() - .setItem(i, ItemStack.EMPTY); + if (!clientSide) + player.getInventory() + .setItem(i, ItemStack.EMPTY); } // add onto existing list if in hand @@ -166,16 +171,20 @@ public class TableClothBlockEntity extends SmartBlockEntity { } if (!itemInHand.isEmpty() && !addOntoList) { - CreateLang.translate("stock_keeper.shopping_list_empty_hand") - .sendStatus(player); - AllSoundEvents.DENY.playOnServer(level, worldPosition); + if (clientSide) { + CreateLang.translate("stock_keeper.shopping_list_empty_hand") + .sendStatus(player); + AllSoundEvents.DENY.playAt(level, worldPosition, 1, 1, false); + } return InteractionResult.SUCCESS; } if (getPaymentItem().isEmpty()) { - CreateLang.translate("stock_keeper.no_price_set") - .sendStatus(player); - AllSoundEvents.DENY.playOnServer(level, worldPosition); + if (clientSide) { + CreateLang.translate("stock_keeper.no_price_set") + .sendStatus(player); + AllSoundEvents.DENY.playAt(level, worldPosition, 1, 1, false); + } return InteractionResult.SUCCESS; } @@ -187,26 +196,30 @@ public class TableClothBlockEntity extends SmartBlockEntity { int stockLevel = getStockLevelForTrade(ShoppingListItem.getList(prevListItem)); if (tickerID == null) { - CreateLang.translate("stock_keeper.keeper_missing") - .style(ChatFormatting.RED) - .sendStatus(player); - AllSoundEvents.DENY.playOnServer(level, worldPosition); + if (clientSide) { + CreateLang.translate("stock_keeper.keeper_missing") + .style(ChatFormatting.RED) + .sendStatus(player); + AllSoundEvents.DENY.playAt(level, worldPosition, 1, 1, false); + } return InteractionResult.SUCCESS; } if (stockLevel == 0) { - CreateLang.translate("stock_keeper.out_of_stock") - .style(ChatFormatting.RED) - .sendStatus(player); - AllSoundEvents.DENY.playOnServer(level, worldPosition); - - if (!prevListItem.isEmpty()) { - if (player.getItemInHand(InteractionHand.MAIN_HAND) - .isEmpty()) - player.setItemInHand(InteractionHand.MAIN_HAND, prevListItem); - else - player.getInventory() - .placeItemBackInInventory(prevListItem); + if (clientSide) { + CreateLang.translate("stock_keeper.out_of_stock") + .style(ChatFormatting.RED) + .sendStatus(player); + AllSoundEvents.DENY.playAt(level, worldPosition, 1, 1, false); + } else { + if (!prevListItem.isEmpty()) { + if (player.getItemInHand(InteractionHand.MAIN_HAND) + .isEmpty()) + player.setItemInHand(InteractionHand.MAIN_HAND, prevListItem); + else + player.getInventory() + .placeItemBackInInventory(prevListItem); + } } return InteractionResult.SUCCESS; @@ -222,13 +235,22 @@ public class TableClothBlockEntity extends SmartBlockEntity { addOntoList = false; } - if (list.getPurchases(worldPosition) == stockLevel) { - CreateLang.translate("stock_keeper.limited_stock") - .style(ChatFormatting.RED) - .sendStatus(player); - AllSoundEvents.DENY.playOnServer(level, worldPosition); + if (list.getPurchases(worldPosition) >= stockLevel) { + for (IntAttached entry : list.purchases()) + if (worldPosition.equals(entry.getValue())) + entry.setFirst(Math.min(stockLevel, entry.getFirst())); + + if (clientSide) + CreateLang.translate("stock_keeper.limited_stock") + .style(ChatFormatting.RED) + .sendStatus(player); } else { + if (clientSide) { + AllSoundEvents.CONFIRM_2.playAt(level, worldPosition, 0.5f, 1, false); + return InteractionResult.SUCCESS; + } + list.addPurchases(worldPosition, 1); if (!addOntoList) CreateLang.translate("stock_keeper.use_list_to_add_purchases") @@ -236,9 +258,11 @@ public class TableClothBlockEntity extends SmartBlockEntity { .sendStatus(player); if (!addOntoList) level.playSound(null, worldPosition, SoundEvents.BOOK_PAGE_TURN, SoundSource.BLOCKS, 1, 1.5f); - AllSoundEvents.CONFIRM.playOnServer(level, worldPosition); } + if (clientSide) + return InteractionResult.SUCCESS; + ItemStack newListItem = ShoppingListItem.saveList(AllItems.SHOPPING_LIST.asStack(), list, requestData.encodedTargetAdress); diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 519b0ae96a..e07cd129e5 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -238,7 +238,7 @@ public enum AllGuiTextures implements ScreenElement, TextureSheetSegment { TRAIN_PROMPT_R("widgets", 11, 209, 3, 16), TRAIN_PROMPT("widgets", 0, 230, 256, 16), - TRADE_OVERLAY("widgets", 136, 97, 98, 48), + TRADE_OVERLAY("widgets", 128, 98, 96, 46), // PlacementIndicator PLACEMENT_INDICATOR_SHEET("placement_indicator", 0, 0, 16, 256), diff --git a/src/main/resources/assets/create/lang/default/interface.json b/src/main/resources/assets/create/lang/default/interface.json index 6354afbc0a..f0e58b4f47 100644 --- a/src/main/resources/assets/create/lang/default/interface.json +++ b/src/main/resources/assets/create/lang/default/interface.json @@ -347,7 +347,7 @@ "create.stock_keeper.no_price_set": "Shop owner must set a price first", "create.stock_keeper.keeper_missing": "Stock keeper missing", "create.stock_keeper.out_of_stock": "Out of Stock", - "create.stock_keeper.limited_stock": "Limited stock available", + "create.stock_keeper.limited_stock": "Stock limit reached", "create.stock_keeper.use_list_to_add_purchases": "Use this list to add more to your purchase", "create.stock_keeper.locked": "Interact using a Shopping list, direct access has been locked", "create.stock_keeper.stock_level_too_low": "Purchase cancelled: Stock levels lower than expected", diff --git a/src/main/resources/assets/create/sounds/confirm_2.ogg b/src/main/resources/assets/create/sounds/confirm_2.ogg new file mode 100644 index 0000000000..d94df4235d Binary files /dev/null and b/src/main/resources/assets/create/sounds/confirm_2.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_catch_1.ogg b/src/main/resources/assets/create/sounds/frogport_catch_1.ogg new file mode 100644 index 0000000000..90737e4de7 Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_catch_1.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_catch_2.ogg b/src/main/resources/assets/create/sounds/frogport_catch_2.ogg new file mode 100644 index 0000000000..2f674e5050 Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_catch_2.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_catch_3.ogg b/src/main/resources/assets/create/sounds/frogport_catch_3.ogg new file mode 100644 index 0000000000..be2c118849 Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_catch_3.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_catch_4.ogg b/src/main/resources/assets/create/sounds/frogport_catch_4.ogg new file mode 100644 index 0000000000..92783f48a1 Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_catch_4.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_close.ogg b/src/main/resources/assets/create/sounds/frogport_close.ogg new file mode 100644 index 0000000000..7fdfebbd5b Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_close.ogg differ diff --git a/src/main/resources/assets/create/sounds/frogport_open.ogg b/src/main/resources/assets/create/sounds/frogport_open.ogg new file mode 100644 index 0000000000..ac2e1c771e Binary files /dev/null and b/src/main/resources/assets/create/sounds/frogport_open.ogg differ diff --git a/src/main/resources/assets/create/sounds/stock_ticker_request.ogg b/src/main/resources/assets/create/sounds/stock_ticker_request.ogg new file mode 100644 index 0000000000..f31447645c Binary files /dev/null and b/src/main/resources/assets/create/sounds/stock_ticker_request.ogg differ diff --git a/src/main/resources/assets/create/sounds/stock_ticker_trade.ogg b/src/main/resources/assets/create/sounds/stock_ticker_trade.ogg new file mode 100644 index 0000000000..cc73b4ffed Binary files /dev/null and b/src/main/resources/assets/create/sounds/stock_ticker_trade.ogg differ