20
20
package org .screamingsandals .bedwars .api ;
21
21
22
22
import org .jetbrains .annotations .ApiStatus ;
23
- import org .screamingsandals .lib .api .Wrapper ;
23
+ import org .screamingsandals .lib .api .types .server .BlockHolder ;
24
+ import org .screamingsandals .lib .api .types .server .BlockPlacementHolder ;
25
+ import org .screamingsandals .lib .api .types .server .BlockSnapshotHolder ;
26
+ import org .screamingsandals .lib .api .types .server .ChunkHolder ;
27
+ import org .screamingsandals .lib .api .types .server .LocationHolder ;
24
28
25
29
/**
26
30
* <p>Abstract region API.</p>
@@ -36,122 +40,86 @@ public interface Region {
36
40
* @return was the supplied location modified?
37
41
* @since 0.3.0
38
42
*/
39
- boolean isLocationModifiedDuringGame (Object loc );
40
-
41
- /**
42
- * <p>Determines if the supplied location was modified during a BedWars game.</p>
43
- *
44
- * @param loc the location
45
- * @return was the supplied location modified?
46
- * @deprecated in favor of {@link Region#isLocationModifiedDuringGame(Object)}
47
- */
48
- @ Deprecated
49
- default boolean isBlockAddedDuringGame (Object loc ) {
50
- return isLocationModifiedDuringGame (loc );
51
- }
43
+ boolean isLocationModifiedDuringGame (LocationHolder loc );
52
44
53
45
/**
54
46
* <p>Marks a location for rollback.</p>
55
47
* <p>This should be used for restoring a broken block that was a part of the original world.</p>
56
48
*
57
49
* @param loc the location
58
- * @param blockState old block state (BlockStateHolder or the platform impl)
50
+ * @param blockSnapshot old block state
59
51
* @since 0.3.0
60
52
*/
61
- void markForRollback (Object loc , Object blockState );
62
-
63
- /**
64
- * <p>Marks a location for rollback.</p>
65
- * <p>This should be used for restoring a broken block that was a part of the original world.</p>
66
- *
67
- * @param loc the location
68
- * @param blockState old block state (BlockStateHolder or the platform impl)
69
- * @deprecated in favor of {@link Region#markForRollback(Object, Object)}
70
- */
71
- @ Deprecated
72
- default void putOriginalBlock (Object loc , Object blockState ) {
73
- markForRollback (loc , blockState );
74
- }
53
+ void markForRollback (LocationHolder loc , BlockSnapshotHolder blockSnapshot );
75
54
76
55
/**
77
56
* <p>Schedules a location for removal (set to AIR) while rolling back.</p>
78
57
*
79
58
* @param loc the location
80
59
*/
81
- void addBuiltDuringGame (Object loc );
60
+ void addBuiltDuringGame (LocationHolder loc );
82
61
83
62
/**
84
63
* <p>Schedules a location for removal (set to AIR) while rolling back.</p>
85
64
*
86
65
* @param loc the location
87
66
* @since 0.3.0
88
67
*/
89
- void removeBuiltDuringGame (Object loc );
90
-
91
- /**
92
- * <p>Schedules a location for removal (set to AIR) while rolling back.</p>
93
- *
94
- * @param loc the location
95
- * @deprecated in favor of {@link Region#removeBuiltDuringGame(Object)}
96
- */
97
- @ Deprecated
98
- default void removeBlockBuiltDuringGame (Object loc ) {
99
- removeBuiltDuringGame (loc );
100
- }
68
+ void removeBuiltDuringGame (LocationHolder loc );
101
69
102
70
/**
103
71
* <p>Checks if a material is a liquid.</p>
104
72
*
105
- * @param material the material (BlockTypeHolder or the platform impl)
73
+ * @param blockHolder the material
106
74
* @return is the material a liquid?
107
75
*/
108
- boolean isLiquid (Object material );
76
+ boolean isLiquid (BlockHolder blockHolder );
109
77
110
78
/**
111
79
* <p>Checks if a block state matches a bed block.</p>
112
80
*
113
- * @param blockState the block state (BlockStateHolder or the platform impl)
81
+ * @param blockSnapshot the block state
114
82
* @return does the block state match a bed block?
115
83
*/
116
- boolean isBedBlock (Object blockState );
84
+ boolean isBedBlock (BlockSnapshotHolder blockSnapshot );
117
85
118
86
/**
119
87
* <p>Checks if a block state matches a bed head block.</p>
120
88
*
121
- * @param blockState the block state (BlockStateHolder or the platform impl)
89
+ * @param blockSnapshot the block state (BlockStateHolder or the platform impl)
122
90
* @return does the block state match a bed head block?
123
91
*/
124
- boolean isBedHead (Object blockState );
92
+ boolean isBedHead (BlockSnapshotHolder blockSnapshot );
125
93
126
94
/**
127
95
* <p>Gets the bed's neighbor block (the second part of the bed) from the bed head block.</p>
128
96
*
129
97
* @param blockHead the bed head block
130
98
* @return the bed neighbor block
131
99
*/
132
- Wrapper getBedNeighbor (Object blockHead );
100
+ BlockPlacementHolder getBedNeighbor (BlockPlacementHolder blockHead );
133
101
134
102
/**
135
103
* <p>Determines if anything was modified in the supplied chunk.</p>
136
104
*
137
105
* @param chunk the chunk
138
106
* @return was anything in the chunk modified?
139
107
*/
140
- boolean isChunkUsed (Object chunk );
108
+ boolean isChunkUsed (ChunkHolder chunk );
141
109
142
110
/**
143
111
* <p>Checks if a block state matches a door block.</p>
144
112
*
145
- * @param blockState the block state (BlockStateHolder or the platform impl)
113
+ * @param blockSnapshot the block state
146
114
* @return does the block state match a door block?
147
115
*/
148
- boolean isDoorBlock (Object blockState );
116
+ boolean isDoorBlock (BlockSnapshotHolder blockSnapshot );
149
117
150
118
/**
151
119
* <p>Checks if a block state matches a bottom door block.</p>
152
120
*
153
- * @param blockState the block state (BlockStateHolder or the platform impl)
121
+ * @param blockSnapshot the block state
154
122
* @return does the block state match a bottom door block?
155
123
*/
156
- boolean isDoorBottomBlock (Object blockState );
124
+ boolean isDoorBottomBlock (BlockSnapshotHolder blockSnapshot );
157
125
}
0 commit comments