-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<parent> | ||
<artifactId>SilkSpawners_v2</artifactId> | ||
<groupId>de.corneliusmay</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>SilkSpawners_v2-v1_20_R3</artifactId> | ||
<version>v1_20_R3</version> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.20.4-R0.1-SNAPSHOT</version> | ||
<type>jar</type> | ||
<scope>compile</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>de.corneliusmay</groupId> | ||
<artifactId>SilkSpawners_v2-API</artifactId> | ||
<version>API</version> | ||
<type>jar</type> | ||
<scope>compile</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
</project> |
30 changes: 30 additions & 0 deletions
30
v1_20_R3/src/main/java/de/corneliusmay/silkspawners/nms/v1_20_R3/NMSHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.corneliusmay.silkspawners.nms.v1_20_R3; | ||
|
||
import de.corneliusmay.silkspawners.api.NMS; | ||
import org.bukkit.Material; | ||
import org.bukkit.block.Block; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class NMSHandler implements NMS { | ||
|
||
@Override | ||
public Block getTargetBlock(Player player) { | ||
return player.getTargetBlockExact(5); | ||
} | ||
|
||
@Override | ||
public ItemStack[] getItemsInHand(Player player) { | ||
return new ItemStack[]{ player.getInventory().getItemInMainHand(), player.getInventory().getItemInOffHand() }; | ||
} | ||
|
||
@Override | ||
public Material getSpawnerMaterial() { | ||
return Material.SPAWNER; | ||
} | ||
|
||
@Override | ||
public Material getPlaceholderMaterial() { | ||
return Material.GRAY_STAINED_GLASS_PANE; | ||
} | ||
} |