-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 98a1582
Showing
4 changed files
with
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vscode/ | ||
.idea/ | ||
*.class | ||
target/ |
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,50 @@ | ||
<?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>com.mefrreex.beehivefixer</groupId> | ||
<artifactId>beehivefixer</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<name>BeehiveFixer</name> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>jitpack.io</id> | ||
<url>https://jitpack.io</url> | ||
</repository> | ||
<repository> | ||
<id>opencollab-repository-maven-snapshots</id> | ||
<url>https://repo.opencollab.dev/maven-snapshots</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.github.PowerNukkitX</groupId> | ||
<artifactId>PowerNukkitX</artifactId> | ||
<version>master-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>clean package</defaultGoal> | ||
<finalName>${project.name}-${project.version}</finalName> | ||
<sourceDirectory>src/main/java</sourceDirectory> | ||
<resources> | ||
<resource> | ||
<filtering>true</filtering> | ||
<directory>src/main/resources/</directory> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
</project> |
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,24 @@ | ||
package com.mefrreex.beehivefixer; | ||
|
||
import cn.nukkit.blockentity.BlockEntityBeehive; | ||
import cn.nukkit.event.EventHandler; | ||
import cn.nukkit.event.Listener; | ||
import cn.nukkit.event.level.ChunkLoadEvent; | ||
import cn.nukkit.plugin.PluginBase; | ||
|
||
public class BeehiveFixer extends PluginBase implements Listener { | ||
|
||
@Override | ||
public void onEnable() { | ||
this.getServer().getPluginManager().registerEvents(this, this); | ||
} | ||
|
||
@EventHandler | ||
public void onChunkLoad(ChunkLoadEvent event) { | ||
event.getLevel().getBlockEntities().values().forEach(entity -> { | ||
if (entity instanceof BlockEntityBeehive) { | ||
entity.close(); | ||
} | ||
}); | ||
} | ||
} |
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,5 @@ | ||
name: "${project.name}" | ||
version: "${project.version}" | ||
api: ["2.0.0"] | ||
author: MEFRREEX | ||
main: com.mefrreex.beehivefixer.BeehiveFixer |