-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module version="4"> | ||
<component name="FacetManager"> | ||
<facet type="minecraft" name="Minecraft"> | ||
<configuration> | ||
<autoDetectTypes> | ||
<platformType>PAPER</platformType> | ||
</autoDetectTypes> | ||
<projectReimportVersion>1</projectReimportVersion> | ||
</configuration> | ||
</facet> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.unitedlands</groupId> | ||
<artifactId>CrafterBlocker</artifactId> | ||
<version>1.1</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>CrafterBlocker</name> | ||
|
||
<properties> | ||
<java.version>21</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
<defaultGoal>clean package</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.13.0</version> | ||
<configuration> | ||
<source>${java.version}</source> | ||
<target>${java.version}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.5.3</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>papermc-repo</id> | ||
<url>https://repo.papermc.io/repository/maven-public/</url> | ||
</repository> | ||
<repository> | ||
<id>sonatype</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.papermc.paper</groupId> | ||
<artifactId>paper-api</artifactId> | ||
<version>1.21.1-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.unitedlands.crafterBlocker; | ||
|
||
import org.bukkit.Material; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.block.CrafterCraftEvent; | ||
import org.bukkit.event.block.BlockPlaceEvent; | ||
|
||
public final class CrafterBlocker extends JavaPlugin implements Listener { | ||
|
||
private static final String CRAFTER_DISABLED_MESSAGE = "§c§lU§f§lL §7§lCore §8§l» §cCrafters have been temporarily disabled."; | ||
|
||
@Override | ||
public void onEnable() { | ||
// Plugin startup logic. | ||
// Registering event listeners. | ||
getServer().getPluginManager().registerEvents(this, this); | ||
getLogger().info("CrafterBlocker has been enabled."); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
// Plugin shutdown logic. | ||
getLogger().info("CrafterBlocker has been disabled."); | ||
} | ||
|
||
@EventHandler | ||
public void onBlockPlace(BlockPlaceEvent event) { | ||
// Check if the block placed is a crafter. | ||
if (event.getBlockPlaced().getType() == Material.CRAFTER) { | ||
event.getPlayer().sendMessage(CRAFTER_DISABLED_MESSAGE); | ||
} | ||
} | ||
|
||
@EventHandler | ||
public void onCrafterCraft(CrafterCraftEvent event) { | ||
// Cancel the crafting event. | ||
event.setCancelled(true); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: CrafterBlocker | ||
version: '1.1' | ||
main: org.unitedlands.crafterBlocker.CrafterBlocker | ||
api-version: '1.21' | ||
authors: [Litning11] | ||
description: A plugin that disables Crafter blocks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: CrafterBlocker | ||
version: '1.1' | ||
main: org.unitedlands.crafterBlocker.CrafterBlocker | ||
api-version: '1.21' | ||
authors: [Litning11] | ||
description: A plugin that disables Crafter blocks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
artifactId=CrafterBlocker | ||
groupId=org.unitedlands | ||
version=1.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org\unitedlands\crafterBlocker\CrafterBlocker.class |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C:\Users\dario\IdeaProjects\CrafterBlocker\src\main\java\org\unitedlands\crafterBlocker\CrafterBlocker.java |