Slight adjustment to Sataniel's fixes to preserve tab-based indentation for easy merge compare.

This commit is contained in:
ProgrammerDan 2016-04-18 18:15:30 -04:00
parent ddaa2bdbfc
commit 2d0d059008
5 changed files with 779 additions and 763 deletions

16
.editorconfig Normal file
View File

@ -0,0 +1,16 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.java]
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
[*.yml]
indent_style = spaces
indent_size = 2
trim_trailing_whitespace = true

204
pom.xml
View File

@ -1,111 +1,111 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dre</groupId>
<artifactId>brewery</artifactId>
<version>1.4-SNAPSHOT</version>
<name>Brewery</name>
<groupId>com.dre</groupId>
<artifactId>brewery</artifactId>
<version>1.4-SNAPSHOT</version>
<name>Brewery</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<!-- Static resources -->
<resource>
<filtering>false</filtering>
<directory>${project.basedir}/resources</directory>
<includes>
<include>**/*.yml</include>
</includes>
<excludes>
<exclude>target/**</exclude>
<exclude>.travis.yml</exclude>
</excludes>
</resource>
</resources>
<resources>
<!-- Static resources -->
<resource>
<filtering>false</filtering>
<directory>${project.basedir}/resources</directory>
<includes>
<include>**/*.yml</include>
</includes>
<excludes>
<exclude>target/**</exclude>
<exclude>.travis.yml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
<repository>
<id>dre2n-repo</id>
<url>http://feuerstern.bplaced.net/repo/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/artifactory/repo/</url>
</repository>
<repository>
<id>addstar-repo</id>
<url>http://maven.addstar.com.au/artifactory/ext-release-local/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
</repositories>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
<repository>
<id>dre2n-repo</id>
<url>http://feuerstern.bplaced.net/repo/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/artifactory/repo/</url>
</repository>
<repository>
<id>addstar-repo</id>
<url>http://maven.addstar.com.au/artifactory/ext-release-local/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>md_5-releases</id>
<url>http://repo.md-5.net/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.1</version>
</dependency>
<dependency>
<groupId>com.griefcraft</groupId>
<artifactId>entitylwc</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>me.ryanhamshire</groupId>
<artifactId>GriefPrevention</artifactId>
<version>13.9.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.diddiz</groupId>
<artifactId>logblock</artifactId>
<version>1.94</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.1</version>
</dependency>
<dependency>
<groupId>com.griefcraft</groupId>
<artifactId>entitylwc</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>me.ryanhamshire</groupId>
<artifactId>GriefPrevention</artifactId>
<version>13.9.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.diddiz</groupId>
<artifactId>logblock</artifactId>
<version>1.94</version>
</dependency>
</dependencies>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -9,39 +9,39 @@ import org.bukkit.entity.Player;
public class GriefPreventionBarrel {
static P brewery = P.p;
static GriefPrevention griefPrevention = GriefPrevention.instance;
static P brewery = P.p;
static GriefPrevention griefPrevention = GriefPrevention.instance;
public static boolean checkAccess(Player player, Block sign) {
PlayerData playerData = griefPrevention.dataStore.getPlayerData(player.getUniqueId());
public static boolean checkAccess(Player player, Block sign) {
PlayerData playerData = griefPrevention.dataStore.getPlayerData(player.getUniqueId());
if (!griefPrevention.claimsEnabledForWorld(player.getWorld()) || playerData.ignoreClaims || !griefPrevention.config_claims_preventTheft) {
return true;
}
if (!griefPrevention.claimsEnabledForWorld(player.getWorld()) || playerData.ignoreClaims || !griefPrevention.config_claims_preventTheft) {
return true;
}
// block container use during pvp combat
if (playerData.inPvpCombat()) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
// block container use during pvp combat
if (playerData.inPvpCombat()) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
// check permissions for the claim the Barrel is in
Claim claim = griefPrevention.dataStore.getClaimAt(sign.getLocation(), false, playerData.lastClaim);
if (claim != null) {
playerData.lastClaim = claim;
String noContainersReason = claim.allowContainers(player);
if (noContainersReason != null) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
}
// check permissions for the claim the Barrel is in
Claim claim = griefPrevention.dataStore.getClaimAt(sign.getLocation(), false, playerData.lastClaim);
if (claim != null) {
playerData.lastClaim = claim;
String noContainersReason = claim.allowContainers(player);
if (noContainersReason != null) {
brewery.msg(player, brewery.languageReader.get("Error_NoBarrelAccess"));
return false;
}
}
// drop any pvp protection, as the player opens a barrel
if (playerData.pvpImmune) {
playerData.pvpImmune = false;
}
// drop any pvp protection, as the player opens a barrel
if (playerData.pvpImmune) {
playerData.pvpImmune = false;
}
return true;
}
return true;
}
}

View File

@ -11,21 +11,21 @@ import org.bukkit.inventory.meta.PotionMeta;
// Workaround to remove unwanted potion effects
public class Compat1_9 implements Listener {
@EventHandler
public void onPlayerDrink(PlayerItemConsumeEvent event) {
ItemStack item = event.getItem();
Brew brew = Brew.get(item);
if (brew == null) {
return;
}
@EventHandler
public void onPlayerDrink(PlayerItemConsumeEvent event) {
ItemStack item = event.getItem();
Brew brew = Brew.get(item);
if (brew == null) {
return;
}
if (item.getType() == Material.POTION) {
try {
PotionMeta meta = (PotionMeta) item.getItemMeta();
meta.setMainEffect(null);
item.setItemMeta(meta);
} catch (Exception exception) {}
}
}
if (item.getType() == Material.POTION) {
try {
PotionMeta meta = (PotionMeta) item.getItemMeta();
meta.setMainEffect(null);
item.setItemMeta(meta);
} catch (Exception exception) {}
}
}
}