Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke100000 committed Nov 12, 2024
1 parent 8dcb2d8 commit 34bcd33
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 @@ -75,6 +75,10 @@ protected SoundEvent getEngineSound() {
return Sounds.PROPELLER.get();
}

protected float getEngineVolume() {
return 0.25f;
}

protected float getEnginePitch() {
return 1.0f;
}
Expand Down Expand Up @@ -123,7 +127,7 @@ public void tick() {
if (isFuelLow()) {
engineSound -= random.nextInt(2);
}
level().playLocalSound(getX(), getY() + getBbHeight() * 0.5, getZ(), getEngineSound(), getSoundSource(), Math.min(1.0f, 0.25f + engineSpinUpStrength), (random.nextFloat() * 0.1f + 0.95f) * getEnginePitch(), false);
level().playLocalSound(getX(), getY() + getBbHeight() * 0.5, 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 @@ -59,7 +59,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.level().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 34bcd33

Please sign in to comment.