Skip to content

Commit

Permalink
applying a fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Feb 15, 2025
1 parent 4468944 commit 8f9dcd3
Showing 1 changed file with 4 additions and 63 deletions.
67 changes: 4 additions & 63 deletions test/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,71 +59,12 @@ function convertCommand(c: CommandInfo): Command {
function convertParameter(p: ParameterInfo): Parameter {
return {
text: p.text,
type: ptype[p.type],
type: getParameterName(p.type),
required: p.required,
options: p.options,
};
}

const ptype: Record<ParameterType, string> = {
[ParameterType.animation]: "animation",
[ParameterType.block]: "block",
[ParameterType.blockStates]: "blockStates",
[ParameterType.boolean]: "boolean",
[ParameterType.cameraShakeType]: "cameraShakeType",
[ParameterType.causeType]: "causeType",
[ParameterType.cloneMode]: "cloneMode",
[ParameterType.command]: "command",
[ParameterType.coordinate]: "coordinate",
[ParameterType.difficulty]: "difficulty",
[ParameterType.dimension]: "dimension",
[ParameterType.effect]: "effect",
[ParameterType.entity]: "entity",
[ParameterType.event]: "event",
[ParameterType.executeSubcommand]: "executeSubcommand",
[ParameterType.fillMode]: "fillMode",
[ParameterType.float]: "float",
[ParameterType.function]: "function",
[ParameterType.gamemode]: "gamemode",
[ParameterType.handType]: "handType",
[ParameterType.hudElement]: "hudElement",
[ParameterType.hudVisibility]: "hudVisibility",
[ParameterType.integer_range]: "integer_range",
[ParameterType.integer]: "integer",
[ParameterType.item]: "item",
[ParameterType.jsonItem]: "jsonItem",
[ParameterType.jsonRawText]: "jsonRawText",
[ParameterType.keyword]: "keyword",
[ParameterType.locateFeature]: "locateFeature",
[ParameterType.lootTable]: "lootTable",
[ParameterType.maskMode]: "maskMode",
[ParameterType.message]: "message",
[ParameterType.mirror]: "mirror",
[ParameterType.musicRepeatMode]: "musicRepeatMode",
[ParameterType.objective]: "objective",
[ParameterType.oldBlockMode]: "oldBlockMode",
[ParameterType.operation]: "operation",
[ParameterType.particle]: "particle",
[ParameterType.permission]: "permission",
[ParameterType.permissionState]: "permissionState",
[ParameterType.recipe]: "recipe",
[ParameterType.replaceMode]: "replaceMode",
[ParameterType.ridefillMode]: "ridefillMode",
[ParameterType.rideRules]: "rideRules",
[ParameterType.rotation]: "rotation",
[ParameterType.saveMode]: "saveMode",
[ParameterType.scanMode]: "scanMode",
[ParameterType.selector]: "selector",
[ParameterType.slotID]: "slotID",
[ParameterType.slotType]: "slotType",
[ParameterType.sound]: "sound",
[ParameterType.string]: "string",
[ParameterType.structure]: "structure",
[ParameterType.structureAnimationMode]: "structureAnimationMode",
[ParameterType.tag]: "tag",
[ParameterType.teleportRules]: "teleportRules",
[ParameterType.tickingarea]: "tickingarea",
[ParameterType.time]: "time",
[ParameterType.unknown]: "unknown",
[ParameterType.xp]: "xp",
};
function getParameterName(p: ParameterType): string {
return ParameterType[p];
}

0 comments on commit 8f9dcd3

Please sign in to comment.