mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Add turtle egg block options
This commit is contained in:
committed by
granny
parent
320d145f74
commit
7d3e69b342
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
+++ b/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
@@ -192,9 +_,25 @@
|
||||
}
|
||||
|
||||
private boolean canDestroyEgg(ServerLevel level, Entity entity) {
|
||||
- return !(entity instanceof Turtle)
|
||||
- && !(entity instanceof Bat)
|
||||
- && entity instanceof LivingEntity
|
||||
- && (entity instanceof Player || level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING));
|
||||
+ // Purpur start - Add turtle egg block options
|
||||
+ if (entity instanceof Turtle || entity instanceof Bat) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (level.purpurConfig.turtleEggsBreakFromExpOrbs && entity instanceof net.minecraft.world.entity.ExperienceOrb) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (level.purpurConfig.turtleEggsBreakFromItems && entity instanceof net.minecraft.world.entity.item.ItemEntity) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (level.purpurConfig.turtleEggsBreakFromMinecarts && entity instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (!(entity instanceof LivingEntity)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (entity instanceof Player) return true;
|
||||
+
|
||||
+ return level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
+ // Purpur end - Add turtle egg block options
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user