Commit 39db3ea0 authored by kellerkindt's avatar kellerkindt
Browse files

Make it compile for bukkit 1.13.2

parent fccc4caf
Pipeline #111 passed with stage
in 6 seconds
......@@ -7,7 +7,7 @@
<src_folder value="file://$MODULE_DIR$/lib" expected_position="1" />
</src_description>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
......@@ -20,26 +20,47 @@
<orderEntry type="library" name="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" level="application" />
<orderEntry type="library" name="Maven: org.mcstats:metrics:1.2-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.9-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:17.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Maven: org.mcstats.bukkit:metrics:R8-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.ess3:Essentials:2.14-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-bukkit:7.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-core:7.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:jchronic:0.2.4a" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.1.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.thoughtworks.paranamer:paranamer:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.lib:jlibnoise:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:dummypermscompat:1.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-bukkit:1.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-legacy:7.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-core:7.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.intake:intake:4.2-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:squirrelid:0.2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.flywaydb:flyway-core:3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.khelekore:prtree:1.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="module-library">
<library name="Maven: me.minebuilders:clearlag-core:UNKNOWN">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/Clearlag.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: local:BOSEconomy:UNKNOWN">
<CLASSES>
......
......@@ -89,7 +89,7 @@
<file>${project.basedir}/target/classes/plugin.yml</file>
<replacements>
<replacement>
<token>version: [\d.]*</token>
<token>version: ([-]?[\d.]+)*</token>
<value>version: ${build.number}</value>
</replacement>
<replacement>
......@@ -169,36 +169,28 @@
</profile>
</profiles>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
<repository>
<id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/</url>
<url>http://repo.ess3.net/content/groups/essentials/</url>
</repository>
<repository>
<id>Vault</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases/</url>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>sk89q</id>
<url>http://maven.sk89q.com/artifactory/libs-snapshot-local/</url>
<url>http://maven.sk89q.com/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
......@@ -217,10 +209,6 @@
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>ebean</artifactId>
<groupId>org.avaje</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
......@@ -236,129 +224,136 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>6.0.0-SNAPSHOT</version>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.0.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>truezip</artifactId>
<groupId>de.schlichtherle</groupId>
<artifactId>worldedit-core</artifactId>
<groupId>com.sk89q.worldedit</groupId>
</exclusion>
<exclusion>
<artifactId>js</artifactId>
<groupId>rhino</groupId>
<artifactId>dummypermscompat</artifactId>
<groupId>com.sk89q</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
<artifactId>bstats-bukkit</artifactId>
<groupId>org.bstats</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
<artifactId>paperlib</artifactId>
<groupId>io.papermc</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.1.1-SNAPSHOT</version>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-legacy</artifactId>
<version>7.0.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>bukkit-classloader-check</artifactId>
<groupId>com.sk89q.spigot</groupId>
<artifactId>worldguard-core</artifactId>
<groupId>com.sk89q.worldguard</groupId>
</exclusion>
<exclusion>
<artifactId>commandbook</artifactId>
<groupId>com.sk89q</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
<artifactId>bstats-bukkit</artifactId>
<groupId>org.bstats</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>me.minebuilders</groupId>
<artifactId>clearlag-core</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/Clearlag.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>BOSEconomy</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/BOSEconomy.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/BOSEconomy.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>DropChest</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/DropChest.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/DropChest.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>DropChest-0.8.2</artifactId>
<version>0.8.2</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/DropChest_0.8.2.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/DropChest_0.8.2.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>DropChest-NH</artifactId>
<version>NH</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/DropChest-NH.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/DropChest-NH.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>HyperConomy</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/HyperConomy.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/HyperConomy.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>iConomy</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/iConomy.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/iConomy.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>iConomy6</artifactId>
<version>6</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/iConomy6.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/iConomy6.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>iConomy8</artifactId>
<version>8</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/iConomy8.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/iConomy8.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>Residence</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/Residence.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/Residence.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>Towny</artifactId>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/Towny.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/Towny.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>FBasics</artifactId>
<version>2.1.3</version>
<scope>system</scope>
<systemPath>/share/home/michael/java/Minecraft/ShowCaseStandalone/lib/FBasics_2.1.3.jar</systemPath>
<systemPath>/share/home/michael/projects/java.Minecraft/ShowCaseStandalone/lib/FBasics_2.1.3.jar</systemPath>
</dependency>
</dependencies>
<distributionManagement>
......@@ -368,15 +363,15 @@
</repository>
</distributionManagement>
<properties>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<build.builder>UNKNOWN</build.builder>
<build.number>-1</build.number>
<build.date>${maven.build.timestamp}</build.date>
<repository.url>${repository.url.host}${repository.url.path}</repository.url>
<version.java.source>1.8</version.java.source>
<version.java.output>1.8</version.java.output>
<repository.url.host>https://dl.tallbyte.com/</repository.url.host>
<version.java.output>1.6</version.java.output>
<repository.url>${repository.url.host}${repository.url.path}</repository.url>
<build.date>${maven.build.timestamp}</build.date>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<repository.url.path>pub/mvn/</repository.url.path>
<version.java.source>1.8</version.java.source>
<build.number>${maven.build.timestamp}-custom</build.number>
<build.builder>UNKNOWN</build.builder>
</properties>
</project>
......@@ -206,11 +206,13 @@
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- getting HTTP 500
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
-->
<!-- essentials -->
<repository>
......@@ -230,10 +232,6 @@
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository>
<id>minebuilders-repo</id>
<url>http://minebuilders.me:8080/plugin/repository/everything/</url>
</repository>
</repositories>
<dependencies>
......@@ -243,7 +241,7 @@
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<scope>provided</scope>
<version>1.13-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
</dependency>
<!-- mcstats / metrics -->
......@@ -267,7 +265,7 @@
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<scope>provided</scope>
<version>1.6</version>
<version>1.7</version>
</dependency>
<!-- WorldEdit -->
......@@ -275,26 +273,29 @@
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<scope>provided</scope>
<version>6.1.5</version>
<version>7.0.0-SNAPSHOT</version>
</dependency>
<!-- WorldGuard -->
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-legacy</artifactId>
<scope>provided</scope>
<version>6.1.1-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</dependency>
<!-- local -->
<dependency>
<groupId>me.minebuilders</groupId>
<artifactId>clearlag-core</artifactId>
<version>2.9.0-SNAPSHOT</version>
<version>UNKNOWN</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Clearlag.jar</systemPath>
</dependency>
<!-- local -->
<dependency>
<groupId>local</groupId>
<artifactId>BOSEconomy</artifactId>
......
......@@ -25,6 +25,7 @@ import java.util.Set;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.command.CommandSender;
import com.kellerkindt.scs.ShowCaseStandalone;
......@@ -69,17 +70,14 @@ public class Repair extends SimpleCommand {
for ( Shop shop : this.scs.getShopHandler() ) {
//get blocks
Block shopBlock = shop.getBlock();
Block itemBlock = shopBlock.getWorld().getBlockAt( shopBlock.getX(), shopBlock.getY() + 1, shopBlock.getZ() );
Block itemBlock = shopBlock.getRelative(BlockFace.UP);
//decide what to do with a shop
if ( shopBlock.getTypeId() == 0 && itemBlock.getTypeId() != 0 ) {
deleteable.add( shop );
} else if ( shopBlock.getTypeId() == 0 ) {
restoreable.add( shop );
} else if ( itemBlock.getTypeId() != 0 ) {
deleteable.add( shop );
if (shop.getItemStack() == null || shop.getItemStack().getType() == null || !shop.getItemStack().getType().isItem()) {
deleteable.add(shop);
} else {
restoreable.add(shop);
}
}
if ( args.length < 1 ) {
......@@ -96,7 +94,8 @@ public class Repair extends SimpleCommand {
//restore
for ( Shop shop : restoreable ) {
shop.getBlock().setType( Material.BEDROCK );
shop.getBlock().setType( Material.STONE );
shop.getBlock().getRelative(BlockFace.UP).setType(Material.AIR);
}
// items may moved after block was set
......
......@@ -37,109 +37,89 @@ import org.bukkit.event.hanging.HangingPlaceEvent;
import com.kellerkindt.scs.ShowCaseStandalone;
public class BlockListener implements Listener{
private ShowCaseStandalone scs;
public class BlockListener implements Listener {
private ShowCaseStandalone scs;
public BlockListener(ShowCaseStandalone scs) {
this.scs = scs;
this.scs = scs;
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
public void onBlockPlace (BlockPlaceEvent e) {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent e) {
if (scs.getShopHandler().isShopBlock(e.getBlock())) {
// allow placing blocks to restore glitched shops
// e.setCancelled(true);
// still forbid black listed blocks
if (!e.getBlock().getType().isSolid()
|| !e.getBlock().getType().isBlock()
|| scs.getConfiguration().isBlockListBlacklist() == scs.getConfiguration().getBlockListBlocks().contains(e.getBlock().getType().toString())) {
|| !e.getBlock().getType().isBlock()
|| scs.getConfiguration().isBlockListBlacklist() == scs.getConfiguration()
.getBlockListBlocks()
.contains(e.getBlock().getType().toString())) {
e.setCancelled(true);
scs.sendMessage(e.getPlayer(), Term.BLACKLIST_BLOCK.get());
}
} else if ( scs.getShopHandler().isShopBlock(e.getBlockPlaced().getLocation().subtract(0, 1, 0).getBlock()) ){
//This is the block above.
//CHeck for attchables for the block being placed.
if(!(Material.STEP.equals(e.getBlockPlaced().getLocation().subtract(0, 1, 0).getBlock().getType())))
e.setCancelled(true);
}
// // Quick and Dirty...
// else if (e.getBlock().getState() instanceof CraftSign) {
// try {
// Block block = Utilities.getBlockBehind((Sign)e.getBlock().getState());
// Shop shop = null;
//
// if (block != null)
// shop = scs.getShopHandler().getShopForBlock(block);
//
// scs.performShowCaseChangedEvent(shop, e.getPlayer());
//
// } catch (ShopNotFoundException snfe) { }
// }
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
public void onBlockBreak (BlockBreakEvent e) {
if ( scs.getShopHandler().isShopBlock(e.getBlock())) {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent e) {
if (scs.getShopHandler().isShopBlock(e.getBlock())) {
e.setCancelled(true);
}
}
@EventHandler (priority = EventPriority.NORMAL)
public void onHangingPlaced (HangingPlaceEvent event) {
@EventHandler(priority = EventPriority.NORMAL)
public void onHangingPlaced(HangingPlaceEvent event) {
// BlockState
Hanging hanging = event.getEntity();
Hanging hanging = event.getEntity();
// ItemFrame?
if (hanging instanceof ItemFrame) {
scs.getShopHandler().addItemFrame((ItemFrame)hanging);
scs.getShopHandler().addItemFrame((ItemFrame) hanging);
}
}
@EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onEntityDamage (EntityDamageEvent event) {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onEntityDamage(EntityDamageEvent event) {
if (event.getEntity() instanceof ItemFrame) {
ItemFrame frame = (ItemFrame)event.getEntity();
ItemFrame frame = (ItemFrame) event.getEntity();
// is the block below a shop block?
if (scs.getShopHandler().isKnownItemFrame(frame)) {
frame.setItem(null);
}
}
}
@EventHandler (priority = EventPriority.NORMAL)
public void onHangingBreak (HangingBreakEvent event) {
@EventHandler(priority = EventPriority.NORMAL)
public void onHangingBreak(HangingBreakEvent event) {
// BlockState
Hanging hanging = event.getEntity();
Hanging hanging = event.getEntity();
// ItemFrame?
if (hanging instanceof ItemFrame) {
scs.getShopHandler().removeItemFrame((ItemFrame)hanging);
scs.getShopHandler().removeItemFrame((ItemFrame) hanging);
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
public void onBlockPistonExtend (BlockPistonExtendEvent e) {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockPistonExtend(BlockPistonExtendEvent e) {
for (Block b : e.getBlocks()) {
if ( scs.getShopHandler().isShopBlock(b) ) {
if (scs.getShopHandler().isShopBlock(b)) {
e.setCancelled(true);
}
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockPistonRetract(BlockPistonRetractEvent e) {
if ( scs.getShopHandler().isShopBlock(e.getRetractLocation().getBlock()) ) {
if (scs.getShopHandler().isShopBlock(e.getRetractLocation().getBlock())) {
e.setCancelled(true);
}
}
......
......@@ -17,8 +17,16 @@
*/
package com.kellerkindt.scs.listeners;
import com.kellerkindt.scs.ShowCaseStandalone;
import com.kellerkindt.scs.events.ShowCaseCreateEvent;
import com.kellerkindt.scs.exceptions.InsufficientPermissionException;
import com.kellerkindt.scs.utilities.Term;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
......@@ -26,27 +34,23 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;