Skip to content

Commit 6231260

Browse files
authored
Fix/order (#821)
1 parent f6baf30 commit 6231260

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/com/ldtteam/structurize/placement/handlers/placement/PlacementHandlers.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ public static void add(IPlacementHandler handler, Class<?> override, final AddTy
117117
switch (addType)
118118
{
119119
case BEFORE:
120-
handlers.add(i - 1, handler);
120+
handlers.add(i, handler);
121121
break;
122122
case AFTER:
123-
handlers.add(i, handler);
123+
handlers.add(i+1, handler);
124124
break;
125125
case REPLACE:
126126
handlers.set(i, handler);
@@ -134,16 +134,15 @@ public static void add(IPlacementHandler handler, Class<?> override, final AddTy
134134
}
135135

136136
/**
137-
* Adds a handler to the start of the handlers list,
138-
* effectively overriding existing ones with similar
139-
* 'canHandle' functions because this one will evaluate before them
137+
* Adds a handler to the start of the handlers list, right after the air, solid and light placeholder handlers.
138+
* This may effectively override existing ones with similar 'canHandle' functions because this one will evaluate before them.
140139
* @param handler
141140
*/
142141
public static void add(IPlacementHandler handler)
143142
{
144143
synchronized (handlers)
145144
{
146-
handlers.add(1, handler);
145+
handlers.add(3, handler);
147146
handlerCache.clear();
148147
}
149148
}

0 commit comments

Comments
 (0)