Fix some flags being ignored

+ Bump version
This commit is contained in:
Eric 2018-11-03 21:13:06 +01:00
parent df4389ea36
commit eadc82ffe0
10 changed files with 51 additions and 19 deletions

View File

@ -21,7 +21,7 @@ How to include WorldEditWrapper into your maven project:
<dependency>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
```

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper-api</artifactId>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper-implementation-interface</artifactId>
@ -18,7 +18,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-api</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper-implementation</artifactId>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper-implementation-v6</artifactId>
@ -18,7 +18,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-interface</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>

View File

@ -8,6 +8,7 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.Event.Result;
import org.codemc.worldguardwrapper.event.AbstractWrappedEvent;
@NoArgsConstructor
@ -27,8 +28,13 @@ public class EventListener implements Listener {
worldGuardEvent.getBlocks(),
worldGuardEvent.getEffectiveMaterial());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
@EventHandler
public void onUseEntity(UseEntityEvent worldGuardEvent) {
@ -44,8 +50,13 @@ public class EventListener implements Listener {
worldGuardEvent.getTarget(),
worldGuardEvent.getEntity());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
@EventHandler
public void onDamageEntity(DamageEntityEvent worldGuardEvent) {
@ -61,7 +72,12 @@ public class EventListener implements Listener {
worldGuardEvent.getTarget(),
worldGuardEvent.getEntity());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper-implementation-v7</artifactId>
@ -18,7 +18,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-interface</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>

View File

@ -8,6 +8,7 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.Event.Result;
import org.codemc.worldguardwrapper.event.AbstractWrappedEvent;
@NoArgsConstructor
@ -27,8 +28,13 @@ public class EventListener implements Listener {
worldGuardEvent.getBlocks(),
worldGuardEvent.getEffectiveMaterial());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
@EventHandler
public void onUseEntity(UseEntityEvent worldGuardEvent) {
@ -44,8 +50,13 @@ public class EventListener implements Listener {
worldGuardEvent.getTarget(),
worldGuardEvent.getEntity());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
@EventHandler
public void onDamageEntity(DamageEntityEvent worldGuardEvent) {
@ -61,7 +72,12 @@ public class EventListener implements Listener {
worldGuardEvent.getTarget(),
worldGuardEvent.getEntity());
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.getResult() != Result.DEFAULT) {
// DEFAULT = Result probably has not been touched by the handler,
// so don't touch the original result either.
worldGuardEvent.setResult(event.getResult());
}
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>worldguardwrapper</artifactId>
@ -18,13 +18,13 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-v6</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-v7</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<optional>true</optional>
</dependency>
</dependencies>

View File

@ -6,7 +6,7 @@
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>