Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev committed Sep 13, 2024
1 parent 4e46546 commit af2d6f6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
31 changes: 13 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<packaging>jar</packaging>

<!-- Project Info -->
<description>Slimefun is a Spigot/Paper plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server.</description>
<description>Slimefun is a Paper plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server.</description>
<url>https://github.com/Slimefun/Slimefun4</url>

<properties>
Expand All @@ -29,8 +29,8 @@
<maven.compiler.testTarget>21</maven.compiler.testTarget>

<!-- Spigot properties -->
<spigot.version>1.20.6</spigot.version>
<spigot.javadocs>https://hub.spigotmc.org/javadocs/spigot/</spigot.javadocs>
<paper.version>1.21.1</paper.version>
<paper.javadocs>https://hub.spigotmc.org/javadocs/spigot/</paper.javadocs>

<!-- Default settings for sonarcloud.io -->
<sonar.projectKey>Slimefun_Slimefun4</sonar.projectKey>
Expand Down Expand Up @@ -367,6 +367,13 @@
<scope>compile</scope>
</dependency>

<!-- Paper -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
</dependency>

<!-- Testing dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -387,9 +394,10 @@
</dependency>
<!-- This needs to be before Spigot because MockBukkit will fail otherwise. -->
<dependency>
<groupId>com.github.MockBukkit</groupId>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit</artifactId>
<version>c7cc678834</version>
<!-- <version>3.123.0</version> -->
<version>dev-3fec4e7b</version>
<scope>test</scope>

<exclusions>
Expand All @@ -401,13 +409,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- Override Spigot with Paper tests as a CommandMap ctor which MockBukkit uses only exists on Paper but not in Spigot -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>

<!-- Third party plugin integrations / soft dependencies -->
<dependency>
Expand Down Expand Up @@ -515,12 +516,6 @@
<version>2.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public void lock() {

@Override
public ItemStack clone() {
return new SlimefunItemStack(id, this);
return new SlimefunItemStack(id, super.clone());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dev.lone.itemsadder.api.CustomBlock;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.ExplosionResult;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -78,7 +79,7 @@ private void breakBlocks(BlockBreakEvent e, Player p, ItemStack item, Block b, L
List<Block> blocksToDestroy = new ArrayList<>();

if (callExplosionEvent.getValue()) {
BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0);
BlockExplodeEvent blockExplodeEvent = createNewBlockExplodeEvent(b, blocks, 0);
Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent);

if (!blockExplodeEvent.isCancelled()) {
Expand Down Expand Up @@ -186,4 +187,12 @@ private void breakBlock(BlockBreakEvent e, Player p, ItemStack item, Block b, Li
damageItem(p, item);
}

private BlockExplodeEvent createNewBlockExplodeEvent(
Block block,
List<Block> blocks,
float yield
) {
// TODO: Support older vers
return new BlockExplodeEvent(block, block.getState(), blocks, yield, ExplosionResult.DESTROY);
}
}

0 comments on commit af2d6f6

Please sign in to comment.