Skip to content

Commit

Permalink
Merge pull request #20 from PPGOME/master
Browse files Browse the repository at this point in the history
Rebased plugin onto paper, fixed allay culling.
  • Loading branch information
PPGOME authored Aug 8, 2024
2 parents eee138b + 79072ba commit 777bc6b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: ${project.version}
description: Control the mob population
authors: ["Travis Watkins", "redwall_hp"]
softdepend: ["LogBlock"]
api-version: '1.20'

main: nu.nerd.moblimiter.MobLimiter

Expand Down
13 changes: 7 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<groupId>nu.nerd</groupId>
<artifactId>MobLimiter</artifactId>
<version>2.1.2</version>
<version>2.1.3</version>


<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>md_5-releases</id>
Expand All @@ -37,9 +37,10 @@
<version>1.94</version>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
8 changes: 7 additions & 1 deletion src/nu/nerd/moblimiter/EntityHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static boolean isSpecialMob(LivingEntity entity) {
}

// Save the sponge!
if (entity.getType() == EntityType.GUARDIAN && ((Guardian)entity).isElder()) {
if (entity.getType() == EntityType.ELDER_GUARDIAN) {
return true;
}

Expand All @@ -68,6 +68,12 @@ public static boolean isSpecialMob(LivingEntity entity) {
return true;
}
}
// Don't cull allays who are holding items
if(entity.getType() == EntityType.ALLAY) {
if(equipment.getItemInMainHand() != null && equipment.getItemInMainHand().getType() != Material.AIR) {
return true;
}
}

return false;

Expand Down

0 comments on commit 777bc6b

Please sign in to comment.