Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiworld and JScripting Port #2646

Merged
merged 72 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a23025b
Update ForgeEssentialsCommandBuilder.java
maximuslotro Aug 28, 2023
438ed6e
Multiworld Module Port Part 1
maximuslotro Aug 28, 2023
dcbe476
Multiworld Module Port Part 2
maximuslotro Aug 28, 2023
01d679c
Multiworld Module Port Part 3
maximuslotro Aug 29, 2023
9b3f611
Remove UnNeeded getter
maximuslotro Aug 29, 2023
dfc3f14
Fix incorrect resource naming
maximuslotro Aug 29, 2023
e85f284
Port Multiworld Teleport command
maximuslotro Aug 29, 2023
600361b
Multiworld Module Port Part 4
maximuslotro Aug 30, 2023
e17a419
Multiworld Module Port Part 5
maximuslotro Aug 31, 2023
92afa99
Multiworld Module Port Part 6
maximuslotro Aug 31, 2023
fe15a76
Multiworld Module Port Part 7
maximuslotro Aug 31, 2023
ae1fb8b
Multiworld Module Port Part 8
maximuslotro Aug 31, 2023
b696db0
fix having null handler by default
maximuslotro Sep 4, 2023
6c96e56
Add more info to mw command
maximuslotro Sep 4, 2023
53de651
Fix calling teleport twice
maximuslotro Sep 4, 2023
6c67bf5
Fix client crash on non-mc dimensionType levels
maximuslotro Sep 4, 2023
1db8bcf
Add warning and confirmation to mw command
maximuslotro Sep 4, 2023
b101342
Fix broken command names if aliases are disabled
maximuslotro Sep 5, 2023
711c813
Multiworld Module Port Part 9
maximuslotro Sep 5, 2023
8408026
Fix error catching, and MiddleEarth chunkgenerator
maximuslotro Sep 5, 2023
160c9f4
Add alt MiddleEarth biome option
maximuslotro Sep 5, 2023
b7fa35d
Add Multiworld deleting
maximuslotro Sep 5, 2023
4dff66f
Fix alias being sorted if aliases are disabled
maximuslotro Sep 5, 2023
b768f8b
Fix dependence on other modules being enabled
maximuslotro Sep 7, 2023
060ea58
Fix Major bug with command redirects
maximuslotro Sep 7, 2023
3e282bf
Refactor command reg classes location and names
maximuslotro Sep 7, 2023
1b0defd
Add ability to overwrite conflicting commands
maximuslotro Sep 7, 2023
21d607d
Facelift old module version system
maximuslotro Sep 7, 2023
b1827c0
Fix some command overwriting bugs
maximuslotro Sep 7, 2023
a2c6cf7
Separate provider classes
maximuslotro Sep 9, 2023
9e72e38
Add Minecraft Large Biome Provider
maximuslotro Sep 9, 2023
f7d8500
Fix failing to delete dimensions
maximuslotro Sep 10, 2023
714def8
Add flat world generator
maximuslotro Sep 10, 2023
6495428
Fix not finding any remote annotations
maximuslotro Sep 11, 2023
e2cb7a4
Move mw BiomeProviders to annotation based scanning
maximuslotro Sep 11, 2023
5640ea5
Move mw ChunkGenProviders to annotation based scanning
maximuslotro Sep 11, 2023
686d9b8
Clean Unneeded stream iterating
maximuslotro Sep 11, 2023
6bf2e8b
Fix not finding any FEMob annotations
maximuslotro Sep 11, 2023
2cee61d
Merge branch '1.16.5/develop' into 1.16.5/Multiworld-ReWrite
spacebuilder2020 Sep 12, 2023
040ac74
Add ability to register new commands with scripting
spacebuilder2020 Sep 12, 2023
3165087
Fix Type for getAllPlayers
spacebuilder2020 Sep 12, 2023
015331f
Cleanup old code
maximuslotro Sep 15, 2023
b2d8916
1.16.5 Scripting updates
maximuslotro Sep 16, 2023
e8e7ee9
Fix tsd generator failing to find utils sourceSet
maximuslotro Sep 16, 2023
f994d9a
Fix skipping files ending with d.ts
maximuslotro Sep 16, 2023
5a11760
Fix tsd generator weird crash
maximuslotro Sep 16, 2023
839a7e6
Fix creating modules when checking preconditions
maximuslotro Sep 16, 2023
3452794
Fix nullPointerException when reg JScript commands
maximuslotro Sep 16, 2023
a36c416
Fix command registration and non static or nullable things
maximuslotro Sep 16, 2023
dca4473
Fix a command naming error
maximuslotro Sep 16, 2023
46ef49c
Update scripting *.d.ts and copy times
maximuslotro Sep 16, 2023
324a320
Add BumbleZone providers and fix method name
maximuslotro Sep 20, 2023
9bb8d09
Fix Null Generator Error
maximuslotro Sep 20, 2023
794c368
Add world presets to multiworld creation
maximuslotro Sep 21, 2023
348f752
Add multiworld delete confirmation
maximuslotro Sep 21, 2023
3763d1e
Add Command Node builder Structure to JScripting
maximuslotro Sep 22, 2023
32eb7b1
Add command argument types to JScripting
maximuslotro Sep 23, 2023
41e6e43
New JScripting command tree generator
maximuslotro Sep 23, 2023
604b755
Tweek some things
maximuslotro Sep 23, 2023
557ef20
Try fix null exception
maximuslotro Sep 23, 2023
6e5c8f7
Debugging loading object arrays
maximuslotro Sep 23, 2023
7df8744
Fix bugs with parsing Bindings for Nodes
maximuslotro Sep 23, 2023
39960c7
Add support for infinite sub-commands
maximuslotro Sep 23, 2023
29d3385
Add check for double arguments
maximuslotro Sep 23, 2023
d79590e
Merge branch '1.16.5/Multiworld-ReWrite' into 1.16.5/scripting-fix
spacebuilder2020 Sep 24, 2023
e4fad75
Merge pull request #2645 from ForgeEssentials/1.16.5/scripting-fix
spacebuilder2020 Sep 24, 2023
b812876
use runtime names for class generation
maximuslotro Sep 25, 2023
b7a5205
Fix MAJOR scripting bug with infinite recursive function
maximuslotro Sep 25, 2023
ebdc9e4
Catch rare moduleLoading error
maximuslotro Sep 27, 2023
90e4556
Set release type to alpha from beta
maximuslotro Sep 27, 2023
ff50d79
Set BuildInfo release type on build
maximuslotro Sep 27, 2023
68191d1
Add catch for module loading
maximuslotro Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if (System.getenv("BUILD_NUMBER") != null) {
}

ext.set 'changelog', System.getenv("CHANGE_LOG")
ext.set 'releaseType', 'alpha'
ext.set 'releaseType', 'beta'

// Get commit hash

Expand Down Expand Up @@ -357,7 +357,7 @@ sourceSets {
// Configure utils tokens
task processSource(type: Sync) {
from sourceSets.utils.java
filter(ReplaceTokens, tokens: ['_MCVERSION_':project.minecraftVersion, '_BASEVERSION_': project.mod_base, '_MAJORVERSION_': project.mod_major])
filter(ReplaceTokens, tokens: ['_MCVERSION_':project.minecraftVersion, '_BASEVERSION_': project.mod_base, '_MAJORVERSION_': project.mod_major, '_RELEASETYPE_': project.releaseType])
into "$buildDir/src"
}

Expand Down Expand Up @@ -429,10 +429,10 @@ compileClientJava {

// JavaExec task for generating tsd
// Calls the main class for the TSD generator since that is working
/*

task tsd(type: JavaExec) {
dependsOn "classes"
classpath = project.sourceSets.test.compileClasspath
classpath = files(project.sourceSets.test.compileClasspath, project.sourceSets.main.compileClasspath)
mainClass = "com.forgeessentials.jscripting.TsdGenerator"
doLast {
copy {
Expand All @@ -443,7 +443,7 @@ task tsd(type: JavaExec) {
into "build/resources/main/com/forgeessentials/jscripting"
}
}
}*/
}

/************************************************************
* Configure client jar
Expand Down Expand Up @@ -498,7 +498,7 @@ jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
dependsOn clientJar
dependsOn shadowJar
//dependsOn "tsd"
dependsOn "tsd"
archiveClassifier = "server"
archiveAppendix = project.minecraftVersion

Expand Down
175 changes: 104 additions & 71 deletions jscripting/fe.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,49 @@ declare namespace fe {
}

class CommandArgs extends Wrapper {
sender: mc.ICommandSender;
player: mc.entity.EntityPlayer;
sender: mc.CommandSource;
player: mc.entity.PlayerEntity;
ident: UserIdent;
isTabCompletion: boolean;
toArray(): string[];
toString(): string;
confirm(message: string, ...args: any[]): void;
notify(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
size(): int;
remove(): string;
peek(): string;
get(index: int): string;
getAllArgs(): string;
removeAllArgs(): string;
isEmpty(): boolean;
context: com.mojang.brigadier.context.CommandContext;
params: string;
hasPlayer(): boolean;
parsePlayer(): UserIdent;
parsePlayer(mustExist: boolean): UserIdent;
parsePlayer(mustExist: boolean, mustBeOnline: boolean): UserIdent;
parseItem(): mc.item.Item;
parseBlock(): mc.world.Block;
parsePermission(): string;
checkPermission(perm: string): void;
confirm(message: string, args: any[]): void;
notify(message: string, args: any[]): void;
warn(message: string, args: any[]): void;
error(message: string, args: any[]): void;
parsePlayer(name: string): UserIdent;
parsePlayer(name: string, mustExist: boolean): UserIdent;
parsePlayer(name: string, mustExist: boolean, mustBeOnline: boolean): UserIdent;
parseItem(argumentName: string): mc.item.Item;
parseBlock(argumentName: string): mc.world.Block;
parseWorld(argumentName: string): mc.world.ServerWorld;
hasPermission(perm: string): boolean;
tabComplete(...completionList: string[]): void;
tabCompleteWord(completion: string): void;
parseWorld(): mc.world.WorldServer;
parseInt(): int;
parseInt(min: int, max: int): int;
parseLong(): long;
parseDouble(): double;
parseBoolean(): boolean;
parseTimeReadable(): long;
checkTabCompletion(): void;
requirePlayer(): void;
parseTimeReadable(time: string): long;
getSenderPoint(): WorldPoint;
needsPlayer(): void;
clear(): void;
getArgumentBoolean(argumentName: string): boolean;
getArgumentDouble(argumentName: string): double;
getArgumentFloat(argumentName: string): float;
getArgumentInteger(argumentName: string): int;
getArgumentLong(argumentName: string): long;
getArgumentString(argumentName: string): string;
}

class CommandOptions {
name: string;
usage?: string;
permission?: string;
opOnly?: boolean;
executesMethod: boolean;
executionParams?: string;
/**
* Don't EVER USE THIS! INTERNAL USE ONLY!
*/
listsSubNodes?: java.util.List;
/**
* Don't implement this directly, instead use subNode[anyLetterNumber] (ex. subNode4, subNodeXYZ)
*/
subNode?: any;
processCommand: CommandCallback;
tabComplete?: CommandCallback;
constructor();
}

Expand All @@ -108,28 +102,15 @@ declare namespace fe {
/**
* Adds a CoRoutine callback
*/
AddCoRoutine(count: int, tickStep: int, method: string, sender: mc.ICommandSender): void;
AddCoRoutine(count: int, tickStep: int, method: string, sender: mc.ICommandSender, extraData: any): void;
/**
* Creates a custom inventory from an Itemstack list
*/
createCustomInventory(name: string, hasCustom: boolean, stacks: mc.item.ItemStack[]): mc.item.Inventory;
/**
* Clones an existing inventory
*/
cloneInventory(name: string, hasCustom: boolean, inventory: mc.item.Inventory, size: int): mc.item.Inventory;
/**
* Gets a Special Interaction Object that is designed to be used as a menu
* WARNING: Do not close the screen during the callback. This causes a desync!
*/
getMenuChest(name: string, displayName: string, inventory: mc.item.Inventory, callbackMethod: string): mc.item.InteractionObject;
AddCoRoutine(count: int, tickStep: int, method: string, sender: mc.CommandSource): void;
AddCoRoutine(count: int, tickStep: int, method: string, sender: mc.CommandSource, extraData: any): void;
}

class Permissions {
static checkBooleanPermission(permissionValue: string): boolean;
static getPermission(ident: UserIdent, point: WorldPoint, area: WorldArea, groups: string[], permissionNode: string, isProperty: boolean): string;
static checkPermission(player: mc.entity.EntityPlayer, permissionNode: string): boolean;
static getPermissionProperty(player: mc.entity.EntityPlayer, permissionNode: string): string;
static checkPermission(player: mc.entity.PlayerEntity, permissionNode: string): boolean;
static getPermissionProperty(player: mc.entity.PlayerEntity, permissionNode: string): string;
static registerPermissionDescription(permissionNode: string, description: string): void;
static getPermissionDescription(permissionNode: string): string;
static registerPermission(permissionNode: string, level: net.minecraftforge.server.permission.DefaultPermissionLevel, description: string): void;
Expand Down Expand Up @@ -192,14 +173,12 @@ declare namespace fe {
setWandEnabled(wandEnabled: boolean): void;
getWandID(): string;
setWandID(wandID: string): void;
getWandDmg(): int;
setWandDmg(wandDmg: int): void;
getSel1(): Point;
getSel2(): Point;
getSelDim(): int;
getSelDim(): string;
setSel1(point: Point): void;
setSel2(point: Point): void;
setSelDim(dimension: int): void;
setSelDim(dimension: string): void;
getLastTeleportOrigin(): WarpPoint;
setLastTeleportOrigin(lastTeleportStart: WarpPoint): void;
getLastDeathLocation(): WarpPoint;
Expand Down Expand Up @@ -233,7 +212,7 @@ declare namespace fe {
createGroup(name: string): boolean;
getZonesAt(worldPoint: WorldPoint): java.util.List;
getZoneAt(worldPoint: WorldPoint): Zone;
getPlayerGroups(player: mc.entity.EntityPlayer): java.util.List;
getPlayerGroups(player: mc.entity.PlayerEntity): java.util.List;
addZone(zoneName: string, area: WorldArea): Zone;
removeZone(zone: Zone): void;
}
Expand All @@ -248,9 +227,9 @@ declare namespace fe {
getUuid(): java.util.UUID;
getUsername(): string;
getUsernameOrUuid(): string;
getPlayer(): mc.entity.EntityPlayer;
getFakePlayer(): mc.entity.EntityPlayer;
getFakePlayer(world: mc.world.WorldServer): mc.entity.EntityPlayer;
getPlayer(): mc.entity.PlayerEntity;
getFakePlayer(): mc.entity.PlayerEntity;
getFakePlayer(world: mc.world.ServerWorld): mc.entity.PlayerEntity;
toSerializeString(): string;
toString(): string;
hashCode(): int;
Expand All @@ -277,11 +256,11 @@ declare namespace fe {
getX(): double;
getY(): double;
getZ(): double;
getDimension(): int;
getDimension(): string;
getPitch(): float;
getYaw(): float;
set(dim: int, xd: double, yd: double, zd: double, pitch: float, yaw: float): void;
setDimension(dim: int): void;
set(dim: string, xd: double, yd: double, zd: double, pitch: float, yaw: float): void;
setDimension(dim: string): void;
setX(value: double): void;
setY(value: double): void;
setZ(value: double): void;
Expand All @@ -295,14 +274,14 @@ declare namespace fe {
}

class WorldArea extends mc.AreaBase {
constructor(dim: int, p1: Point, p2: Point);
getDimension(): int;
constructor(dim: string, p1: Point, p2: Point);
getDimension(): string;
}

class WorldPoint extends Point {
constructor(dim: int, x: int, y: int, z: int);
getDimension(): int;
setDimension(dim: int): void;
constructor(dim: string, x: int, y: int, z: int);
getDimension(): string;
setDimension(dim: string): void;
setX(x: int): WorldPoint;
setY(y: int): WorldPoint;
setZ(z: int): WorldPoint;
Expand All @@ -311,7 +290,7 @@ declare namespace fe {
class Zone extends Wrapper {
getId(): int;
getName(): string;
isPlayerInZone(player: mc.entity.EntityPlayer): boolean;
isPlayerInZone(player: mc.entity.PlayerEntity): boolean;
isInZone(point: WorldPoint): boolean;
isInZone(point: WorldArea): boolean;
isPartOfZone(point: WorldArea): boolean;
Expand All @@ -321,6 +300,60 @@ declare namespace fe {

}

declare namespace fe.command {

class ArgumentType extends java.lang.Enum {
static BOOLEAN: ArgumentType;
static DOUBLE: ArgumentType;
static FLOAT: ArgumentType;
static INTEGER: ArgumentType;
static LONG: ArgumentType;
static STRINGWORD: ArgumentType;
static STRINGQUOTE: ArgumentType;
static STRINGGREEDY: ArgumentType;
static values(): ArgumentType[];
static valueOf(name: string): ArgumentType;
static getType(type: ArgumentType): com.mojang.brigadier.arguments.ArgumentType;
}

class CommandNodeArgument {
executesMethod: boolean;
executionParams?: string;
argumentName: string;
argumentType: JsArgumentType;
constructor();
}

class CommandNodeLiteral {
executesMethod: boolean;
executionParams?: string;
literal: string;
constructor();
}

class CommandNodeWrapper {
/**
* Don't EVER USE THIS! INTERNAL USE ONLY!
*/
listsChildNodes?: java.util.List;
/**
* Don't implement this directly, instead use childNode[anyLetterNumber] (ex. childNode4, childNodeXYZ)
*/
childNode?: any;
type: JsNodeType;
containedNode: JsCommandNodeLiteral/JsCommandNodeArgument;
constructor();
}

class NodeType extends java.lang.Enum {
static LITERAL: NodeType;
static ARGUMENT: NodeType;
static values(): NodeType[];
static valueOf(name: string): NodeType;
}

}

declare namespace fe.event.entity.player {

class FEPlayerEvent extends mc.event.entity.player.PlayerEvent {
Expand Down