Fix Nether Portal Creation on cancelled event

Spigot is manipulating the Travel Agents canCreatePortal, but forgot to reset it on cancel

This causes nether portals to not be generated if the event is ever cancelled
This commit is contained in:
chickeneer 2017-08-07 23:08:50 -04:00
parent 64b2b87256
commit 0e9f94b07a

View file

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: chickeneer <emcchickeneer@gmail.com>
Date: Mon, 7 Aug 2017 23:07:32 -0400
Subject: [PATCH] Fix Nether Portal Creation on cancelled event
Spigot is manipulating the Travel Agents canCreatePortal, but forgot to reset it on cancel
This causes nether portals to not be generated if the event is ever cancelled
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 34ac15d5e..190bda020 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener {
event.useTravelAgent(useTravelAgent);
event.getEntity().getServer().getPluginManager().callEvent(event);
if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !this.isAlive()) {
+ agent.setCanCreatePortal(oldCanCreate); // Paper
return null;
}
exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo();
--