Unnecessary method override for dispenser behaviors
Using Yarn mappings, the following method exists in the BoatDispenserBehavior class:
@Override
protected void playSound(BlockPointer pointer) {
pointer.world().syncWorldEvent(WorldEvents.DISPENSER_DISPENSES, pointer.pos(), 0);
}
The immediate superclass, ItemDispenserBehavior, implements the method in the same way, though through invoking a static method:
protected void playSound(BlockPointer pointer) { syncDispensesEvent(pointer); } private static void syncDispensesEvent(BlockPointer pointer) { pointer.world().syncWorldEvent(WorldEvents.DISPENSER_DISPENSES, pointer.pos(), 0); }
Since the two implementations have the same effect, the BoatDispenserBehavior#playSound override is unnecessary.
2021-08-24, 02:19 AM
2024-05-30, 10:44 PM
5
0
-