Skip to content

Commit

Permalink
[Version 5.7]
Browse files Browse the repository at this point in the history
  - Add support for Slimefun's Soulbound items - these are no longer
placed into cenotaphs.
  • Loading branch information
LlmDl committed Jan 1, 2020
1 parent 3acd366 commit ed752c2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ LlmDl: I helped with lockette support on earlier versions and did some major cha
=============
Changes
=============
[Version 5.7]
- Add support for Slimefun's Soulbound items - these are no longer placed into cenotaphs.
[Version 5.6]
- Add CAVE_AIR & BUBBLE_COLUMN to replaceable materials list.
[Version 5.5]
Expand Down
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>MoofIT</groupId>
<artifactId>Cenotaph</artifactId>
<packaging>jar</packaging>
<version>5.6</version>
<version>5.7</version>

<properties>
<project.bukkitAPIVersion>1.14</project.bukkitAPIVersion>
Expand All @@ -34,6 +34,10 @@
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>


Expand Down Expand Up @@ -78,7 +82,13 @@
<artifactId>holographicdisplays-api</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
</dependency>
<dependency>
<groupId>com.github.TheBusyBiscuit</groupId>
<artifactId>Slimefun4</artifactId>
<version>master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/MoofIT/Minecraft/Cenotaph/Cenotaph.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class Cenotaph extends JavaPlugin {
private String version = "2.0.0";
public static Economy econ = null;
public static boolean isSpigot = false;
public static boolean slimefunEnabled = false;
private String hooked = "";

@Override
Expand All @@ -102,6 +103,7 @@ public void onEnable() {
dynmapEnabled = setupDynmap();
worldguardEnabled = setupWorldGuard();
hologramsEnabled = setupHolograms();
slimefunEnabled = setupSlimefun();

for (World w : getServer().getWorlds())
CenotaphDatabase.loadTombList(w.getName());
Expand Down Expand Up @@ -187,6 +189,13 @@ private boolean setupHolograms() {
CenotaphMessaging.sendSevereConsoleMessage("Unabled to find HolographicDisplays. Holograms will not be used!");
return false;
}
private boolean setupSlimefun() {
if (pm.isPluginEnabled("Slimefun")) {
hooked += "SlimeFun, ";
return true;
}
return false;
}

@Override
public void onDisable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import com.MoofIT.Minecraft.Cenotaph.TombBlock;
import com.MoofIT.Minecraft.Cenotaph.PluginHandlers.HolographicDisplays;
import com.MoofIT.Minecraft.Cenotaph.PluginHandlers.WorldGuardWrapper;

import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import net.milkbowl.vault.economy.EconomyResponse;

public class CenotaphEntityListener implements Listener {
Expand Down Expand Up @@ -127,7 +129,7 @@ public void onEntityDeath(EntityDeathEvent event) {
int pChestCount = 0;
int pSignCount = 0;
for (ItemStack item : event.getDrops()) {
if (item == null) continue;
if (item == null) continue;
if (item.getType() == Material.CHEST) pChestCount += item.getAmount();
for(Material mat: Tag.SIGNS.getValues()) {
if(item.getType() == mat)
Expand Down Expand Up @@ -238,6 +240,8 @@ else if (CenotaphSettings.cenotaphSign() && p.hasPermission("cenotaph.sign") &&
for (Iterator<ItemStack> iter = event.getDrops().listIterator(); iter.hasNext();) {
ItemStack item = iter.next();
if (item == null) continue;
//if (item.hasItemMeta() && item.getItemMeta().hasLore() && item.getItemMeta().getLore().contains(Color.GRAY + "Soulbound")) continue;
if (Cenotaph.slimefunEnabled && SlimefunManager.isItemSoulbound(item)) continue;
// Take the chest(s)
if (removeChestCount > 0 && item.getType() == Material.CHEST) {
if (item.getAmount() >= removeChestCount) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Dead Man's Chest mod for Bukkit. Forked from Tombstone by Drakia (T
author: Southpaw018
authors: [cindyker, LlmDl]
website: http://www.moofit.com
softdepend: [WorldGuard, Vault, dynmap, HolographicDisplays]
softdepend: [WorldGuard, Vault, dynmap, HolographicDisplays, Slimefun]
api-version: ${project.bukkitAPIVersion}
commands:
cenlist:
Expand Down

0 comments on commit ed752c2

Please sign in to comment.