Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.lua
node_modules
*.d.ts
node_modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";

/** @noSelf **/
export interface DisplayPedestal extends IPeripheral {
getItem(): ItemDetail | null;
setItem(id: string, name?: string, nbtData?: string): Result;
isLabelRendered(): boolean;
setLabelRendered(value: boolean): void;
isItemRendered(): boolean;
setItemRendered(value: boolean): void;
}

export const displayPedestalProvider = new IPeripheralProvider<DisplayPedestal>(
"display_pedestal"
);
25 changes: 25 additions & 0 deletions projects/typed-peripheral-unlimitedperipheralworks/entityLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";
import { ExtendedInventoryAPI } from "@siredvin/typed-peripheral-api/inventory_extended";
import { FluidStorageAPI } from "@siredvin/typed-peripheral-api/fluid_storage";
import { ItemStorageAPI } from "@siredvin/typed-peripheral-api/item_storage";
import { EntityDetail } from "./types";
import {
AutomobilityAutomobileAPI,
ManaAndArtificeConstructAPI,
} from "./integrations/entityLink";

/** @noSelf **/
export interface EntityLink
extends IPeripheral,
Partial<ManaAndArtificeConstructAPI>,
Partial<AutomobilityAutomobileAPI>,
Partial<ExtendedInventoryAPI>,
Partial<ItemStorageAPI>,
Partial<FluidStorageAPI> {
isEntityFound(): boolean;
inspect(): EntityDetail | null;
}

export const entityLinkProvider = new IPeripheralProvider<EntityLink>(
"entity_link"
);

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration";
import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";
import { BlockState, Fallible, Position } from "./types";

export type Vector3 = [number, number, number];
export type Quaternion = [number, number, number, number];
export type DisplayOptions = {
brightness?: number;
glow_color_override?: number;
interpolation_duration?: number;
start_interpolation?: number;
height?: number;
width?: number;
shadow_radius?: number;
shadow_strength?: number;
view_range?: number;
billboard?: string;
transformation?: {
scale?: Vector3;
translation?: Vector3;
left_rotation?: Quaternion;
right_rotation?: Quaternion;
};
};
export type TextDisplayOptions = DisplayOptions & {
line_width?: number;
background?: number;
shadow?: boolean;
see_through?: boolean;
default_background?: boolean;
text_opacity?: number;
alignment?: string;
};
export type ItemDisplayOptions = DisplayOptions & { item_display?: string };

/** @noSelf **/
export interface HologramProjector
extends ConfigurationAPI<{ entityLimit: number; distanceLimit: number }> {
item(item: object, options?: ItemDisplayOptions): Fallible<string>;
block(blockState: BlockState, options?: DisplayOptions): Fallible<string>;
text(text: object, options?: TextDisplayOptions): Fallible<string>;
destroy(uuid: string): Result;
move(uuid: string, position: Position): Result;
rotate(uuid: string, xRot?: number, yRot?: number): Result;
list(mode: "owned" | "around"): Fallible<LuaTable<string, object>>;
update(uuid: string, content?: object, options?: DisplayOptions): Result;
ride(riderUUID: string, mountUUID: string): Result;
unmount(riderUUID: string): Result;
}

export const hologramProjectorProvider =
new IPeripheralProvider<HologramProjector>("hologram_projector");

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration";
import { FluidDetail, IPeripheralProvider } from "@siredvin/typed-peripheral-base";
import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";

/** @noSelf **/
export interface InformativeRegistry extends ConfigurationAPI<object> {
Expand All @@ -12,14 +12,27 @@ export interface InformativeRegistry extends ConfigurationAPI<object> {
| "itemTags"
| "fluidTags"
| "blockTags"
| "entityTypeTags"
| "mods"
| "entity"
): string[];
describe(
listName: "itemTags" | "blockTags" | "fluidTags",
listName: "itemTags" | "blockTags" | "fluidTags" | "entityTypeTags",
tag: string
): string[];
describe(listName: "item", id: string): ItemDetail;
describe(listName: "fluid", id: string): FluidDetail;
describe(listName: "list" | "block", id: string): LuaTable;
): string[] | null;
describe(
listName: "item",
id: string
): (Omit<ItemDetail, "count"> & { registryID: string }) | null;
describe(
listName: "fluid",
id: string
): { name: string; registryID: string } | null;
describe(listName: "list", id: string): string | null;
describe(
listName: "block" | "mods" | "entity",
id: string
): LuaTable | null;
}

export const informativeRegistryProvider =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Fallible } from "../types";

export type AE2CraftingCPU = {
name?: string;
capacity: number;
storage: number;
isBusy: boolean;
};
export type AE2Pattern = { inputs: object[]; outputs: object[] };
export type AE2Crafting = {
target: object;
amount: number;
progress: number;
CPU?: string;
};

/** @noSelf **/
export interface AE2NetworkAPI extends IPeripheral {
getAverageEnergyDemand(): number;
getAverageEnergyIncome(): number;
getChannelEnergyDemand(): number;
getChannelInformation(): { maxChannels?: number; usedChannels?: number };
getCraftingCPUs(): AE2CraftingCPU[];
getCraftableItems(): (Omit<ItemDetail, "count"> & { registryID: string })[];
getCraftableFluids(): { name: string }[];
getPatternsFor(mode: "item" | "fluid", id: string): AE2Pattern[];
getActiveCraftings(): Fallible<AE2Crafting[]>;
scheduleCrafting(
mode: "item" | "fluid",
id: string,
amount?: number,
targetCPU?: string
): LuaMultiReturn<
| [true]
| [null, string]
| [false, string, LuaTable<string, number>]
>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { EntityDetail } from "../types";

/** @noSelf **/
export interface ArsNouveauMobJar extends IPeripheral {
inspect(): { entity: EntityDetail } | object;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @noSelf **/
export interface CreateScrollOptionAPI extends IPeripheral {
getScrollValue(): number;
setScrollValue(value: number): void;
}

/** @noSelf **/
export interface CreateLinearActuatorAPI extends IPeripheral {
inspect(): { movementSpeed: number; isRunning: boolean };
}

/** @noSelf **/
export interface CreateBlazeBurnerAPI extends IPeripheral {
inspect(): { fuelType: string | null; remainingBurnTime: number };
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @noSelf **/
export declare interface CreateFilterableAPI extends IPeripheral {
getFilterName(): string;
setFilterItem(id: string);
clearFilterItem();
getFilterName(): string | null;
setFilterItem(id: string): Result;
clearFilterItem(): Result;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @noSelf **/
export interface DeepResonanceCrystal extends IPeripheral {
inspect(): {
strength: number;
efficiency: number;
power: number;
purity: number;
glowing: boolean;
};
}

/** @noSelf **/
export interface DeepResonanceGenerator extends IPeripheral {
inspect(): { energy: number; lastRfPerTick: number; isActive: boolean };
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { IPeripheralProvider } from "@siredvin/typed-peripheral-base";
import { EntityDetail } from "../types";

/** @noSelf **/
export interface EasyTrader extends IPeripheral {
hasVillager(): boolean;
inspect(): EntityDetail | null;
}

/** @noSelf **/
export interface EasyAutoTrader extends EasyTrader {
getSelectedOffer(): number;
setSelectedOffer(index: number): Result;
}

export const easyTraderProvider = new IPeripheralProvider<EasyTrader>(
"easy_trader"
);
export const easyAutoTraderProvider = new IPeripheralProvider<EasyAutoTrader>(
"easy_auto_trader"
);

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Position } from "../types";

/** @noSelf **/
export interface ManaAndArtificeConstructAPI extends IPeripheral {
move(ignored: any, position: Position): void;
store(ignored: any, position: Position, direction?: string): void;
take(
ignored: any,
position: Position,
direction: string | undefined,
item: string,
amount?: number
): void;
listCommands(): LuaTable<string, string>;
diagnose(): string[];
getCommand(): {
name: string;
isFinished: boolean;
isSuccess: boolean;
isStart: boolean;
};
}

/** @noSelf **/
export interface AutomobilityAutomobileAPI extends IPeripheral {
rotate(delta: number): void;
boost(power: number, time: number): void;
}
Loading
Loading