├── .gitignore
├── API
├── pom.xml
└── src
│ └── main
│ └── java
│ └── be4rjp
│ └── parallel
│ ├── ParallelAPI.java
│ ├── ParallelChunk.java
│ ├── ParallelUniverse.java
│ ├── ParallelWorld.java
│ ├── nms
│ ├── INMSHandler.java
│ └── IPacketHandler.java
│ ├── player
│ └── ParallelPlayer.java
│ ├── structure
│ └── StructureData.java
│ └── util
│ ├── BlockPosition3i.java
│ ├── ChunkPosition.java
│ ├── SectionLevelArray.java
│ ├── SectionTypeArray.java
│ └── ThreadsafeIteration.java
├── Plugin
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── be4rjp
│ │ └── parallel
│ │ ├── Config.java
│ │ ├── EventListener.java
│ │ ├── Parallel.java
│ │ ├── chiyogami
│ │ ├── ChiyogamiBridge.java
│ │ └── ChiyogamiManager.java
│ │ ├── cinema4c
│ │ ├── BridgeManager.java
│ │ └── C4CBridge.java
│ │ ├── command
│ │ └── parallelCommandExecutor.java
│ │ ├── enums
│ │ └── UpdatePacketType.java
│ │ ├── gui
│ │ └── UniverseGUI.java
│ │ ├── impl
│ │ ├── ImplParallelAPI.java
│ │ ├── ImplParallelChunk.java
│ │ ├── ImplParallelPlayer.java
│ │ ├── ImplParallelUniverse.java
│ │ └── ImplParallelWorld.java
│ │ ├── nms
│ │ ├── NMSManager.java
│ │ └── PacketHandler.java
│ │ ├── structure
│ │ ├── ImplStructureData.java
│ │ └── ParallelStructure.java
│ │ └── util
│ │ ├── ChunkUtil.java
│ │ ├── RegionBlocks.java
│ │ └── TaskHandler.java
│ └── resources
│ ├── config.yml
│ └── plugin.yml
├── README.md
├── pom.xml
├── v1_15_R1
├── pom.xml
└── src
│ └── main
│ └── java
│ └── be4rjp
│ └── parallel
│ └── v1_15_R1
│ ├── BlockChangePacketHandler.java
│ ├── FlyPacketHandler.java
│ ├── LightUpdatePacketHandler.java
│ ├── MapChunkPacketHandler.java
│ ├── MultiBlockChangePacketHandler.java
│ └── NMSHandler.java
└── v1_16_R3
├── pom.xml
└── src
└── main
└── java
└── be4rjp
└── parallel
└── v1_16_R3
├── BlockChangePacketHandler.java
├── FlyPacketHandler.java
├── LightUpdatePacketHandler.java
├── MapChunkPacketHandler.java
├── MultiBlockChangePacketHandler.java
└── NMSHandler.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # User-specific stuff
2 | .idea/
3 |
4 | *.iml
5 | *.ipr
6 | *.iws
7 |
8 | # IntelliJ
9 | out/
10 |
11 | # Compiled class file
12 | *.class
13 |
14 | # Log file
15 | *.log
16 |
17 | # BlueJ files
18 | *.ctxt
19 |
20 | # Package Files #
21 | *.jar
22 | *.war
23 | *.nar
24 | *.ear
25 | *.zip
26 | *.tar.gz
27 | *.rar
28 |
29 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
30 | hs_err_pid*
31 |
32 | *~
33 |
34 | # temporary files which can be created if a process still has a handle open of a deleted file
35 | .fuse_hidden*
36 |
37 | # KDE directory preferences
38 | .directory
39 |
40 | # Linux trash folder which might appear on any partition or disk
41 | .Trash-*
42 |
43 | # .nfs files are created when an open file is removed but is still being accessed
44 | .nfs*
45 |
46 | # General
47 | .DS_Store
48 | .AppleDouble
49 | .LSOverride
50 |
51 | # Icon must end with two \r
52 | Icon
53 |
54 | # Thumbnails
55 | ._*
56 |
57 | # Files that might appear in the root of a volume
58 | .DocumentRevisions-V100
59 | .fseventsd
60 | .Spotlight-V100
61 | .TemporaryItems
62 | .Trashes
63 | .VolumeIcon.icns
64 | .com.apple.timemachine.donotpresent
65 |
66 | # Directories potentially created on remote AFP share
67 | .AppleDB
68 | .AppleDesktop
69 | Network Trash Folder
70 | Temporary Items
71 | .apdisk
72 |
73 | # Windows thumbnail cache files
74 | Thumbs.db
75 | Thumbs.db:encryptable
76 | ehthumbs.db
77 | ehthumbs_vista.db
78 |
79 | # Dump file
80 | *.stackdump
81 |
82 | # Folder config file
83 | [Dd]esktop.ini
84 |
85 | # Recycle Bin used on file shares
86 | $RECYCLE.BIN/
87 |
88 | # Windows Installer files
89 | *.cab
90 | *.msi
91 | *.msix
92 | *.msm
93 | *.msp
94 |
95 | # Windows shortcuts
96 | *.lnk
97 |
98 | target/
99 |
100 | pom.xml.tag
101 | pom.xml.releaseBackup
102 | pom.xml.versionsBackup
103 | pom.xml.next
104 |
105 | release.properties
106 | dependency-reduced-pom.xml
107 | buildNumber.properties
108 | .mvn/timing.properties
109 | .mvn/wrapper/maven-wrapper.jar
110 | .flattened-pom.xml
111 |
112 | # Common working directory
113 | run/
114 |
--------------------------------------------------------------------------------
/API/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | parallel_api
5 | jar
6 | 2.0.3
7 | be4rjp
8 |
9 |
10 |
11 | internal.repo
12 | Temporary Staging Repository
13 | file://${project.build.directory}/mvn-repo
14 |
15 |
16 |
17 |
18 | 1.8
19 | UTF-8
20 | github
21 |
22 |
23 |
24 |
25 |
26 | org.apache.maven.plugins
27 | maven-compiler-plugin
28 | 3.8.1
29 |
30 | ${java.version}
31 | ${java.version}
32 |
33 |
34 |
35 | org.apache.maven.plugins
36 | maven-javadoc-plugin
37 |
38 |
39 | package
40 |
41 | jar
42 |
43 |
44 |
45 |
46 |
47 | maven-deploy-plugin
48 | 2.8.2
49 |
50 | internal.repo::default::file://${project.build.directory}/mvn-repo
51 |
52 |
53 |
54 | com.github.github
55 | site-maven-plugin
56 | 0.12
57 |
58 | Maven artifacts for ${project.version}
59 | true
60 | true
61 | ${project.build.directory}/mvn-repo
62 | refs/heads/mvn-repo
63 | **/*
64 | Parallel
65 | Be4rJP
66 | Be4rJP
67 |
68 |
69 |
70 |
71 | site
72 |
73 | deploy
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | spigotmc-repo
83 | https://hub.spigotmc.org/nexus/content/repositories/snapshots/
84 |
85 |
86 | sonatype
87 | https://oss.sonatype.org/content/groups/public/
88 |
89 |
90 | minecraft-libraries
91 | Minecraft Libraries
92 | https://libraries.minecraft.net
93 |
94 |
95 | enginehub-maven
96 | https://maven.enginehub.org/repo/
97 |
98 |
99 | jitpack.io
100 | https://jitpack.io
101 |
102 |
103 |
104 |
105 |
106 | org.spigotmc
107 | spigot-api
108 | 1.15.2-R0.1-SNAPSHOT
109 | provided
110 |
111 |
112 | io.netty
113 | netty-all
114 | 4.1.59.Final
115 | provided
116 |
117 |
118 | com.mojang
119 | datafixerupper
120 | 1.0.20
121 | provided
122 |
123 |
124 | org.jetbrains
125 | annotations
126 | RELEASE
127 | compile
128 |
129 |
130 | fastutil
131 | fastutil
132 | 5.0.9
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/API/src/main/java/be4rjp/parallel/ParallelAPI.java:
--------------------------------------------------------------------------------
1 | package be4rjp.parallel;
2 |
3 | import be4rjp.parallel.player.ParallelPlayer;
4 | import org.bukkit.entity.Player;
5 | import org.jetbrains.annotations.NotNull;
6 | import org.jetbrains.annotations.Nullable;
7 |
8 | import java.util.Collection;
9 | import java.util.Set;
10 |
11 | public abstract class ParallelAPI {
12 |
13 | //API instance
14 | private static ParallelAPI instance;
15 |
16 | /**
17 | * Get api instance.
18 | * @return ParallelAPI
19 | */
20 | public static @NotNull ParallelAPI getInstance() {return instance;}
21 |
22 | /**
23 | * Create universe if absent.
24 | * @param universeName Name of a universe
25 | * @return ParallelUniverse
26 | */
27 | public abstract @NotNull ParallelUniverse createUniverse(String universeName);
28 |
29 | /**
30 | * Get universe.
31 | * @param universeName Name of a universe
32 | * @return If the Universe with the specified name does not exist, return null.
33 | */
34 | public abstract @Nullable ParallelUniverse getUniverse(String universeName);
35 |
36 | /**
37 | * Remove universe with the specified name.
38 | * @param universeName Name of a universe.
39 | */
40 | public abstract void removeUniverse(String universeName);
41 |
42 | /**
43 | * Get all universe name.
44 | * @return All universe name
45 | */
46 | public abstract Set getAllUniverseName();
47 |
48 | /**
49 | * Get all universe.
50 | * @return All universe
51 | */
52 | public abstract Collection getAllUniverse();
53 |
54 | /**
55 | * Get ParallelPlayer
56 | * @return ParallelPlayer
57 | */
58 | public @Nullable ParallelPlayer getParallelPlayer(Player player){return ParallelPlayer.getParallelPlayer(player);}
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/API/src/main/java/be4rjp/parallel/ParallelChunk.java:
--------------------------------------------------------------------------------
1 | package be4rjp.parallel;
2 |
3 | import be4rjp.parallel.util.SectionLevelArray;
4 | import be4rjp.parallel.util.SectionTypeArray;
5 | import org.bukkit.Material;
6 | import org.bukkit.block.data.BlockData;
7 | import org.bukkit.entity.Player;
8 | import org.jetbrains.annotations.NotNull;
9 | import org.jetbrains.annotations.Nullable;
10 |
11 | public interface ParallelChunk {
12 |
13 | /**
14 | * Get the ParallelWorld in which this chunk is stored.
15 | * @return ParallelWorld
16 | */
17 | @NotNull ParallelWorld getWorld();
18 |
19 | /**
20 | * Get coordinate(Chunk X)
21 | * @return chunkX
22 | */
23 | int getChunkX();
24 |
25 | /**
26 | * Get coordinate(Chunk Z)
27 | * @return chunkZ
28 | */
29 | int getChunkZ();
30 |
31 | /**
32 | * Set the material for a block in this chunk.
33 | * @param blockX Block coordinate X
34 | * @param blockY Block coordinate Y
35 | * @param blockZ Block coordinate Z
36 | * @param material Bukkit material
37 | */
38 | void setType(int blockX, int blockY, int blockZ, Material material);
39 |
40 | /**
41 | * Get the material for a block in this chunk.
42 | * @param blockX Block coordinate X
43 | * @param blockY Block coordinate Y
44 | * @param blockZ Block coordinate Z
45 | * @return Material for the block
46 | */
47 | @Nullable Material getType(int blockX, int blockY, int blockZ);
48 |
49 | /**
50 | * Set the data for a block in this chunk.
51 | * @param blockX Block coordinate X
52 | * @param blockY Block coordinate Y
53 | * @param blockZ Block coordinate Z
54 | * @param blockData Bukkit BlockData
55 | */
56 | void setBlockData(int blockX, int blockY, int blockZ, BlockData blockData);
57 |
58 | /**
59 | * Get the data for a block in this chunk.
60 | * @param blockX Block coordinate X
61 | * @param blockY Block coordinate Y
62 | * @param blockZ Block coordinate Z
63 | * @return BlockData for the block
64 | */
65 | @Nullable BlockData getBlockData(int blockX, int blockY, int blockZ);
66 |
67 | /**
68 | * Get the nms IBlockData for a block in this chunk.
69 | * @param blockX Block coordinate X
70 | * @param blockY Block coordinate Y
71 | * @param blockZ Block coordinate Z
72 | * @return BlockData for the block
73 | */
74 | @Nullable Object getNMSBlockData(int blockX, int blockY, int blockZ);
75 |
76 | /**
77 | * Remove the data for a block in this chunk.
78 | * @param blockX Block coordinate X
79 | * @param blockY Block coordinate Y
80 | * @param blockZ Block coordinate Z
81 | */
82 | void removeBlockData(int blockX, int blockY, int blockZ);
83 |
84 | /**
85 | * Set block light level for a block in this chunk.
86 | * @param blockX Block coordinate X
87 | * @param blockY Block coordinate Y
88 | * @param blockZ Block coordinate Z
89 | * @param level Light level
90 | */
91 | void setBlockLightLevel(int blockX, int blockY, int blockZ, int level);
92 |
93 | /**
94 | * Set block light level for a block in this chunk.
95 | * @param blockX Block coordinate X
96 | * @param blockY Block coordinate Y
97 | * @param blockZ Block coordinate Z
98 | * @return Block light
99 | */
100 | int getBlockLightLevel(int blockX, int blockY, int blockZ);
101 |
102 | /**
103 | * Remove block light level for a block in this chunk.
104 | * @param blockX Block coordinate X
105 | * @param blockY Block coordinate Y
106 | * @param blockZ Block coordinate Z
107 | */
108 | void removeBlockLight(int blockX, int blockY, int blockZ);
109 |
110 | /**
111 | * Set sky light level for a block in this chunk.
112 | * @param blockX Block coordinate X
113 | * @param blockY Block coordinate Y
114 | * @param blockZ Block coordinate Z
115 | * @param level Light level
116 | */
117 | void setSkyLightLevel(int blockX, int blockY, int blockZ, int level);
118 |
119 | /**
120 | * Set sky light level for a block in this chunk.
121 | * @param blockX Block coordinate X
122 | * @param blockY Block coordinate Y
123 | * @param blockZ Block coordinate Z
124 | * @return Sky light
125 | */
126 | int getSkyLightLevel(int blockX, int blockY, int blockZ);
127 |
128 | /**
129 | * Remove sky light level for a block in this chunk.
130 | * @param blockX Block coordinate X
131 | * @param blockY Block coordinate Y
132 | * @param blockZ Block coordinate Z
133 | */
134 | void removeSkyLight(int blockX, int blockY, int blockZ);
135 |
136 | /**
137 | * Get block light nibble array.
138 | * @param sectionY Chunk section index.
139 | * @return SectionLevelArray
140 | */
141 | @Nullable SectionLevelArray getBlockLightSectionLevelArray(int sectionY);
142 |
143 | /**
144 | * Get sky light nibble array.
145 | * @param sectionY Chunk section index.
146 | * @return SectionLevelArray
147 | */
148 | @Nullable SectionLevelArray getSkyLightSectionLevelArray(int sectionY);
149 |
150 | /**
151 | * Get all block data.
152 | * @param sectionY Chunk section index.
153 | * @return SectionTypeArray
154 | */
155 | @Nullable SectionTypeArray getSectionTypeArray(int sectionY);
156 |
157 | /**
158 | * Gets whether the specified block is set with data.
159 | * @param blockX Block coordinate X
160 | * @param blockY Block coordinate Y
161 | * @param blockZ Block coordinate Z
162 | * @return Whether the specified block is set with data.
163 | */
164 | boolean hasBlockData(int blockX, int blockY, int blockZ);
165 |
166 | /**
167 | * Gets whether the specified block is set with block light.
168 | * @param blockX Block coordinate X
169 | * @param blockY Block coordinate Y
170 | * @param blockZ Block coordinate Z
171 | * @return Whether the specified block is set with block light.
172 | */
173 | boolean hasBlockLight(int blockX, int blockY, int blockZ);
174 |
175 | /**
176 | * Gets whether the specified block is set with sky light.
177 | * @param blockX Block coordinate X
178 | * @param blockY Block coordinate Y
179 | * @param blockZ Block coordinate Z
180 | * @return Whether the specified block is set with sky light.
181 | */
182 | boolean hasSkyLight(int blockX, int blockY, int blockZ);
183 |
184 | /**
185 | * Sends the data of all blocks set in this chunk to the players.
186 | * @param player Player to sen
187 | */
188 | void sendUpdate(Player player);
189 |
190 | @Nullable Object getCachedMapChunkPacket();
191 |
192 | @Nullable Object getCachedLightUpdatePacket();
193 |
194 | void setMapChunkPacketCache(Object packet);
195 |
196 | void setLightUpdatePacketCache(Object packet);
197 | }
198 |
--------------------------------------------------------------------------------
/API/src/main/java/be4rjp/parallel/ParallelUniverse.java:
--------------------------------------------------------------------------------
1 | package be4rjp.parallel;
2 |
3 | import be4rjp.parallel.player.ParallelPlayer;
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.util.Collection;
7 | import java.util.Set;
8 |
9 | /**
10 | * If you set an instance of a class that implements this interface as a player, the block changes will be applied.
11 | */
12 | public interface ParallelUniverse {
13 |
14 | /**
15 | * Get name of this universe.
16 | * @return Universe name.
17 | */
18 | @NotNull String getName();
19 |
20 | /**
21 | * Get ParallelWorld from the world name.
22 | * @param worldName Name of the world.
23 | * @return ParallelWorld
24 | */
25 | @NotNull ParallelWorld getWorld(String worldName);
26 |
27 | /**
28 | * Add a player to this universe.
29 | * @param player Player to add
30 | */
31 | void addPlayer(@NotNull ParallelPlayer player);
32 |
33 | /**
34 | * Remove a player to this universe.
35 | * @param player A player to remove
36 | */
37 | void removePlayer(@NotNull ParallelPlayer player);
38 |
39 | /**
40 | * Get all players in this universe.
41 | * @return All players in this universe
42 | */
43 | Set getResidents();
44 |
45 | /**
46 | * Get all world in this universe.
47 | * @return All world.
48 | */
49 | Collection getAllWorld();
50 |
51 | /**
52 | * Add a diff for the specified universe.
53 | * @param universe Universe
54 | */
55 | void addDiffs(ParallelUniverse universe);
56 | }
57 |
--------------------------------------------------------------------------------
/API/src/main/java/be4rjp/parallel/ParallelWorld.java:
--------------------------------------------------------------------------------
1 | package be4rjp.parallel;
2 |
3 | import be4rjp.parallel.util.BlockPosition3i;
4 | import org.bukkit.Material;
5 | import org.bukkit.block.data.BlockData;
6 | import org.jetbrains.annotations.NotNull;
7 | import org.jetbrains.annotations.Nullable;
8 |
9 | import java.util.Collection;
10 | import java.util.Set;
11 |
12 | public interface ParallelWorld {
13 |
14 | /**
15 | * Get name of this world.
16 | * @return World name.
17 | */
18 | String getName();
19 |
20 | /**
21 | * Get the ParallelUniverse in which this world is stored.
22 | * @return ParallelUniverse
23 | */
24 | @NotNull ParallelUniverse getParallelUniverse();
25 |
26 | /**
27 | * Set the material for a block in this world.
28 | * @param blockX Block coordinate X
29 | * @param blockY Block coordinate Y
30 | * @param blockZ Block coordinate Z
31 | * @param material Bukkit material
32 | */
33 | void setType(int blockX, int blockY, int blockZ, Material material);
34 |
35 | /**
36 | * Get the material for a block in this world.
37 | * @param blockX Block coordinate X
38 | * @param blockY Block coordinate Y
39 | * @param blockZ Block coordinate Z
40 | * @return Material for the block
41 | */
42 | @Nullable Material getType(int blockX, int blockY, int blockZ);
43 |
44 | /**
45 | * Set the data for a block in this world.
46 | * @param blockX Block coordinate X
47 | * @param blockY Block coordinate Y
48 | * @param blockZ Block coordinate Z
49 | * @param blockData Bukkit BlockData
50 | */
51 | void setBlockData(int blockX, int blockY, int blockZ, BlockData blockData);
52 |
53 | /**
54 | * Get the data for a block in this world.
55 | * @param blockX Block coordinate X
56 | * @param blockY Block coordinate Y
57 | * @param blockZ Block coordinate Z
58 | * @return BlockData for the block
59 | */
60 | @Nullable BlockData getBlockData(int blockX, int blockY, int blockZ);
61 |
62 | /**
63 | * Get the nms IBlockData for a block in this world.
64 | * @param blockX Block coordinate X
65 | * @param blockY Block coordinate Y
66 | * @param blockZ Block coordinate Z
67 | * @return BlockData for the block
68 | */
69 | @Nullable Object getNMSBlockData(int blockX, int blockY, int blockZ);
70 |
71 | /**
72 | * Remove the data for a block in this world.
73 | * @param blockX Block coordinate X
74 | * @param blockY Block coordinate Y
75 | * @param blockZ Block coordinate Z
76 | */
77 | void removeBlockData(int blockX, int blockY, int blockZ);
78 |
79 | /**
80 | * Set block light level for a block in this world.
81 | * @param blockX Block coordinate X
82 | * @param blockY Block coordinate Y
83 | * @param blockZ Block coordinate Z
84 | * @param level Light level
85 | */
86 | void setBlockLightLevel(int blockX, int blockY, int blockZ, int level);
87 |
88 | /**
89 | * Get block light level for a block in this world.
90 | * @param blockX Block coordinate X
91 | * @param blockY Block coordinate Y
92 | * @param blockZ Block coordinate Z
93 | * @return Block light level for a block in this world.
94 | */
95 | int getBlockLightLevel(int blockX, int blockY, int blockZ);
96 |
97 | /**
98 | * Remove block light level for a block in this world.
99 | * @param blockX Block coordinate X
100 | * @param blockY Block coordinate Y
101 | * @param blockZ Block coordinate Z
102 | */
103 | void removeBlockLight(int blockX, int blockY, int blockZ);
104 |
105 | /**
106 | * Set sky light level for a block in this world.
107 | * @param blockX Block coordinate X
108 | * @param blockY Block coordinate Y
109 | * @param blockZ Block coordinate Z
110 | * @param level Light level
111 | */
112 | void setSkyLightLevel(int blockX, int blockY, int blockZ, int level);
113 |
114 | /**
115 | * Get sky light level for a block in this world.
116 | * @param blockX Block coordinate X
117 | * @param blockY Block coordinate Y
118 | * @param blockZ Block coordinate Z
119 | * @return Sky light level for a block in this world.
120 | */
121 | int getSkyLightLevel(int blockX, int blockY, int blockZ);
122 |
123 | /**
124 | * Remove sky light level for a block in this world.
125 | * @param blockX Block coordinate X
126 | * @param blockY Block coordinate Y
127 | * @param blockZ Block coordinate Z
128 | */
129 | void removeSkyLight(int blockX, int blockY, int blockZ);
130 |
131 | /**
132 | * Gets whether the specified block is set with data.
133 | * @param blockX Block coordinate X
134 | * @param blockY Block coordinate Y
135 | * @param blockZ Block coordinate Z
136 | * @return Whether the specified block is set with data.
137 | */
138 | boolean hasBlockData(int blockX, int blockY, int blockZ);
139 |
140 | /**
141 | * Gets whether the specified block is set with block light.
142 | * @param blockX Block coordinate X
143 | * @param blockY Block coordinate Y
144 | * @param blockZ Block coordinate Z
145 | * @return Whether the specified block is set with block light.
146 | */
147 | boolean hasBlockLight(int blockX, int blockY, int blockZ);
148 |
149 | /**
150 | * Gets whether the specified block is set with sky light.
151 | * @param blockX Block coordinate X
152 | * @param blockY Block coordinate Y
153 | * @param blockZ Block coordinate Z
154 | * @return Whether the specified block is set with sky light.
155 | */
156 | boolean hasSkyLight(int blockX, int blockY, int blockZ);
157 |
158 | /**
159 | * Get a chunk that exist in this world.
160 | * @param chunkX Chunk coordinate X
161 | * @param chunkZ Chunk coordinate Z
162 | * @return ParallelChunk
163 | */
164 | @Nullable ParallelChunk getChunk(int chunkX, int chunkZ);
165 |
166 | /**
167 | * Send block update packet.
168 | * @param blockX Block coordinate X
169 | * @param blockY Block coordinate Y
170 | * @param blockZ Block coordinate Z
171 | */
172 | void sendBlockUpdate(int blockX, int blockY, int blockZ);
173 |
174 | /**
175 | * Send multi block change packet to the players.
176 | * @param blocks Update block positions
177 | */
178 | void sendMultiBlockUpdate(Set blocks);
179 |
180 | /**
181 | * Get all chunks in this world.
182 | * @return All chunks
183 | */
184 | Collection getAllChunk();
185 |
186 | }
187 |
--------------------------------------------------------------------------------
/API/src/main/java/be4rjp/parallel/nms/INMSHandler.java:
--------------------------------------------------------------------------------
1 | package be4rjp.parallel.nms;
2 |
3 | import be4rjp.parallel.ParallelChunk;
4 | import be4rjp.parallel.ParallelWorld;
5 | import be4rjp.parallel.util.BlockPosition3i;
6 | import io.netty.channel.Channel;
7 | import org.bukkit.block.data.BlockData;
8 | import org.bukkit.entity.Player;
9 | import org.jetbrains.annotations.Nullable;
10 |
11 | import java.util.Set;
12 |
13 | public interface INMSHandler {
14 |
15 | Channel getChannel(Player player);
16 |
17 | void sendPacket(Player player, Object packet);
18 |
19 | Object getIBlockDataByCombinedId(int id);
20 |
21 | int getCombinedIdByIBlockData(Object iBlockData);
22 |
23 | Object getIBlockData(BlockData blockData);
24 |
25 | BlockData getBukkitBlockData(Object iBlockData);
26 |
27 | Object[] createIBlockDataArray(int length);
28 |
29 | boolean isMapChunkPacket(Object packet);
30 |
31 | boolean isMultiBlockChangePacket(Object packet);
32 |
33 | boolean isBlockChangePacket(Object packet);
34 |
35 | boolean isLightUpdatePacket(Object packet);
36 |
37 | boolean isFlyPacket(Object packet);
38 |
39 | @Nullable Object createBlockChangePacket(ParallelWorld parallelWorld, int blockX, int blockY, int blockZ);
40 |
41 | Set