Skip to content

Commit c5d5f1b

Browse files
committed
Updated to support Minecraft 1.17
1 parent 16bf231 commit c5d5f1b

File tree

655 files changed

+12314
-1444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

655 files changed

+12314
-1444
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ScriptableMC-TypeScript Example & Libraries
2-
[![docs](https://img.shields.io/badge/ScriptableMC--Engine-v1.3.0-blue?style=for-the-badge)](https://github.com/astorks/ScriptableMC-Engine)
2+
[![docs](https://img.shields.io/badge/ScriptableMC--Engine-v1.17.0-blue?style=for-the-badge)](https://github.com/astorks/ScriptableMC-Engine)
33
[![docs](https://img.shields.io/badge/Read_the_Docs-gray?style=for-the-badge)](https://astorks.github.io/ScriptableMC-TypeScript)
44
## Getting Started
55
- Install [NodeJS/NPM](https://nodejs.org/en/download/) or if you're on linux/macos you can install [GraalVM-CE](https://github.com/graalvm/graalvm-ce-builds/releases/latest) which includes a NodeJS runtime

src/TestPlugin/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default class TestPlugin extends JsPlugin {
9898
onPlayerJoin(listener: any, event: PlayerJoinEvent) {
9999
let player = event.getPlayer();
100100

101-
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA).getParts());
101+
//player.spigot().sendMessage(new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA).getParts());
102102

103103
if(CONFIG.fireworkOnJoin.enabled && player.hasPermission(CONFIG.fireworkOnJoin.requiredPermission)) {
104104
let fw = player.getWorld().spawnEntity(player.getLocation().add(0, 10, 0), EntityType.FIREWORK) as Firework;

src/lib/com/google/common/collect/Multiset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default interface Multiset {
2626
spliterator(): any;
2727
stream(): any;
2828
toArray(): Array<any>;
29-
toArray(generator: any): Array<any>;
3029
toArray(arg0: Array<any>): Array<any>;
30+
toArray(generator: any): Array<any>;
3131
}
3232

3333
export default class Multiset {

src/lib/com/google/common/io/ByteStreams.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ export default class ByteStreams {
3030
return ByteStreams.$javaClass.limit(...args);
3131
}
3232

33-
public static newDataInput(bytes: Array<number>): ByteArrayDataInput;
3433
public static newDataInput(byteArrayInputStream: ByteArrayInputStream): ByteArrayDataInput;
34+
public static newDataInput(bytes: Array<number>): ByteArrayDataInput;
3535
public static newDataInput(bytes: Array<number>, start: number): ByteArrayDataInput;
3636
public static newDataInput(...args: any[]): any {
3737
return ByteStreams.$javaClass.newDataInput(...args);
3838
}
3939

4040
public static newDataOutput(): ByteArrayDataOutput;
41-
public static newDataOutput(byteArrayOutputSteam: ByteArrayOutputStream): ByteArrayDataOutput;
4241
public static newDataOutput(size: number): ByteArrayDataOutput;
42+
public static newDataOutput(byteArrayOutputSteam: ByteArrayOutputStream): ByteArrayDataOutput;
4343
public static newDataOutput(...args: any[]): any {
4444
return ByteStreams.$javaClass.newDataOutput(...args);
4545
}

src/lib/com/pixlfox/scriptablemc/core/ScriptablePluginContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import Version from '../../../../com/smc/version/Version.js'
1717
export default interface ScriptablePluginContext extends Listener {
1818
disable(): void;
1919
enable(): void;
20-
getBukkitServiceRegistration(className: string): any;
2120
getBukkitServiceRegistration(_class: any): any;
21+
getBukkitServiceRegistration(className: string): any;
2222
getCommands(): Array<PluginCommand>;
2323
getEngine(): ScriptablePluginEngine;
2424
getInventoryManager(): InventoryManager;
@@ -36,8 +36,8 @@ export default interface ScriptablePluginContext extends Listener {
3636
registerEvent(eventClass: any, executor: EventExecutor): void;
3737
registerIncomingPluginChannel(channelName: string, listener: PluginMessageListener): PluginMessageListenerRegistration;
3838
registerOutgoingPluginChannel(channel: string): void;
39-
setPlaceholders(player: OfflinePlayer, placeholderText: string): string;
4039
setPlaceholders(player: Player, placeholderText: string): string;
40+
setPlaceholders(player: OfflinePlayer, placeholderText: string): string;
4141
unregisterCommand(command: PluginCommand): void;
4242
unregisterIncomingPluginChannel(channel: string): void;
4343
unregisterOutgoingPluginChannel(channel: string): void;

src/lib/com/pixlfox/scriptablemc/core/ScriptablePluginEngine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export default interface ScriptablePluginEngine {
1616
eval(source: any): any;
1717
eval(source: string): any;
1818
evalCommandSender(source: string, sender: CommandSender): any;
19-
evalFile(filePath: string): any;
2019
evalFile(scriptFile: File): any;
20+
evalFile(filePath: string): any;
2121
getBootstrapPlugin(): ScriptEngineMain;
2222
getConfig(): ScriptEngineConfig;
2323
getDebugEnabled(): boolean;
@@ -27,8 +27,8 @@ export default interface ScriptablePluginEngine {
2727
getInventoryManager(): InventoryManager;
2828
getLanguageFileExtension(): string;
2929
getLanguageName(): string;
30-
getPluginInstance(pluginContext: ScriptablePluginContext): any;
3130
getPluginInstance(_name: string): any;
31+
getPluginInstance(pluginContext: ScriptablePluginContext): any;
3232
getPluginVersion(): Version;
3333
getScriptablePlugins(): Array<ScriptablePluginContext>;
3434
getStartupErrors(): Array<any>;

src/lib/com/smc/nbtapi/NBTCompound.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ItemStack from '../../../org/bukkit/inventory/ItemStack.js'
33
import NBTCompoundList from './NBTCompoundList.js'
44
import NBTList from './NBTList.js'
55
import NBTType from './NBTType.js'
6+
import OutputStream from '../../../java/io/OutputStream.js'
67

78
export default interface NBTCompound {
89
addCompound(_name: string): NBTCompound;
@@ -14,20 +15,26 @@ export default interface NBTCompound {
1415
getCompound(_name: string): NBTCompound;
1516
getCompoundList(_name: string): NBTCompoundList;
1617
getDouble(key: string): number;
18+
getDoubleList(_name: string): NBTList;
1719
getFloat(key: string): number;
20+
getFloatList(_name: string): NBTList;
1821
getIntArray(key: string): Array<number>;
1922
getInteger(key: string): any;
2023
getIntegerList(_name: string): NBTList;
2124
getItemStack(key: string): ItemStack;
2225
getKeys(): any;
26+
getListType(_name: string): NBTType;
2327
getLong(key: string): number;
28+
getLongList(_name: string): NBTList;
2429
getName(): string;
2530
getObject(key: string, type: any): any;
31+
getOrCreateCompound(_name: string): NBTCompound;
2632
getParent(): NBTCompound;
2733
getShort(key: string): number;
2834
getString(key: string): string;
2935
getStringList(_name: string): NBTList;
3036
getType(_name: string): NBTType;
37+
getUUID(key: string): string;
3138
hasKey(key: string): boolean;
3239
mergeCompound(comp: NBTCompound): void;
3340
removeKey(key: string): void;
@@ -43,6 +50,8 @@ export default interface NBTCompound {
4350
setObject(key: string, value: any): void;
4451
setShort(key: string, value: number): void;
4552
setString(key: string, value: string): void;
53+
setUUID(key: string, value: string): void;
54+
writeCompound(stream: OutputStream): void;
4655
}
4756

4857
export default class NBTCompound {

src/lib/com/smc/nbtapi/NBTCompoundList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default interface NBTCompoundList extends NBTList {
2929
listIterator(): any;
3030
listIterator(startIndex: number): any;
3131
parallelStream(): any;
32-
remove(o: any): boolean;
3332
remove(i: number): any;
33+
remove(o: any): boolean;
3434
removeAll(c: Array<any>): boolean;
3535
removeIf(filter: any): boolean;
3636
replaceAll(operator: any): void;

src/lib/com/smc/nbtapi/NBTContainer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
declare var Java: any;
2+
import InputStream from '../../../java/io/InputStream.js'
23
import ItemStack from '../../../org/bukkit/inventory/ItemStack.js'
34
import NBTCompound from './NBTCompound.js'
45
import NBTCompoundList from './NBTCompoundList.js'
56
import NBTList from './NBTList.js'
67
import NBTType from './NBTType.js'
8+
import OutputStream from '../../../java/io/OutputStream.js'
79

810
export default interface NBTContainer extends NBTCompound {
911
addCompound(_name: string): NBTCompound;
@@ -15,20 +17,26 @@ export default interface NBTContainer extends NBTCompound {
1517
getCompound(_name: string): NBTCompound;
1618
getCompoundList(_name: string): NBTCompoundList;
1719
getDouble(key: string): number;
20+
getDoubleList(_name: string): NBTList;
1821
getFloat(key: string): number;
22+
getFloatList(_name: string): NBTList;
1923
getIntArray(key: string): Array<number>;
2024
getInteger(key: string): any;
2125
getIntegerList(_name: string): NBTList;
2226
getItemStack(key: string): ItemStack;
2327
getKeys(): any;
28+
getListType(_name: string): NBTType;
2429
getLong(key: string): number;
30+
getLongList(_name: string): NBTList;
2531
getName(): string;
2632
getObject(key: string, type: any): any;
33+
getOrCreateCompound(_name: string): NBTCompound;
2734
getParent(): NBTCompound;
2835
getShort(key: string): number;
2936
getString(key: string): string;
3037
getStringList(_name: string): NBTList;
3138
getType(_name: string): NBTType;
39+
getUUID(key: string): string;
3240
hasKey(key: string): boolean;
3341
mergeCompound(comp: NBTCompound): void;
3442
removeKey(key: string): void;
@@ -45,6 +53,8 @@ export default interface NBTContainer extends NBTCompound {
4553
setObject(key: string, value: any): void;
4654
setShort(key: string, value: number): void;
4755
setString(key: string, value: string): void;
56+
setUUID(key: string, value: string): void;
57+
writeCompound(stream: OutputStream): void;
4858
}
4959

5060
export default class NBTContainer {
@@ -54,6 +64,7 @@ export default class NBTContainer {
5464

5565
constructor();
5666
constructor(nbtString: string);
67+
constructor(inputsteam: InputStream);
5768
constructor(nbt: any);
5869
constructor(...args: any[]) {
5970
return new NBTContainer.$javaClass(...args);

src/lib/com/smc/nbtapi/NBTEntity.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import NBTCompound from './NBTCompound.js'
55
import NBTCompoundList from './NBTCompoundList.js'
66
import NBTList from './NBTList.js'
77
import NBTType from './NBTType.js'
8+
import OutputStream from '../../../java/io/OutputStream.js'
89

910
export default interface NBTEntity extends NBTCompound {
1011
addCompound(_name: string): NBTCompound;
@@ -16,20 +17,27 @@ export default interface NBTEntity extends NBTCompound {
1617
getCompound(_name: string): NBTCompound;
1718
getCompoundList(_name: string): NBTCompoundList;
1819
getDouble(key: string): number;
20+
getDoubleList(_name: string): NBTList;
1921
getFloat(key: string): number;
22+
getFloatList(_name: string): NBTList;
2023
getIntArray(key: string): Array<number>;
2124
getInteger(key: string): any;
2225
getIntegerList(_name: string): NBTList;
2326
getItemStack(key: string): ItemStack;
2427
getKeys(): any;
28+
getListType(_name: string): NBTType;
2529
getLong(key: string): number;
30+
getLongList(_name: string): NBTList;
2631
getName(): string;
2732
getObject(key: string, type: any): any;
33+
getOrCreateCompound(_name: string): NBTCompound;
2834
getParent(): NBTCompound;
35+
getPersistentDataContainer(): NBTCompound;
2936
getShort(key: string): number;
3037
getString(key: string): string;
3138
getStringList(_name: string): NBTList;
3239
getType(_name: string): NBTType;
40+
getUUID(key: string): string;
3341
hasKey(key: string): boolean;
3442
mergeCompound(comp: NBTCompound): void;
3543
removeKey(key: string): void;
@@ -45,6 +53,8 @@ export default interface NBTEntity extends NBTCompound {
4553
setObject(key: string, value: any): void;
4654
setShort(key: string, value: number): void;
4755
setString(key: string, value: string): void;
56+
setUUID(key: string, value: string): void;
57+
writeCompound(stream: OutputStream): void;
4858
}
4959

5060
export default class NBTEntity {

0 commit comments

Comments
 (0)