All 91 public types of the package de.lardtom.propwash.api in Propwash 0.5.2 (API 1.6.0), read from the source code. Public members only; how to use them is in the add-on guide. The Maven artifacts also carry sources and Javadoc for your IDE.
Alle 91 öffentlichen Typen des Pakets de.lardtom.propwash.api in Propwash 0.5.2 (API 1.6.0), aus dem Quellcode gelesen. Nur öffentliche Mitglieder; wie man sie benutzt, steht im Add-on-Handbuch. Die Maven-Artefakte bringen auch Quellen und Javadoc für die IDE mit.
api
ApiVersion recordRecord
A parsed API version (major.minor.patch) and the compatibility rule: same major version, at least the required minor version.
Eine gelesene API-Version (Haupt.Neben.Patch) und die Verträglichkeitsregel: gleiche Hauptversion, mindestens die verlangte Nebenversion.
record ApiVersion(int major, int minor, int patch) implements Comparable<ApiVersion>
static ApiVersion parse(String text)boolean satisfies(ApiVersion required)
PropwashApi classKlasse
Entry point of the API: version, part registry, part items, builds, creative tab, loot, language texts and (since 1.6) accessories, drones and flight extensions.
Einstieg in die API: Version, Teile-Register, Teil-Items, Baupläne, Kreativ-Tab, Beute, Sprachtexte und (seit 1.6) Zubehör, Drohnen und Flug-Erweiterungen.
class PropwashApi
static final String MOD_ID = "propwash"static final String API_VERSION = "1.6.0"static final ApiVersion VERSIONstatic boolean isCompatible(String requiredVersion)static void requireVersion(String modId, String requiredVersion)static PartRegistry parts()static PartItems partItems()static BuildAccess builds()static CreativeEntries creativeTab()static ExtensionTab extensionTab(String namespace)static List<ExtensionTab> extensionTabs()static LootInjections loot()static AccessoryRegistry accessories()static DroneAccess drones()static FlightExtensions flight()static Optional<String> text(String languageCode, String key)
api.accessory
AccessoryAction interfaceInterface
What an accessory sees when the pilot presses or releases accessory action 1–4: number, pressed, player, plus the accessory context.
Was ein Zubehörteil sieht, wenn der Pilot Zubehör-Aktion 1–4 drückt oder loslässt: Nummer, gedrückt, Spieler und der Zubehör-Kontext.
interface AccessoryAction extends AccessoryContext
int number()boolean pressed()ServerPlayer player()
AccessoryBehavior interfaceInterface
Code behind an add-on accessory: inventory size and filter (shulker boxes and drone items with accessory contents are never taken), own payload weight, reaction to accessory actions and a server tick.
Code hinter einem Zubehörteil eines Add-ons: Inventargröße und Filter (Shulkerkisten und Drohnen-Items mit Zubehör-Inhalt nie), eigenes Beladungsgewicht, Reaktion auf Zubehör-Aktionen und ein Server-Tick.
interface AccessoryBehavior
int MAX_SLOTS = 9default int slots()default boolean accepts(int slot, ItemStack stack)default int maxStackSize(int slot, ItemStack stack)default OptionalDouble payloadGrams(List<ItemStack> contents)default void onAction(AccessoryAction action)default void tick(AccessoryContext context)
AccessoryContext interfaceInterface
Server view of one accessory on one drone: level, drone, slot, inventory, pilot, flight state, held actions, mount pose, velocity and physics.
Server-Sicht auf ein Zubehörteil an einer Drohne: Welt, Drohne, Halterung, Inventar, Pilot, Flugzustand, gehaltene Aktionen, Lage der Halterung, Tempo und Physik.
interface AccessoryContext
ServerLevel level()Entity drone()Identifier accessory()AccessorySlot slot()AccessoryInventory inventory()Optional<ServerPlayer> pilot()boolean flying()boolean armed()boolean actionHeld(int number)MountPose mount()Vec3 velocity()DronePhysics physics()
AccessoryInventory interfaceInterface
The synchronised inventory of an accessory on a drone (server): read copies, set and take stacks, payload weight.
Das synchronisierte Inventar eines Zubehörteils an einer Drohne (Server): Kopien lesen, Stapel setzen und entnehmen, Beladungsgewicht.
interface AccessoryInventory
int size()ItemStack get(int slot)void set(int slot, ItemStack stack)ItemStack take(int slot, int count)int firstFilled()boolean isEmpty()List<ItemStack> contents()double payloadGrams()
AccessoryRegistry interfaceInterface
Registers accessory behaviours and reads accessories and their contents on drones and drone items.
Meldet Zubehör-Verhalten an und liest Zubehör samt Inhalt an Drohnen und Drohnen-Items.
interface AccessoryRegistry
void register(Identifier accessoryId, AccessoryBehavior behavior)Optional<AccessoryBehavior> behavior(Identifier accessoryId)List<Identifier> registered()Optional<Identifier> accessoryAt(Entity drone, AccessorySlot slot)List<ItemStack> contents(Entity drone, AccessorySlot slot)Optional<AccessoryInventory> inventory(Entity drone, AccessorySlot slot)List<ItemStack> contents(ItemStack droneItem, AccessorySlot slot)double itemGrams(ItemStack stack)
MountPose recordRecord
World pose of an accessory mount: anchor, centre, front face and the forward, up and right directions including tilt.
Weltlage einer Zubehör-Halterung: Anbaupunkt, Mitte, Vorderseite und die Richtungen vorn, oben und rechts samt Neigung.
record MountPose(Vec3 anchor, Vec3 center, Vec3 front, Vec3 forward, Vec3 up, Vec3 right)
Vec3 at(double rightMetres, double upMetres, double forwardMetres)
api.build
BuildAccess interfaceInterface
Reads and creates drone items, checks and analyses builds, gives the FPV camera, default tune and presets, and runs imports on the server.
Liest und erzeugt Drohnen-Items, prüft und analysiert Baupläne, liefert FPV-Kamera, Standard-Tuning und Presets und führt Importe auf dem Server aus.
interface BuildAccess
boolean isDrone(ItemStack stack)Optional<DroneData> read(ItemStack stack)ItemStack createDrone(DroneData data)ItemStack withTune(ItemStack drone, TuneSpec tune)ItemStack withPaint(ItemStack drone, PaintSpec paint)BuildCheck check(BuildSpec spec)default boolean partCompatibility()Optional<BuildStats> analyze(BuildSpec spec)default Optional<CameraView> cameraView(BuildSpec spec)default double footprintMm(BuildSpec spec)default Optional<CameraView> cameraView(BuildSpec spec, double uptiltDeg)default Optional<CameraView.UptiltRange> uptiltRange(Identifier frame)TuneSpec defaultTune(BuildSpec spec)List<DronePreset> presets()DronePreset registerPreset(DronePreset preset)ImportResult applyImport(ServerPlayer player, ImportRequest request)default OptionalDouble partCondition(ItemStack drone, PartKind kind)default Map<String, Integer> paintCost(ItemStack drone, PaintSpec target)
BuildCheck recordRecord
Result of a build check: unknown parts, problems that stop the build and warnings.
Ergebnis einer Bau-Prüfung: unbekannte Teile, Probleme, die den Bau verhindern, und Warnungen.
record BuildCheck(BuildSpec spec, List<Identifier> unknownParts, List<String> problems, List<String> warnings)
static String translationKey(String issue)boolean known()boolean buildable()
BuildSpec recordRecord
The parts of a drone as ids: frame, stack, motor, prop, video, battery and accessories per slot.
Die Teile einer Drohne als Ids: Rahmen, Stack, Motor, Prop, Video, Akku und Zubehör je Platz.
record BuildSpec(Identifier frame, Identifier stack, Identifier motor, Identifier prop, Identifier video, Identifier battery, Map<AccessorySlot, Identifier> accessories)
static BuildSpec of(Identifier frame, Identifier stack, Identifier motor, Identifier prop, Identifier video, Identifier battery)Identifier part(PartKind kind)Optional<Identifier> accessory(AccessorySlot slot)BuildSpec withPart(PartKind kind, Identifier id)BuildSpec withAccessory(AccessorySlot slot, Identifier id)BuildSpec withoutAccessory(AccessorySlot slot)List<Identifier> allParts()
BuildStats recordRecord
The figures of the workbench analysis: weight, thrust-to-weight, hover throttle, flight times, currents, temperatures, props in view and warnings.
Die Werte der Werkbank-Analyse: Gewicht, Schub-Gewicht, Schwebegas, Flugzeiten, Ströme, Temperaturen, Props im Bild und Warnungen.
record BuildStats(double massGrams, double thrustToWeight, double hoverThrottlePercent, double hoverFlightTimeMin, double cruiseFlightTimeMin, double topSpeedKmh, double fullThrottleCurrentA, double escLoadPercent, double batteryLoadPercent, double motorResponseMs, double crashSpeedMs, double sustainedMotorTempC, double propsInViewPercent, List<String> warnings, double mixedFlightTimeMin, double aggressiveFlightTimeMin, double hoverCurrentA, double cruiseCurrentA, double mixedCurrentA, double cruiseSpeedKmh, double landingCellVoltage, double avionicsPowerW, double motorTempMinuteC, double mixedMotorTempC, double propwashNoise, double fullThrottleCellVoltage, double rollAuthorityRadS2, double pitchAuthorityRadS2, double yawAuthorityRadS2)
static final List<String> WARNINGSBuildStats(double massGrams, double thrustToWeight, double hoverThrottlePercent, double hoverFlightTimeMin, double cruiseFlightTimeMin, double topSpeedKmh, double fullThrottleCurrentA, double escLoadPercent, double batteryLoadPercent, double motorResponseMs, double crashSpeedMs, double sustainedMotorTempC, double propsInViewPercent, List<String> warnings, double mixedFlightTimeMin, double aggressiveFlightTimeMin, double hoverCurrentA, double cruiseCurrentA, double mixedCurrentA, double cruiseSpeedKmh, double landingCellVoltage, double avionicsPowerW, double motorTempMinuteC, double mixedMotorTempC)BuildStats(double massGrams, double thrustToWeight, double hoverThrottlePercent, double hoverFlightTimeMin, double cruiseFlightTimeMin, double topSpeedKmh, double fullThrottleCurrentA, double escLoadPercent, double batteryLoadPercent, double motorResponseMs, double crashSpeedMs, double sustainedMotorTempC, double propsInViewPercent, List<String> warnings)static String warningTranslationKey(String warning)
CameraView recordRecord
The FPV camera as Propwash draws it: lens position, uptilt and its range, field of view and the four prop discs.
Die FPV-Kamera, wie Propwash sie zeichnet: Objektivlage, Uptilt und sein Bereich, Sichtfeld und die vier Prop-Scheiben.
record CameraView(Vec3Mm lensMm, double uptiltDeg, double horizontalFovDeg, double aspect, List<PropDisc> props, double propsInViewPercent, UptiltRange uptiltRange)
CameraView(Vec3Mm lensMm, double uptiltDeg, double horizontalFovDeg, double aspect, List<PropDisc> props, double propsInViewPercent)double verticalFovDeg()double uptiltMinDeg()double uptiltMaxDeg()double defaultUptiltDeg()
CameraView.UptiltRange recordRecord
record UptiltRange(double minDeg, double maxDeg, double defaultDeg)
static UptiltRange unrestricted(double defaultDeg)double clamp(double degrees)boolean contains(double degrees)
CameraView.PropDisc recordRecord
record PropDisc(Vec3Mm centerMm, double radiusMm, double hubRadiusMm)
DroneData recordRecord
Everything a share code carries: build, paint, tune and name.
Alles, was ein Sharecode trägt: Bauplan, Lack, Tuning und Name.
record DroneData(BuildSpec build, PaintSpec paint, TuneSpec tune, Optional<String> name)
static final int MAX_NAME_LENGTH = 48static DroneData of(BuildSpec build)DroneData withBuild(BuildSpec value)DroneData withPaint(PaintSpec value)DroneData withTune(TuneSpec value)DroneData withName(String value)
DronePreset recordRecord
A named ready-made drone shown in the creative tab and recognised in the workbench.
Eine benannte fertige Drohne, die im Kreativ-Tab steht und in der Werkbank erkannt wird.
record DronePreset(Identifier id, DroneData data, boolean creativeListed)
static DronePreset of(Identifier id, DroneData data)String translationKey()
ImportLayer enumEnum
What an import applies: parts, paint, tune, name.
Was ein Import übernimmt: Teile, Lack, Tuning, Name.
enum ImportLayer
PARTSPAINTTUNENAME
String translationKey()
ImportRequest recordRecord
An import request with its layers, tune groups and target; factories for the usual cases.
Eine Import-Anfrage mit Ebenen, Tuning-Gruppen und Ziel; Fabriken für die üblichen Fälle.
record ImportRequest(DroneData data, Set<ImportLayer> layers, Set<TuneGroup> tuneGroups, ImportTarget target)
static ImportRequest wholeBuild(DroneData data)static ImportRequest tuneOnHeldDrone(DroneData data)static ImportRequest paintOnHeldDrone(DroneData data)static ImportRequest onHeldDrone(DroneData data, Set<ImportLayer> layers)static ImportRequest createDrone(DroneData data)
ImportResult recordRecord
The server’s answer to an import: status, applied layers, missing parts and dyes.
Die Antwort des Servers auf einen Import: Status, übernommene Ebenen, fehlende Teile und Farbstoffe.
record ImportResult(ImportStatus status, Set<ImportLayer> applied, List<Identifier> missingParts, Map<String, Integer> missingDyes)
static ImportResult of(ImportStatus status)static ImportResult applied(Set<ImportLayer> layers)static ImportResult missingParts(List<Identifier> parts)static ImportResult missingDyes(Map<String, Integer> dyes)
ImportStatus enumEnum
Outcome of an import, each with a translation key.
Ausgang eines Imports, jeweils mit Sprachschlüssel.
enum ImportStatus
APPLIEDUNCHANGEDUNKNOWN_PARTSMISSING_PARTSMISSING_DYESNO_TARGETNOT_ALLOWEDINVALIDBUSY
boolean success()String translationKey()
ImportTarget enumEnum
Where an import goes: workbench, held drone or a new drone.
Wohin ein Import geht: Werkbank, gehaltene Drohne oder neue Drohne.
enum ImportTarget
WORKBENCHHELD_DRONENEW_DRONE
PaintSpec recordRecord
RGB colour per paint slot; missing slots keep the original colour.
RGB-Farbe je Lack-Platz; fehlende Plätze behalten die Originalfarbe.
record PaintSpec(Map<String, Integer> colors)
static final List<String> SLOTSstatic final PaintSpec DEFAULTboolean isDefault()Optional<Integer> color(String slot)PaintSpec with(String slot, int rgb)PaintSpec without(String slot)
TuneGroup enumEnum
Groups of tune keys (rates, PID, filters, camera, LED, VTX …) for partial imports.
Gruppen von Tuning-Schlüsseln (Rates, PID, Filter, Kamera, LED, VTX …) für Teil-Importe.
enum TuneGroup
RATESPIDFEEDFORWARDTPAFILTERSTHROTTLEHOLDCAMERALEDVTXOTHER
static final Set<TuneGroup> FLIGHTstatic TuneGroup of(String key)String translationKey()
TuneSpec recordRecord
Tune values by key, like in the flight controller; missing keys mean the default.
Tuning-Werte je Schlüssel wie im Flight-Controller; fehlende Schlüssel bedeuten Standard.
record TuneSpec(Map<String, Float> values)
static final int MAX_ENTRIES = 256static final TuneSpec EMPTYstatic final String CAMERA_UPTILT = "camera.uptiltDeg"TuneSpec only(Collection<TuneGroup> groups)TuneSpec without(Collection<TuneGroup> groups)TuneSpec overlay(TuneSpec imported, Collection<TuneGroup> groups)
api.client
ClientInput interfaceInterface
Reads the local pilot’s input: flown drone, sticks and accessory actions (client only).
Liest die Eingaben des Piloten: geflogene Drohne, Knüppel und Zubehör-Aktionen (nur Client).
interface ClientInput
boolean flying()Optional<Entity> drone()double roll()double pitch()double yaw()double throttle()boolean action(int number)
ClientTune interfaceInterface
Reads and applies the tune of the drone the player flies or holds (client only).
Liest und setzt das Tuning der Drohne, die der Spieler fliegt oder hält (nur Client).
interface ClientTune
boolean available()TuneSpec current()TuneSpec defaults()boolean apply(TuneSpec tune)
FlightSchoolScenes classKlasse
Ids of all built-in Flight School scenes, in display order.
Ids aller eingebauten Flugschul-Szenen in Anzeigereihenfolge.
class FlightSchoolScenes
static final String DRONE_BUILD = "propwash:drone_build"static final String BIND = "propwash:bind"static final String FPV_LOS = "propwash:fpv_los"static final String BATTERY = "propwash:battery"static final String RACE = "propwash:race"static final String GATE_FREE = "propwash:gate_free"static final String COURSE_ELEMENTS = "propwash:course_elements"static final String TRICKS = "propwash:tricks"static final String VIDEO = "propwash:video"static final String ACTION_CAM = "propwash:action_cam"static final String GRIPPER = "propwash:gripper"static final String CONFIGURATOR = "propwash:configurator"static final String RESCUE = "propwash:rescue"static final String HOLD = "propwash:hold"static final String MODE_3D = "propwash:mode_3d"static final String RECOVERY = "propwash:recovery"static final String REPAIR = "propwash:repair"static final String SURVIVAL = "propwash:survival"static final List<String> ALL
OsdLayoutAccess interfaceInterface
Reads, checks and applies the player’s OSD layout (client only).
Liest, prüft und setzt das OSD-Layout des Spielers (nur Client).
interface OsdLayoutAccess
OsdLayoutSpec current()OsdLayoutSpec defaults()boolean apply(OsdLayoutSpec layout)default boolean validate(OsdLayoutSpec layout)
OsdLayoutSpec recordRecord
An OSD layout as versioned JSON.
Ein OSD-Layout als versioniertes JSON.
record OsdLayoutSpec(int version, String json)
static final int CURRENT_VERSION = 1static final int MAX_JSON_LENGTH = 8192
PropwashClientApi classKlasse
Client entry point: configurator tabs, workbench extensions, Flight School scenes and links, OSD, tune, imports and the drone preview, HUD elements, gimbal cameras and input (since 1.6).
Client-Einstieg: Konfigurator-Tabs, Werkbank-Erweiterungen, Flugschul-Szenen und -Verknüpfungen, OSD, Tuning, Importe und die Drohnen-Vorschau, HUD-Elemente, Gimbal-Kameras und Eingaben (seit 1.6).
class PropwashClientApi
static boolean isAddonActive(String modId)static void registerConfigTab(Supplier<? extends ConfigTab> factory)static boolean openConfigTab(String tabId, @Nullable Screen parent)static void registerWorkbenchExtension(WorkbenchExtension extension)static List<WorkbenchExtension> workbenchExtensions()static void registerFlightSchoolScene(Supplier<Scene> scene)static void registerFlightSchoolScene(Supplier<Scene> scene, BooleanSupplier visible)static ActorSpec.Drone flightSchoolDrone(BuildSpec build, boolean assembled, float scale)static boolean openFlightSchoolScene(String sceneId, @Nullable Screen parent)static void linkFlightSchoolItems(String sceneId, String... itemIds)static void linkFlightSchoolParts(String sceneId, String namespace, PartKind... kinds)static List<String> flightSchoolScenes(ItemStack stack)static boolean openFlightSchool(ItemStack stack, @Nullable Screen parent)static OsdLayoutAccess osd()static void registerHudElement(String id, HudElement element)static void registerGimbal(String id, GimbalProvider provider)static ClientInput input()static ClientTune tune()static Optional<DroneData> heldDrone()static CompletableFuture<ImportResult> sendImport(ImportRequest request)static CompletableFuture<ImportResult> sendCreateDrone(DroneData data)static void forceShiftHelp(@Nullable Boolean shown)static void renderPreview(GuiGraphicsExtractor graphics, DroneData drone, int x0, int y0, int x1, int y1, float yawDegrees)static void renderPreview(GuiGraphicsExtractor graphics, DroneData drone, int x0, int y0, int x1, int y1, float yawDegrees, float pixelsPerMillimetre)
WorkbenchContext interfaceInterface
What a workbench extension sees and can do: slots, result, buttons, child screens, import.
Was eine Werkbank-Erweiterung sieht und kann: Slots, Ergebnis, Knöpfe, Kind-Fenster, Import.
interface WorkbenchContext
int BUTTON_PADDING = 14int BUTTON_GAP = 3int MAX_BUTTON_WIDTH = 80int ICON_BUTTON_SIZE = 13Screen screen()int containerId()boolean creative()Optional<Identifier> slot(PartKind kind, int position)Optional<DroneData> result()void addButton(Component label, Component tooltip, Runnable onPress)default void addButton(Component label, Component shortLabel, Component tooltip, Runnable onPress)default void addIconButton(Identifier sprite, Component tooltip, Runnable onPress)default int headerSpace()default int buttonWidth(Component label)default List<Identifier> missingParts(DroneData data)void openChild(Function<Screen, Screen> factory)CompletableFuture<ImportResult> importIntoWorkbench(DroneData data, Set<ImportLayer> layers, Set<TuneGroup> tuneGroups)
WorkbenchExtension interfaceInterface
Adds buttons to the drone workbench.
Fügt der Drohnen-Werkbank Knöpfe hinzu.
interface WorkbenchExtension
Identifier id()default int order()void init(WorkbenchContext context)
api.client.camera
GimbalContext interfaceInterface
What a gimbal gets: drone, frame attitude of the shown picture, camera uptilt, time step, spectating (client only).
Was ein Gimbal bekommt: Drohne, Rahmenlage des gezeigten Bilds, Kamerawinkel, Zeitschritt, Zuschauen (nur Client).
interface GimbalContext
Entity drone()Quaternionfc frame()float uptiltDegrees()double deltaSeconds()boolean spectating()
GimbalProvider interfaceInterface
Sets the world attitude of the FPV camera for drones it applies to – a stabilised gimbal (client only).
Setzt die Weltlage der FPV-Kamera für passende Drohnen – ein stabilisierter Gimbal (nur Client).
interface GimbalProvider
boolean appliesTo(Entity drone)void orient(GimbalContext context, Quaternionf rotation)default boolean suppressesShake()
api.client.hud
FlightTelemetry recordRecord
Flight data for HUD elements: mode, position, speed, attitude, battery, home point, GPS, signals, flight time, sticks.
Flugdaten für HUD-Elemente: Modus, Position, Tempo, Lage, Akku, Home-Punkt, GPS, Signale, Flugzeit, Knüppel.
record FlightTelemetry(boolean armed, String mode, Optional<String> assistLabel, double x, double y, double z, double speed, double verticalSpeed, double headingDeg, double pitchDeg, double rollDeg, double throttle, double batteryVoltage, double cellVoltage, double batteryCharge, boolean hasHome, double homeX, double homeY, double homeZ, boolean gpsFix, int satellites, double linkQuality, double videoSignal, double flightSeconds, double stickRoll, double stickPitch, double stickYaw, double stickThrottle)
double homeDistance()double homeHeight()double homeBearingDeg()
HudContext interfaceInterface
What a HUD element gets: drone, view mode, image area, telemetry and font (client only).
Was ein HUD-Element bekommt: Drohne, Ansicht, Bildbereich, Telemetrie und Schrift (nur Client).
interface HudContext
Entity drone()boolean fpv()boolean lineOfSight()boolean spectating()int imageX0()int imageY0()int imageX1()int imageY1()float partialTick()FlightTelemetry telemetry()Font font()default int imageWidth()default int imageHeight()
HudElement interfaceInterface
An own HUD element in FPV or line of sight; may replace the Propwash OSD (client only).
Ein eigenes HUD-Element im FPV oder Sichtflug; darf das Propwash-OSD ersetzen (nur Client).
interface HudElement
void render(GuiGraphicsExtractor graphics, HudContext context)default boolean active(HudContext context)default boolean replacesOsd(HudContext context)
api.drone
DroneAccess interfaceInterface
Finds and describes drones, applies impulses and pushes, scans for obstacles and aims with lead.
Findet und beschreibt Drohnen, gibt Stöße und Schübe, sucht Hindernisse und zielt mit Vorhalt.
interface DroneAccess
boolean isDrone(Entity entity)Optional<DroneView> view(Entity entity)List<DroneView> dronesNear(Level level, Vec3 center, double radius, boolean flyingOnly)Optional<DroneView> nearestDrone(Mob mob, double range, boolean requireSight, boolean flyingOnly)Optional<DronePhysics> physics(Entity drone)double obstacleDistance(Level level, Vec3 origin, Vec3 direction, double range, boolean entities, @Nullable Entity ignore)ObstacleScan scan(Entity drone, double range)Optional<Intercept.Aim> aim(Vec3 shooter, Entity drone, double projectileSpeedPerTick, double gravityPerTick)
DronePhysics interfaceInterface
Impulses (N·s) and timed pushes (N) at a frame point; routed to the pilot’s flight model, the server return flight or a parked drone.
Stöße (N·s) und zeitlich begrenzte Schübe (N) an einem Rahmenpunkt; gehen an das Flugmodell des Piloten, den Heimflug am Server oder eine abgestellte Drohne.
interface DronePhysics
double MAX_IMPULSE = 50.0double MAX_FORCE = 500.0double MAX_SECONDS = 30.0double MAX_ARM = 2.0boolean impulse(Vec3 impulse, Vec3 framePoint)boolean push(Vec3 force, boolean frameRelative, Vec3 framePoint, double seconds)default boolean impulse(Vec3 impulse)
DroneView recordRecord
A snapshot of a drone: pilot, flying, armed, autopilot, centre, velocity, attitude, mass with load and accessories.
Momentaufnahme einer Drohne: Pilot, fliegt, scharf, Autopilot, Mitte, Tempo, Lage, Masse mit Beladung und Zubehör.
record DroneView(Entity entity, Optional<UUID> pilot, boolean flying, boolean armed, boolean autopilot, Vec3 center, Vec3 velocity, Vec3 forward, Vec3 up, double massKg, Map<AccessorySlot, Identifier> accessories)
Optional<Identifier> accessory(AccessorySlot slot)double speed()
ObstacleScan recordRecord
Obstacle distances in the six frame directions up to a range.
Hindernisabstände in den sechs Rahmenrichtungen bis zu einer Reichweite.
record ObstacleScan(double range, double[] distances)
double distance(SensorDirection direction)boolean clear(SensorDirection direction)double nearest()double[] distances()
api.event
DroneDamage classKlasse
A drone taking damage: source and amount, changeable and cancellable.
Eine Drohne nimmt Schaden: Quelle und Menge, änderbar und abbrechbar.
class DroneDamage
DroneDamage(Entity drone, ServerLevel level, DamageSource source, float amount)Entity drone()ServerLevel level()DamageSource source()float originalAmount()float amount()void setAmount(float value)boolean cancelled()void cancel()
EntityHit classKlasse
A flown drone hitting a living entity: relative velocity, contact point, mount, base damage; damage and knockback changeable.
Eine geflogene Drohne trifft ein Lebewesen: Relativtempo, Kontaktpunkt, Halterung, Grundschaden; Schaden und Rückstoß änderbar.
class EntityHit
static final float MAX_DAMAGE = 40.0Fstatic final float MAX_KNOCKBACK = 3.0FEntityHit(Entity drone, ServerPlayer pilot, LivingEntity target, Vec3 relativeVelocity, double closingSpeed, Vec3 normal, Vec3 framePoint, Optional<AccessorySlot> slot, Optional<Identifier> accessory, float baseDamage, float knockback)Entity drone()ServerPlayer pilot()LivingEntity target()Vec3 relativeVelocity()double closingSpeed()Vec3 normal()Vec3 framePoint()Optional<AccessorySlot> slot()Optional<Identifier> accessory()float baseDamage()float damage()float knockback()void setDamage(float value)void addDamage(float value)void setKnockback(float value)
PropwashEvent classKlasse
An event with listeners; register in the open phase.
Ein Event mit Listenern; Anmeldung in der offenen Phase.
class PropwashEvent<T>
PropwashEvent(String name)void register(T listener)boolean hasListeners()void fire(Consumer<? super T> action)String name()
PropwashEvents classKlasse
All events of the API and their listener interfaces.
Alle Events der API und ihre Listener-Interfaces.
class PropwashEvents
static final PropwashEvent<PartRegistered> PART_REGISTEREDstatic final PropwashEvent<RegistryFrozen> REGISTRY_FROZENstatic final PropwashEvent<DroneAssembled> DRONE_ASSEMBLEDstatic final PropwashEvent<DroneDisassembled> DRONE_DISASSEMBLEDstatic final PropwashEvent<BuildImported> BUILD_IMPORTEDstatic final PropwashEvent<EscBurned> ESC_BURNEDstatic final PropwashEvent<DroneHitEntity> DRONE_HIT_ENTITYstatic final PropwashEvent<DroneDamaged> DRONE_DAMAGEDstatic final PropwashEvent<AccessoryActionUsed> ACCESSORY_ACTION
PropwashEvents.PartRegistered interfaceInterface
interface PartRegistered
void onPartRegistered(PartDefinition definition)
PropwashEvents.RegistryFrozen interfaceInterface
interface RegistryFrozen
void onRegistryFrozen(PartRegistry registry)
PropwashEvents.DroneAssembled interfaceInterface
interface DroneAssembled
void onDroneAssembled(ServerPlayer player, ItemStack drone, DroneData data)
PropwashEvents.DroneDisassembled interfaceInterface
interface DroneDisassembled
void onDroneDisassembled(ServerPlayer player, DroneData data)
PropwashEvents.BuildImported interfaceInterface
interface BuildImported
void onBuildImported(ServerPlayer player, ImportRequest request, ImportResult result)
PropwashEvents.EscBurned interfaceInterface
interface EscBurned
void onEscBurned(ServerPlayer player, ItemStack drone, DroneData data, int cells)
PropwashEvents.DroneHitEntity interfaceInterface
interface DroneHitEntity
void onDroneHitEntity(EntityHit hit)
PropwashEvents.DroneDamaged interfaceInterface
interface DroneDamaged
void onDroneDamaged(DroneDamage damage)
PropwashEvents.AccessoryActionUsed interfaceInterface
interface AccessoryActionUsed
void onAccessoryAction(ServerPlayer player, Entity drone, int number, boolean pressed)
api.flight
AssistOutput interfaceInterface
What a flight assist commands each nav tick: sticks and mode, altitude, position or velocity, yaw, an OSD label, return to home.
Was eine Flughilfe in jedem Nav-Takt vorgibt: Knüppel und Modus, Höhe, Position oder Geschwindigkeit, Gieren, eine OSD-Anzeige, Rückkehr.
interface AssistOutput
double MAX_SPEED = 20.0double MAX_CLIMB = 8.0int MAX_LABEL = 8void sticks(double roll, double pitch, double yaw, double throttle)void mode(StabilizationMode mode)void holdAltitude(double y)void climb(double metresPerSecond)void holdPosition(double x, double z)void velocity(double vx, double vz)void maxSpeed(double metresPerSecond)void yawRate(double degreesPerSecond)void heading(double compassDegrees)void label(String text)void requestReturnHome()
DroneProfile recordRecord
The parts of a drone as ids and its mass, for choosing flight assists and force providers.
Die Teile einer Drohne als Ids und ihre Masse, zur Wahl von Flughilfen und Kräften.
record DroneProfile(String frame, String stack, String motor, String prop, String video, String battery, Map<String, String> accessories, double massKg)
Optional<String> accessory(String slotKey)boolean hasAccessory(String accessoryId)boolean has(String partId)
FlightAssist interfaceInterface
A flight controller extension running at 100 Hz inside the pilot’s flight model (position hold, cinematic smoothing, orbit, waypoints); while it outputs anything, a race lap counts as assisted.
Eine Erweiterung des Flight-Controllers, die mit 100 Hz im Flugmodell des Piloten läuft (Position halten, Kino-Glättung, Umkreisen, Wegpunkte); solange sie etwas ausgibt, zählt eine Rennrunde als Runde mit Flughilfe.
interface FlightAssist
void update(FlightState state, AssistOutput output)default double sensorRange()default void reset()
FlightExtensions interfaceInterface
Registers flight assists and force providers per drone profile.
Meldet Flughilfen und Kräfte je Drohnen-Profil an.
interface FlightExtensions
void registerAssist(String id, Function<DroneProfile, FlightAssist> factory)void registerForces(String id, Function<DroneProfile, ForceProvider> factory)List<String> assistIds()List<String> forceIds()
FlightState interfaceInterface
Read-only state for assists and forces: true and estimated position and velocity, attitude, sensors, sticks, actions, obstacles.
Nur-lese-Zustand für Flughilfen und Kräfte: wahre und geschätzte Position und Geschwindigkeit, Lage, Sensoren, Knüppel, Aktionen, Hindernisse.
interface FlightState
int ACTIONS = 4double time()double massKg()double gravity()double x()double y()double z()double vx()double vy()double vz()double estimatedX()double estimatedY()double estimatedZ()double estimatedVx()double estimatedVy()double estimatedVz()boolean positionValid()boolean gpsFix()int satellites()double headingDeg()double pitchDeg()double rollDeg()double rollRateDps()double pitchRateDps()double yawRateDps()double forwardX()double forwardY()double forwardZ()double upX()double upY()double upZ()double rightX()double rightY()double rightZ()double heightAboveGround()boolean armed()boolean grounded()boolean failsafe()double hoverThrottle()double batteryCharge()double stickRoll()double stickPitch()double stickYaw()double stickThrottle()StabilizationMode pilotMode()boolean action(int number)double obstacleDistance(SensorDirection direction)
ForceProvider interfaceInterface
Adds forces and torques to the flight model at 100 Hz on the pilot client and in the server return flight.
Gibt dem Flugmodell mit 100 Hz Kräfte und Drehmomente, auf dem Pilot-Client und im Heimflug am Server.
interface ForceProvider
void apply(FlightState state, ForceSink sink)
ForceSink interfaceInterface
Collects the forces (N) and torques (N·m) of a force provider, also at frame points.
Sammelt Kräfte (N) und Drehmomente (N·m) eines Kraft-Anbieters, auch an Rahmenpunkten.
interface ForceSink
double MAX_FORCE = 500.0double MAX_TORQUE = 50.0void addForce(double fx, double fy, double fz)void addForceAt(double fx, double fy, double fz, double frameX, double frameY, double frameZ)void addTorque(double tx, double ty, double tz)
GimbalModel classKlasse
A ready-made stabilised 3-axis gimbal without Minecraft types: follow, lock and FPV modes, pitch range, mechanical limits, smoothing.
Ein fertiger stabilisierter 3-Achsen-Gimbal ohne Minecraft-Typen: Modi Folgen, Sperren und FPV, Nickbereich, mechanische Grenzen, Glättung.
class GimbalModel
GimbalModel mode(Mode value)Mode mode()GimbalModel pitchRange(double minDeg, double maxDeg)GimbalModel mechanicalLimits(double relativePitchMinDeg, double relativePitchMaxDeg, double relativeRollLimitDeg, double relativeYawLimitDeg)GimbalModel smoothing(double followTimeSeconds, double maxYawRateDps, double maxPitchRateDps)GimbalModel pitch(double degrees)double commandedPitch()GimbalModel lockHeading(double compassDegrees)void reset()void update(double dt, double frameQx, double frameQy, double frameQz, double frameQw)double headingDeg()double pitchDeg()double rollDeg()boolean atLimit()double qx()double qy()double qz()double qw()
GimbalModel.Mode enumEnum
enum Mode
FOLLOWLOCKFPV
Intercept classKlasse
Aiming with lead and gravity compensation for projectiles at moving targets.
Zielen mit Vorhalt und Schwerkraft-Ausgleich für Geschosse auf bewegte Ziele.
class Intercept
static final int ITERATIONS = 8static Optional<Aim> aim(double shooterX, double shooterY, double shooterZ, double targetX, double targetY, double targetZ, double targetVx, double targetVy, double targetVz, double projectileSpeed, double gravity, double maxTime)
Intercept.Aim recordRecord
record Aim(double dx, double dy, double dz, double time)
SensorDirection enumEnum
The six obstacle sensor directions in frame coordinates.
Die sechs Richtungen der Hindernissensoren in Rahmen-Koordinaten.
enum SensorDirection
FORWARDBACKLEFTRIGHTUPDOWN
double x()double y()double z()
StabilizationMode enumEnum
Stabilisation modes a flight assist can select: acro, angle, horizon.
Stabilisierungsmodi, die eine Flughilfe wählen kann: Acro, Angle, Horizon.
enum StabilizationMode
ACROANGLEHORIZON
api.part
AccessoryDefinition recordRecord
An accessory for the top, bottom or front mount: size, power draw, LEDs, lens, optional action cam.
Ein Zubehörteil für die obere, untere oder vordere Halterung: Maße, Leistungsaufnahme, LEDs, Objektiv, optional Action-Cam.
record AccessoryDefinition(Identifier id, PartBasics basics, AccessorySlot slot, double widthMm, double heightMm, double depthMm, double flightBatteryWatts, double frontalAreaM2, int ledCount, Optional<ActionCamDefinition> actionCam, double lensXMm, double lensLengthMm) implements PartDefinition
static Builder builder(Identifier id)PartKind kind()
AccessoryDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder slot(AccessorySlot value)Builder size(double widthMm, double heightMm, double depthMm)Builder flightBatteryWatts(double value)Builder frontalArea(double m2)Builder leds(int count)Builder actionCam(ActionCamDefinition value)Builder lens(double xMm, double lengthMm)AccessoryDefinition build()
AccessorySlot enumEnum
Accessory mounts: top, bottom and (since 1.6) front under the nose.
Zubehör-Halterungen: oben, unten und (seit 1.6) vorne unter der Nase.
enum AccessorySlot
TOP"top"BOTTOM"bottom"FRONT"front"
static Optional<AccessorySlot> byKey(String key)String key()
ActionCamDefinition recordRecord
Recording capabilities of an action cam: resolution, frame rate, stabilisation, own battery, power, image.
Aufnahmefähigkeiten einer Action-Cam: Auflösung, Bildrate, Stabilisierung, eigener Akku, Leistung, Bild.
record ActionCamDefinition(int maxHeight, int maxFps, boolean stabilization, boolean horizonLevelling, double ownBatteryWh, double recordWatts, double maxRecordWatts, double fovDegrees, double imageQuality, double lowLightNoise, double sensorInches)
AirframeGeometry recordRecord
Arm positions and spin, battery position, camera, centre of mass, mass split and accessory anchors of a frame.
Armpositionen und Drehrichtung, Akkulage, Kamera, Schwerpunkt, Massenverteilung und Zubehör-Anker eines Rahmens.
record AirframeGeometry(List<MotorArm> arms, boolean batteryOnTop, double batteryPlateMm, double electronicsMm, Optional<Vec3Mm> cameraMm, double cameraTiltDeg, Vec3Mm frameCenterOfMassMm, MassSplit massSplit, Map<AccessorySlot, AnchorSpec> accessoryAnchors)
static final double MIN_CAMERA_TILT = 0.0static final double MAX_CAMERA_TILT = 80.0static final double DEFAULT_CAMERA_TILT = 20.0static boolean defaultBatteryOnTop(int wheelbaseMm)static double defaultBatteryPlateMm(int wheelbaseMm)static double defaultElectronicsMm(int wheelbaseMm)boolean hasExplicitArms()List<MotorArm> armsOrTrueX(int wheelbaseMm)
AnchorSpec recordRecord
Where an accessory sits on a frame: position, tilt, length.
Wo ein Zubehörteil am Rahmen sitzt: Position, Neigung, Länge.
record AnchorSpec(double x, double y, double z, double tiltDeg, double lengthMm)
static final double MIN_TILT = -45.0static final double MAX_TILT = 90.0
BatteryDefinition recordRecord
A battery pack: cells, capacity, internal resistance, C rating, chemistry, size, connector.
Ein Akku: Zellen, Kapazität, Innenwiderstand, C-Rate, Chemie, Maße, Stecker.
record BatteryDefinition(Identifier id, PartBasics basics, int cells, int capacityMah, double cellResistanceOhm, int cRating, Identifier chemistry, Optional<PackSize> packSize, String connector) implements PartDefinition
static final int MAX_CELLS = 12static final Identifier LIPOstatic final Identifier LIHVstatic final Identifier LIONstatic Builder builder(Identifier id)PartKind kind()double maxContinuousCurrent()
BatteryDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder cells(int value)Builder capacity(int mah)Builder cellResistance(double ohm)Builder cRating(int value)Builder chemistry(Identifier value)Builder packSize(PackSize value)Builder connector(String value)BatteryDefinition build()
BatteryFitRule recordRecord
Which batteries a frame takes: cell range, maximum mass and the preferred pack.
Welche Akkus ein Rahmen nimmt: Zellbereich, Höchstmasse und der bevorzugte Akku.
record BatteryFitRule(int minCells, int maxCells, double maxMassGrams, int preferredMinCells, int preferredMinCapacityMah)
CellChemistry recordRecord
A cell chemistry: voltages, density, open-circuit voltage curve and usable fraction.
Eine Zellchemie: Spannungen, Dichte, Leerlaufspannungskurve und nutzbarer Anteil.
record CellChemistry(Identifier id, double fullCellVoltage, double nominalCellVoltage, double emptyCellVoltage, double cutoffCellVoltage, double storageCellVoltage, double densityGramsPerCm3, List<Double> ocvShape, OptionalDouble usableFraction)
static final List<Double> SOC_GRIDCellChemistry(Identifier id, double fullCellVoltage, double nominalCellVoltage, double emptyCellVoltage, double cutoffCellVoltage, double storageCellVoltage, double densityGramsPerCm3, List<Double> ocvShape)double landingCellVoltage()double effectiveUsableFraction()
DuctSpec recordRecord
Duct values of a ducted frame; empty values use the standard duct.
Duct-Werte eines geduckten Rahmens; leere Werte nehmen den Standard-Duct.
record DuctSpec(OptionalDouble thrustGain, OptionalDouble clearanceMm, OptionalDouble translationalLiftGain, OptionalDouble washLoss, OptionalDouble washNoise, OptionalDouble restitution, OptionalDouble friction)
static final DuctSpec STANDARD
FrameAero recordRecord
Frontal area, drag coefficient and optional side and top areas of a frame.
Stirnfläche, Widerstandsbeiwert und optional Seiten- und Draufsichtfläche eines Rahmens.
record FrameAero(double frontalAreaM2, double dragCoefficient, OptionalDouble sideAreaM2, OptionalDouble topAreaM2)
static FrameAero of(double frontalAreaM2, double dragCoefficient)
FrameDefinition recordRecord
A frame: class, shape, wheelbase, prop sizes, mounts, geometry, aerodynamics and battery rule.
Ein Rahmen: Klasse, Form, Radstand, Prop-Größen, Halterungen, Geometrie, Aerodynamik und Akku-Regel.
record FrameDefinition(Identifier id, PartBasics basics, FrameRole role, FrameShape shape, int wheelbaseMm, int minPropMm, int maxPropMm, Set<Identifier> motorMounts, Set<Identifier> stackMounts, Set<AccessorySlot> accessoryMounts, AirframeGeometry geometry, FrameAero aero, Optional<DuctSpec> duct, double impactTolerance, BatteryFitRule batteryFit) implements PartDefinition
static final int MAX_PROP_MM = 400static Builder builder(Identifier id)PartKind kind()boolean ducted()double nominalPropInches()
FrameDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder role(FrameRole value)Builder shape(FrameShape value)Builder wheelbase(int mm)Builder props(int minMm, int maxMm)Builder maxProp(int mm)Builder motorMount(Identifier... mounts)Builder stackMount(Identifier... mounts)Builder accessoryMount(AccessorySlot... slots)Builder arms(List<MotorArm> value)Builder battery(boolean onTop, double plateMm)Builder electronics(double mm)Builder camera(Vec3Mm positionMm)Builder cameraTilt(double degrees)Builder centerOfMass(Vec3Mm positionMm)Builder massSplit(MassSplit value)Builder anchor(AccessorySlot slot, AnchorSpec anchor)Builder aero(double frontalAreaM2, double dragCoefficient)Builder sideArea(double m2)Builder topArea(double m2)Builder duct(DuctSpec value)Builder impactTolerance(double metersPerSecond)Builder batteryFit(BatteryFitRule value)FrameDefinition build()
FrameRole enumEnum
Frame classes, from whoop to X-Class; the key is the JSON value.
Rahmenklassen vom Whoop bis X-Class; der Schlüssel ist der JSON-Wert.
enum FrameRole
WHOOP"whoop"TOOTHPICK"toothpick"CINEWHOOP"cinewhoop"FREESTYLE"freestyle"RACE"race"LONG_RANGE"long_range"CINELIFTER"cinelifter"X_CLASS"x_class"
static Optional<FrameRole> byKey(String key)String key()boolean tricksByDefault()
FrameShape enumEnum
Frame shapes; the key is the JSON value.
Rahmenformen; der Schlüssel ist der JSON-Wert.
enum FrameShape
TRUE_X"true_x"STRETCHED_X"stretched_x"SQUASHED_X"squashed_x"DEADCAT"deadcat"H_FRAME"h_frame"CUSTOM"custom"
static Optional<FrameShape> byKey(String key)String key()
MassSplit recordRecord
How a frame’s mass divides into arms, plate and duct.
Wie sich die Masse eines Rahmens auf Arme, Platte und Duct verteilt.
record MassSplit(double arms, double plate, double duct)
static final MassSplit OPENstatic final MassSplit DUCTED
MotorArm recordRecord
One motor position with its spin direction.
Eine Motorposition mit Drehrichtung.
record MotorArm(Vec3Mm position, Spin spin)
static final int FRONT_LEFT = 0static final int FRONT_RIGHT = 1static final int REAR_LEFT = 2static final int REAR_RIGHT = 3static final int COUNT = 4static final List<Spin> PROPS_INstatic MotorArm of(double xMm, double yMm, double zMm, Spin spin)static List<MotorArm> trueX(int wheelbaseMm, double yMm)
MotorArm.Spin enumEnum
enum Spin
CW"cw"CCW"ccw"
String key()
MotorDefinition recordRecord
A motor: stator, KV, mount, current, winding resistance, cells, prop mount and heat limits.
Ein Motor: Stator, KV, Halterung, Strom, Wicklungswiderstand, Zellen, Prop-Aufnahme und Hitzegrenzen.
record MotorDefinition(Identifier id, PartBasics basics, String statorLabel, double statorDiameterMm, double statorHeightMm, int kv, Identifier mount, double maxCurrentAmps, double resistanceOhm, int minCells, int maxCells, Identifier propMount, MotorThermal thermal) implements PartDefinition
static double[] parseStatorLabel(String label)static Builder builder(Identifier id)PartKind kind()
MotorDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder stator(String label)Builder statorSize(double diameterMm, double heightMm)Builder kv(int value)Builder mount(Identifier value)Builder maxCurrent(double amps)Builder resistance(double ohm)Builder cells(int min, int max)Builder propMount(Identifier value)Builder thermal(MotorThermal value)MotorDefinition build()
MotorThermal recordRecord
Heat values of a motor: capacity, cooling, throttling start, maximum and wear.
Hitzewerte eines Motors: Wärmekapazität, Kühlung, Beginn der Drosselung, Maximum und Verschleiß.
record MotorThermal(OptionalDouble heatCapacityJPerK, OptionalDouble coolingWPerK, OptionalDouble coolingWPerKPerRadS, double derateStartC, double maxTempC, double wearPerSecondAtMax)
static final MotorThermal DEFAULTstatic MotorThermal limits(double derateStartC, double maxTempC)static Builder builder()
MotorThermal.Builder classKlasse
class Builder
Builder heatCapacity(double joulePerKelvin)Builder cooling(double wattPerKelvin)Builder coolingPerRadS(double wattPerKelvinPerRadS)Builder limits(double derateStartC, double maxTempC)Builder wearAtMax(double perSecond)MotorThermal build()
Mounts classKlasse
Ids of the built-in motor, stack and prop mounts.
Ids der eingebauten Motor-, Stack- und Prop-Halterungen.
class Mounts
static final Identifier MOTOR_M08static final Identifier MOTOR_M14static final Identifier MOTOR_M22static final Identifier MOTOR_M28static final Identifier STACK_WHOOP_AIOstatic final Identifier STACK_S20static final Identifier STACK_S30static final Identifier PROP_UNIVERSALstatic boolean propFits(Identifier motorPropMount, Identifier propMount)
PackSize recordRecord
Battery pack dimensions in millimetres.
Akkumaße in Millimetern.
record PackSize(double lengthMm, double widthMm, double heightMm)
PartBasics recordRecord
Data every part has: mass, stack size, sort order, creative listing, durability, recycling, look and rarity.
Daten, die jedes Teil hat: Masse, Stapelgröße, Sortierung, Kreativ-Liste, Haltbarkeit, Recycling, Aussehen und Seltenheit.
record PartBasics(double massGrams, int stackSize, int sortOrder, boolean creativeListed, double durability, Optional<RecycleYield> recycle, PartVisual visual, Optional<Rarity> rarity)
static final int DEFAULT_SORT_ORDER = 1000PartBasics(double massGrams, int stackSize, int sortOrder, boolean creativeListed, double durability, Optional<RecycleYield> recycle, PartVisual visual)static PartBasics of(double massGrams)static PartBasics withMass(PartBasics base, double massGrams)PartBasics withStackSize(int value)PartBasics withSortOrder(int value)PartBasics withCreativeListed(boolean value)PartBasics withDurability(double value)PartBasics withRecycle(RecycleYield value)PartBasics withVisual(PartVisual value)PartBasics withRarity(Rarity value)
PartDefinition interfaceInterface
Common interface of all part definitions.
Gemeinsames Interface aller Teil-Definitionen.
sealed interface PartDefinition permits FrameDefinition, StackDefinition, MotorDefinition, PropDefinition, BatteryDefinition, VideoDefinition, AccessoryDefinition
Identifier id()PartKind kind()PartBasics basics()default double massGrams()
PartKind enumEnum
Part categories; the key is the folder name of JSON parts.
Teil-Kategorien; der Schlüssel ist der Ordnername der JSON-Teile.
enum PartKind
FRAME"frame"STACK"stack"MOTOR"motor"PROP"prop"VIDEO"video"BATTERY"battery"ACCESSORY"accessory"
static Optional<PartKind> byKey(String key)String key()int requiredCount()int slotCount()
PartRegistry interfaceInterface
Registers and looks up parts and chemistries, loads JSON parts and converts them to and from JSON.
Meldet Teile und Zellchemien an, schlägt sie nach, lädt JSON-Teile und wandelt sie in JSON und zurück.
interface PartRegistry
<D extends PartDefinition> D register(D definition)CellChemistry registerChemistry(CellChemistry chemistry)int loadBundled(String modId)Optional<PartDefinition> get(Identifier id)<D extends PartDefinition> Optional<D> get(Class<D> type, Identifier id)List<PartDefinition> all()List<PartDefinition> all(PartKind kind)Optional<CellChemistry> chemistry(Identifier id)List<CellChemistry> chemistries()boolean isBuiltin(Identifier id)boolean isFrozen()String fingerprint()default JsonObject toJson(PartDefinition definition)default JsonObject toJson(CellChemistry chemistry)default PartDefinition fromJson(PartKind kind, Identifier id, JsonObject json)default CellChemistry chemistryFromJson(Identifier id, JsonObject json)
PartVisual recordRecord
Accent colour and an alternative drone model of a part.
Akzentfarbe und ein anderes Drohnen-Modell eines Teils.
record PartVisual(OptionalInt accentRgb, Optional<Identifier> renderModel)
static final PartVisual NONEstatic PartVisual accent(int rgb)PartVisual withRenderModel(Identifier model)
PropDefinition recordRecord
A propeller: diameter, pitch, blades, thrust and power coefficients, material, stiffness, mount and the optional reverse thrust for 3D mode.
Ein Propeller: Durchmesser, Steigung, Blätter, Schub- und Leistungsbeiwert, Material, Steifigkeit, Aufnahme und der optionale Umkehrschub für den 3D-Modus.
record PropDefinition(Identifier id, PartBasics basics, int diameterMm, double pitchInch, int blades, double thrustCoefficient, double powerCoefficient, PropMaterial material, double stiffness, Identifier mount, OptionalDouble reverseThrust) implements PartDefinition
static final double MIN_REVERSE_THRUST = 0.2static final double MAX_REVERSE_THRUST = 1.0PropDefinition(Identifier id, PartBasics basics, int diameterMm, double pitchInch, int blades, double thrustCoefficient, double powerCoefficient, PropMaterial material, double stiffness, Identifier mount)static Builder builder(Identifier id)PartKind kind()double diameterInches()
PropDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder durability(double value)Builder size(int diameterMm, double pitchInch, int blades)Builder coefficients(double thrust, double power)Builder material(PropMaterial value)Builder stiffness(double value)Builder mount(Identifier value)Builder reverseThrust(double ratio)PropDefinition build()
PropMaterial enumEnum
Prop materials with their default stiffness and durability; the key is the JSON value.
Prop-Materialien mit Standard-Steifigkeit und -Haltbarkeit; der Schlüssel ist der JSON-Wert.
enum PropMaterial
POLYCARBONATE"polycarbonate"GLASS_FIBER_NYLON"glass_fiber_nylon"CARBON_FIBER_NYLON"carbon_fiber_nylon"CARBON"carbon"
static Optional<PropMaterial> byKey(String key)String key()double defaultStiffness()double defaultDurability()
RecycleYield recordRecord
What the salvage slot gives back for a broken part.
Was das Zerlegen-Feld für ein kaputtes Teil zurückgibt.
record RecycleYield(Identifier item, int count)
static final RecycleYield NONEboolean none()
StackDefinition recordRecord
A flight controller and ESC stack: mount, current, cells, all-in-one.
Ein Flight-Controller- und ESC-Stack: Halterung, Strom, Zellen, All-in-One.
record StackDefinition(Identifier id, PartBasics basics, Identifier mount, double escContinuousAmps, int minCells, int maxCells, boolean allInOne, OptionalDouble escBurstAmps, OptionalDouble escResistanceOhm, OptionalDouble brownoutVoltage, OptionalDouble boardSizeMm) implements PartDefinition
static Builder builder(Identifier id)PartKind kind()
StackDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder mount(Identifier value)Builder escContinuous(double amps)Builder cells(int min, int max)Builder allInOne(boolean value)Builder escBurst(double amps)Builder escResistance(double ohm)Builder brownout(double volts)Builder boardSize(double mm)StackDefinition build()
Vec3Mm recordRecord
A position in frame millimetres (+X right, +Y up, −Z forward).
Eine Position in Rahmen-Millimetern (+X rechts, +Y oben, −Z vorn).
record Vec3Mm(double x, double y, double z)
static final Vec3Mm ZEROdouble horizontalDistance()
VideoDefinition recordRecord
A video unit: analog or digital, latency, range, image quality, camera width and field of view, VTX power, power draw.
Ein Videomodul: analog oder digital, Latenz, Reichweite, Bildqualität, Kamerabreite und Sichtfeld, VTX-Leistung, Leistungsaufnahme.
record VideoDefinition(Identifier id, PartBasics basics, VideoLink link, int latencyMs, int rangeBlocks, double imageQuality, double cameraWidthMm, OptionalDouble cameraFovDeg, int vtxPowerMw, OptionalDouble powerW, List<Integer> vtxLevelsMw) implements PartDefinition
static final int MAX_VTX_LEVELS = 8VideoDefinition(Identifier id, PartBasics basics, VideoLink link, int latencyMs, int rangeBlocks, double imageQuality, double cameraWidthMm, OptionalDouble cameraFovDeg, int vtxPowerMw)VideoDefinition(Identifier id, PartBasics basics, VideoLink link, int latencyMs, int rangeBlocks, double imageQuality, double cameraWidthMm, OptionalDouble cameraFovDeg, int vtxPowerMw, OptionalDouble powerW)static Builder builder(Identifier id)PartKind kind()
VideoDefinition.Builder classKlasse
class Builder
Builder basics(PartBasics value)Builder mass(double grams)Builder link(VideoLink value)Builder latency(int ms)Builder range(int blocks)Builder imageQuality(double value)Builder cameraWidth(double mm)Builder cameraFov(double degrees)Builder vtxPower(int milliwatts)Builder powerWatts(double watts)Builder vtxLevels(int... milliwatts)VideoDefinition build()
VideoLink enumEnum
Video systems: analog and digital.
Videosysteme: analog und digital.
enum VideoLink
ANALOG"analog"DIGITAL"digital"
static Optional<VideoLink> byKey(String key)String key()
api.registry
CreativeEntries interfaceInterface
Extra item stacks for a creative tab.
Zusätzliche Item-Stapel für einen Kreativ-Tab.
interface CreativeEntries
void add(Supplier<? extends Collection<ItemStack>> entries)List<ItemStack> collect()
ExtensionTab interfaceInterface
The own creative tab of an add-on: icon, section order and extra entries.
Der eigene Kreativ-Tab eines Add-ons: Symbol, Reihenfolge der Abschnitte und zusätzliche Einträge.
interface ExtensionTab extends CreativeEntries
String TITLE_KEY = "itemGroup.propwash.extension"String namespace()Identifier tabId()default String nameKey()ExtensionTab icon(Supplier<ItemStack> icon)ExtensionTab icon(Identifier itemId)ExtensionTab order(TabSection... sections)List<TabSection> sections()boolean registered()ItemStack iconStack()List<ItemStack> contents()
LootInjections interfaceInterface
Hooks an add-on loot table into any loot table, on both loaders.
Hängt eine Beutetabelle des Add-ons in jede Beutetabelle, auf beiden Loadern.
interface LootInjections
void inject(ResourceKey<LootTable> target, ResourceKey<LootTable> addonTable)List<ResourceKey<LootTable>> tablesFor(ResourceKey<LootTable> target)
PartItems interfaceInterface
Registers items for parts and looks them up.
Meldet Items für Teile an und schlägt sie nach.
interface PartItems
int registerItems(String namespace)void registerItem(Identifier partId, UnaryOperator<Item.Properties> properties)Optional<Item> item(Identifier partId)Optional<Identifier> partOf(ItemStack stack)ItemStack stack(Identifier partId)default ItemStack stack(Identifier partId, float charge)
TabSection enumEnum
Sections of an add-on creative tab.
Abschnitte eines Add-on-Kreativ-Tabs.
enum TabSection
PRESETSFRAMESSTACKSMOTORSPROPSVIDEOBATTERIESACCESSORIESENTRIES
static Optional<TabSection> of(PartKind kind)static List<TabSection> defaults()static List<TabSection> complete(List<TabSection> wanted)Optional<PartKind> kind()
Types from outsideTypen von außerhalb
These types live outside the API package but appear in its signatures. They are released for add-ons and only get additions (see stability).
Diese Typen liegen außerhalb des API-Pakets, kommen aber in seinen Signaturen vor. Sie sind für Add-ons freigegeben und werden nur ergänzt (siehe Stabilität).
de.lardtom.propwash.guide.scene.ActorSpecused bybenutzt vonclient.PropwashClientApide.lardtom.propwash.guide.scene.Sceneused bybenutzt vonclient.PropwashClientApide.lardtom.propwash.ui.client.config.ConfigTabused bybenutzt vonclient.PropwashClientApi
Everything else outside de.lardtom.propwash.api is internal and may change in any version.
Alles andere außerhalb von de.lardtom.propwash.api ist intern und darf sich in jeder Version ändern.