Skip to content

Commit f76f008

Browse files
committed
AWE-API: new commands and refactoring
* added relight command * added biome support in DC commands * minor refactoring of undo entries
1 parent b6e06a5 commit f76f008

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

src/org/primesoft/asyncworldedit/api/changesetSerializer/ISerializerManager.java

+24-3
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,39 @@ public interface ISerializerManager {
7171
void removeSerializer(IChangesetSerializer serializer);
7272

7373
/**
74-
* Initialize the undo storage file
74+
* Initialize the undo storage file
75+
* (do not add the random seed)
7576
*
7677
* @param player
7778
* @param id
7879
* @return
7980
*/
8081
File open(IPlayerEntry player, int id);
82+
83+
/**
84+
* Initialize the undo storage file
85+
*
86+
* @param player The Player
87+
* @param id The undo ID (starting from 0)
88+
* @param addRandomSeed should a random seed be added to the file name
89+
* @return
90+
*/
91+
File open(IPlayerEntry player, int id, boolean addRandomSeed);
92+
8193

8294
/**
8395
* Close undo storage file
8496
*
8597
* @param storageFile
8698
*/
8799
void close(File storageFile);
100+
101+
/**
102+
* Get memory storage for file
103+
* @param storageFile
104+
* @return
105+
*/
106+
IMemoryStorage getMemoryStorage(File storageFile);
88107

89108
/**
90109
* Save changes to file
@@ -148,15 +167,17 @@ public interface ISerializerManager {
148167
* @param stream
149168
* @param undoEntry
150169
* @throws IOException
170+
* @return number of written bytes
151171
*/
152-
void save(RandomAccessFile stream, IUndoEntry undoEntry) throws IOException;
172+
int save(RandomAccessFile stream, IUndoEntry undoEntry) throws IOException;
153173

154174
/**
155175
* Save the undo data to stream
156176
*
157177
* @param stream
158178
* @param undoEntry
159179
* @throws IOException
180+
* @return number of written bytes
160181
*/
161-
void save(DataOutputStream stream, IUndoEntry undoEntry) throws IOException;
182+
int save(DataOutputStream stream, IUndoEntry undoEntry) throws IOException;
162183
}

src/org/primesoft/asyncworldedit/api/changesetSerializer/IUndoEntry.java

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
* @author SBPrime
4646
*/
4747
public interface IUndoEntry {
48+
/**
49+
* Get the entry sequence ID
50+
* @return
51+
*/
52+
long getId();
4853

4954
/**
5055
* Get the serialized Change

src/org/primesoft/asyncworldedit/api/directChunk/IDirectChunkCommands.java

+36
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,46 @@ public interface IDirectChunkCommands {
6969
* Create the relight chunk command
7070
* @param playerEntry The player entry
7171
* @param region Region to clear
72+
* @param vanilla Use vanilla light calculation
73+
* @return
74+
*/
75+
IAsyncCommand createRelight(IPlayerEntry playerEntry, Region region, boolean vanilla);
76+
77+
/**
78+
* Create the relight chunk command (uses the vanila relight)
79+
* @param playerEntry The player entry
80+
* @param region Region to clear
7281
* @return
7382
*/
7483
IAsyncCommand createRelight(IPlayerEntry playerEntry, Region region);
7584

85+
/**
86+
* Create the copy to clipboard command
87+
* @param playerEntry
88+
* @param region
89+
* @param mask
90+
* @param copyBiome
91+
* @param clipboard
92+
* @return
93+
*/
94+
IAsyncCommand createCopy(IPlayerEntry playerEntry, Region region, Mask mask, Clipboard clipboard, boolean copyBiome);
95+
96+
/**
97+
* Create the clipboard paste command
98+
* @param playerEntry
99+
* @param position
100+
* @param world
101+
* @param mask
102+
* @param copyBiome
103+
* @param clipboard
104+
* @param ignoreAirBlocks
105+
* @param relight
106+
* @return
107+
*/
108+
IAsyncCommand createPaste(IPlayerEntry playerEntry, Location position, World world, Mask mask, ClipboardHolder clipboard,
109+
boolean ignoreAirBlocks, boolean relight, boolean copyBiome);
110+
111+
76112
/**
77113
* Create the copy to clipboard command
78114
* @param playerEntry

0 commit comments

Comments
 (0)