mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
add configurable shovel flattenables
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 9 Jun 2021 11:03:40 -0500
|
||||
Subject: [PATCH] Add toggle for end portal safe teleporting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index fec109ee35c036f96be3cf19c65bb79d28bfb9f6..9e3eadf780cca5ef01b6c0c50e18a8cda8346a36 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3132,7 +3132,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.processPortalCooldown();
|
||||
- this.tickEndPortal(); // Paper - make end portalling safe
|
||||
+ if (this.level().purpurConfig.endPortalSafeTeleporting) this.tickEndPortal(); // Paper - make end portalling safe // Purpur
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index f80f6da484f4144e743079e5104bf503419074b2..2deddc746e43896584bd65ba8e7971a80acb4a4d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -61,6 +61,22 @@ public class EndPortalBlock extends BaseEntityBlock {
|
||||
// return; // CraftBukkit - always fire event in case plugins wish to change it
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (!world.purpurConfig.endPortalSafeTeleporting) {
|
||||
+ // CraftBukkit start - Entity in portal
|
||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (entity instanceof ServerPlayer) {
|
||||
+ ((ServerPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ entity.changeDimension(worldserver);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start - move all of this logic into portal tick
|
||||
entity.portalWorld = ((ServerLevel)world);
|
||||
entity.portalBlock = pos.immutable();
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index abed84824b2735d5c68b63e230c60d58968280fa..63d06d68eda596fd2a434f48eb712eb5a39d3cc8 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -637,6 +637,11 @@ public class PurpurWorldConfig {
|
||||
furnaceUseLavaFromUnderneath = getBoolean("blocks.furnace.use-lava-from-underneath", furnaceUseLavaFromUnderneath);
|
||||
}
|
||||
|
||||
+ public boolean endPortalSafeTeleporting = true;
|
||||
+ private void endPortalSettings() {
|
||||
+ endPortalSafeTeleporting = getBoolean("blocks.end_portal.safe-teleporting", endPortalSafeTeleporting);
|
||||
+ }
|
||||
+
|
||||
public boolean mobsSpawnOnPackedIce = true;
|
||||
public boolean mobsSpawnOnBlueIce = true;
|
||||
private void iceSettings() {
|
||||
Reference in New Issue
Block a user