Skip to content

Commit dcb90cb

Browse files
committed
Updated to the lastest WorldEdit 7 SNAPSHOT
1 parent aabc181 commit dcb90cb

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<groupId>com.github.hexocraft</groupId>
2424
<artifactId>addlight</artifactId>
2525
<name>AddLight</name>
26-
<version>4.3.1</version>
26+
<version>4.3.2</version>
2727
<packaging>jar</packaging>
2828
<description>This plugin allow server admin to add invisible light sources.</description>
2929
<url>https://github.com/hexocraft/AddLight</url>
@@ -54,7 +54,7 @@
5454
<!-- Propriétés du projet -->
5555
<properties>
5656
<jdk.version>1.8</jdk.version>
57-
<bukkit.version>1.13.1-R0.1-SNAPSHOT</bukkit.version>
57+
<bukkit.version>1.13.2-R0.1-SNAPSHOT</bukkit.version>
5858
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5959
<github.global.server>github</github.global.server>
6060
</properties>

src/main/java/com/github/hexocraft/addlight/LightsApi.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
import com.github.hexocraftapi.lights.Lights;
2222
import com.github.hexocraftapi.message.predifined.message.SimplePrefixedMessage;
2323
import com.google.common.collect.Lists;
24-
import com.sk89q.worldedit.BlockVector;
25-
import com.sk89q.worldedit.Vector;
24+
import com.sk89q.worldedit.math.BlockVector3;
2625
import org.bukkit.Location;
2726
import org.bukkit.Material;
2827
import org.bukkit.block.Block;
2928
import org.bukkit.entity.Player;
3029
import org.bukkit.scheduler.BukkitRunnable;
30+
import org.bukkit.util.BlockVector;
3131

3232
import java.util.HashMap;
3333
import java.util.Iterator;
@@ -120,8 +120,8 @@ public void run()
120120
Location corner2 = null;
121121
if(worldEdit != null && Permissions.has(player, Permissions.WORLDEDIT) && worldEdit.isLocationInSelection(player, location))
122122
{
123-
Vector vCorner1 = worldEdit.getSelection(player).getMaximumPoint();
124-
Vector vCorner2 = worldEdit.getSelection(player).getMinimumPoint();
123+
BlockVector3 vCorner1 = worldEdit.getSelection(player).getMaximumPoint();
124+
BlockVector3 vCorner2 = worldEdit.getSelection(player).getMinimumPoint();
125125

126126
corner1 = new org.bukkit.Location(player.getWorld(), vCorner1.getX(), vCorner1.getY(), vCorner1.getZ());
127127
corner2 = new org.bukkit.Location(player.getWorld(), vCorner2.getX(), vCorner2.getY(), vCorner2.getZ());
@@ -143,13 +143,13 @@ else if(worldEdit != null && Permissions.has(player, Permissions.WORLDEDIT) && w
143143
@Override
144144
public void run()
145145
{
146-
Iterator<BlockVector> blocks = worldEdit.getBlockVector(player, location);
147-
List<Location> locations = Lists.newArrayList();
146+
Iterator<BlockVector3> blocks = worldEdit.getBlockVector(player, location);
147+
List<Location> locations = Lists.newArrayList();
148148

149149
while(blocks != null && blocks.hasNext())
150150
{
151-
BlockVector pos = blocks.next();
152-
Block block = location.getWorld().getBlockAt(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
151+
BlockVector3 pos = blocks.next();
152+
Block block = location.getWorld().getBlockAt(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
153153
if(block.getType() != Material.AIR)
154154
locations.add(block.getLocation());
155155
}
@@ -195,8 +195,8 @@ public void run()
195195
Location corner2 = null;
196196
if(worldEdit != null && Permissions.has(player, Permissions.WORLDEDIT) && worldEdit.isLocationInSelection(player, location))
197197
{
198-
Vector vCorner1 = worldEdit.getSelection(player).getMaximumPoint();
199-
Vector vCorner2 = worldEdit.getSelection(player).getMinimumPoint();
198+
BlockVector3 vCorner1 = worldEdit.getSelection(player).getMaximumPoint();
199+
BlockVector3 vCorner2 = worldEdit.getSelection(player).getMinimumPoint();
200200

201201
corner1 = new org.bukkit.Location(player.getWorld(), vCorner1.getX(), vCorner1.getY(), vCorner1.getZ());
202202
corner2 = new org.bukkit.Location(player.getWorld(), vCorner2.getX(), vCorner2.getY(), vCorner2.getZ());
@@ -218,12 +218,12 @@ else if(worldEdit != null && Permissions.has(player, Permissions.WORLDEDIT) && w
218218
@Override
219219
public void run()
220220
{
221-
Iterator<BlockVector> blocks = worldEdit.getBlockVector(player, location);
221+
Iterator<BlockVector3> blocks = worldEdit.getBlockVector(player, location);
222222
List<Location> locations = Lists.newArrayList();
223223

224224
while(blocks != null && blocks.hasNext())
225225
{
226-
BlockVector pos = blocks.next();
226+
BlockVector3 pos = blocks.next();
227227
Block block = location.getWorld().getBlockAt(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
228228
if(block.getType() != Material.AIR)
229229
locations.add(block.getLocation());

src/main/java/com/github/hexocraft/addlight/integrations/WorldEditHooker.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
*/
1818

1919
import com.github.hexocraftapi.integration.Hooker;
20-
import com.sk89q.worldedit.BlockVector;
2120
import com.sk89q.worldedit.IncompleteRegionException;
2221
import com.sk89q.worldedit.LocalSession;
23-
import com.sk89q.worldedit.Vector;
2422
import com.sk89q.worldedit.WorldEdit;
2523
import com.sk89q.worldedit.bukkit.BukkitPlayer;
24+
import com.sk89q.worldedit.math.BlockVector3;
2625
import com.sk89q.worldedit.regions.CuboidRegion;
2726
import com.sk89q.worldedit.regions.CylinderRegion;
2827
import com.sk89q.worldedit.regions.Polygonal2DRegion;
@@ -94,10 +93,10 @@ public boolean isLocationInSelection(Player player, Location location) {
9493
if(!player.isOnline()) throw new IllegalArgumentException("Offline player not allowed");
9594

9695
try {
97-
BukkitPlayer wPlayer = plugin.wrapPlayer(player);
98-
LocalSession session = WorldEdit.getInstance().getSessionManager().get(wPlayer);
99-
Region region = session.getSelection((World) wPlayer.getWorld());
100-
Vector vLocation = new Vector(location.getX(), location.getY(), location.getZ());
96+
BukkitPlayer wPlayer = plugin.wrapPlayer(player);
97+
LocalSession session = WorldEdit.getInstance().getSessionManager().get(wPlayer);
98+
Region region = session.getSelection((World) wPlayer.getWorld());
99+
BlockVector3 vLocation = BlockVector3.at(location.getX(), location.getY(), location.getZ());
101100
return region != null && region.contains(vLocation);
102101
} catch(IncompleteRegionException e) {
103102
return false;
@@ -110,7 +109,7 @@ public boolean isLocationInSelection(Player player, Location location) {
110109
*
111110
* @return Region
112111
*/
113-
public Iterator<BlockVector> getBlockVector(Player player, Location location) {
112+
public Iterator<BlockVector3> getBlockVector(Player player, Location location) {
114113
if(!isLocationInSelection(player, location))
115114
return null;
116115

src/main/java/com/github/hexocraft/addlight/listeners/PlayerListener.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
import com.github.hexocraft.addlight.AddLightPlugin;
2020
import com.github.hexocraft.addlight.LightsApi;
2121
import com.github.hexocraft.addlight.configuration.Permissions;
22-
import com.github.hexocraftapi.message.predifined.message.SimpleMessage;
2322
import com.github.hexocraftapi.message.predifined.message.SimplePrefixedMessage;
2423
import com.github.hexocraftapi.message.predifined.message.WarningPrefixedMessage;
25-
import com.github.hexocraftapi.nms.utils.NmsChunkUtil;
2624
import com.github.hexocraftapi.reflection.minecraft.Minecraft;
2725
import com.github.hexocraftapi.util.PlayerUtil;
2826
import org.bukkit.Location;

0 commit comments

Comments
 (0)