mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes:26c37d99d5create random seeds for features using SecureRandom589bf2f1bfUpgrade gson to 2.8.8 (Closes #6370)0a6103597bGet entity default attributes (#6449)40057019e0Correctly inflate villager activation bounding box (#6798)e5f9241d15Left handed API (#6775)40ee63496cAdd advancement display API (#6175)9d570042edAdd ItemFactory#getMonsterEgg API (#6772)55ca459515rename method to getSpawnEggbb397ba74cAdd critical damage API (#6275)f47aeafe00Add Horse Animation API (#5599)7a0886180fAT & Mapping fixes (#6809)5553432644docs: Update gradle instructions for Java 16 (#6811) [ci skip]a1f49e4c60Fix command suggestion leak (#6592)9472d38f3cFix method name for Critical damage (#6813)
78 lines
4.0 KiB
Diff
78 lines
4.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
|
Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
index fdb3ab919a78221605257ae82bfd026346ce2ffb..e98fc3c235f9160f1928a8afb0d7991a6d3430cb 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
|
@@ -10,11 +10,15 @@ import net.minecraft.tags.BlockTags;
|
|
import net.minecraft.tags.Tag;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.EntityType;
|
|
+import net.minecraft.world.entity.ExperienceOrb;
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
import net.minecraft.world.entity.ambient.Bat;
|
|
import net.minecraft.world.entity.animal.Turtle;
|
|
+import net.minecraft.world.entity.item.ItemEntity;
|
|
import net.minecraft.world.entity.monster.Zombie;
|
|
import net.minecraft.world.entity.player.Player;
|
|
+import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
|
+import net.minecraft.world.item.Item;
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
|
import net.minecraft.world.level.BlockGetter;
|
|
@@ -187,6 +191,23 @@ public class TurtleEggBlock extends Block {
|
|
}
|
|
|
|
private boolean canDestroyEgg(Level world, Entity entity) {
|
|
- return !(entity instanceof Turtle) && !(entity instanceof Bat) ? (!(entity instanceof LivingEntity) ? false : entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) : false;
|
|
+ // Purpur start - fix MC-168772
|
|
+ if (entity instanceof Turtle) {
|
|
+ return false;
|
|
+ }
|
|
+ if (!world.purpurConfig.turtleEggsBreakFromExpOrbs && entity instanceof ExperienceOrb) {
|
|
+ return false;
|
|
+ }
|
|
+ if (!world.purpurConfig.turtleEggsBreakFromItems && entity instanceof ItemEntity) {
|
|
+ return false;
|
|
+ }
|
|
+ if (!world.purpurConfig.turtleEggsBreakFromMinecarts && entity instanceof AbstractMinecart) {
|
|
+ return false;
|
|
+ }
|
|
+ if (entity instanceof LivingEntity && !(entity instanceof Player)) {
|
|
+ return world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
|
+ }
|
|
+ return true;
|
|
+ // Purpur end
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 8920b47610a323ceb6b19a05b7592d8acf809bc4..5b82c82da88f95190f8d7dc1f635fd27c8b513df 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -1079,7 +1079,10 @@ public class PurpurWorldConfig {
|
|
public boolean turtleRidable = false;
|
|
public boolean turtleRidableInWater = false;
|
|
public double turtleMaxHealth = 30.0D;
|
|
- private void turtleSettings() {
|
|
+ public boolean turtleEggsBreakFromExpOrbs = true;
|
|
+ public boolean turtleEggsBreakFromItems = true;
|
|
+ public boolean turtleEggsBreakFromMinecarts = true;
|
|
+ private void turtleEggSettings() {
|
|
turtleRidable = getBoolean("mobs.turtle.ridable", turtleRidable);
|
|
turtleRidableInWater = getBoolean("mobs.turtle.ridable-in-water", turtleRidableInWater);
|
|
if (PurpurConfig.version < 10) {
|
|
@@ -1088,6 +1091,9 @@ public class PurpurWorldConfig {
|
|
set("mobs.turtle.attributes.max_health", oldValue);
|
|
}
|
|
turtleMaxHealth = getDouble("mobs.turtle.attributes.max_health", turtleMaxHealth);
|
|
+ turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
|
|
+ turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
|
|
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
|
}
|
|
|
|
public boolean vexRidable = false;
|