Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke100000 committed Dec 29, 2024
1 parent 9467389 commit 1cc4c14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ protected SoundEvent getEngineSound() {
return Sounds.PROPELLER.get();
}

protected float getEngineVolume() {
return 0.25f;
}

protected float getEnginePitch() {
return 1.0f;
}
Expand Down Expand Up @@ -120,7 +124,7 @@ public void tick() {
if (isFuelLow()) {
engineSound -= random.nextInt(2);
}
level.playLocalSound(getX(), getY(), getZ(), getEngineSound(), getSoundSource(), Math.min(1.0f, 0.25f + engineSpinUpStrength), (random.nextFloat() * 0.1f + 0.95f) * getEnginePitch(), false);
level.playLocalSound(getX(), getY(), getZ(), getEngineSound(), getSoundSource(), Math.min(1.0f, getEngineVolume() + engineSpinUpStrength), (random.nextFloat() * 0.1f + 0.95f) * getEnginePitch(), false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void tick(InventoryVehicleEntity entity) {
ItemStack stack = getItem(index);
ItemStack trackedStack = tracked.get(index);
if (ItemStack.isSameItem(stack, trackedStack)) {
tracked.set(index, stack);
tracked.set(index, stack.copy());
entity.getLevel().players().forEach(p -> {
if (!(p.containerMenu instanceof VehicleScreenHandler vehicleScreenHandler && vehicleScreenHandler.getVehicle() == entity)) {
NetworkHandler.sendToPlayer(new InventoryUpdateMessage(entity.getId(), index, stack), (ServerPlayer) p);
Expand Down

0 comments on commit 1cc4c14

Please sign in to comment.