Resolve issue with buttons not staying on Glowstone
This commit is contained in:
parent
202c7f3d55
commit
2ee9e53fe0
2
README
2
README
@ -210,7 +210,7 @@ createConflict=Gate conflicts with existing gate
|
||||
Unable to reproduce: Stargates teleport a user into the ground/under the ground
|
||||
Bukkit Issue: Stargate will randomly NPE when drawing a sign. Long-standing Bukkit
|
||||
issue, that they just made worse by disallowing me to override the
|
||||
sign class.
|
||||
sign class. This won't actually affect Stargate use.
|
||||
|
||||
=============
|
||||
Changes
|
||||
|
@ -31,6 +31,7 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.Event.Result;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -1121,14 +1122,18 @@ public class Stargate extends JavaPlugin {
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||
// Only check for gates if it's a portal block
|
||||
Block block = event.getBlock();
|
||||
if (block.getTypeId() != 90) return;
|
||||
Portal portal = null;
|
||||
|
||||
Portal portal = Portal.getByEntrance(block);
|
||||
// Handle keeping portal material and buttons around
|
||||
if (block.getTypeId() == 90) {
|
||||
portal = Portal.getByEntrance(block);
|
||||
} else if (block.getTypeId() == 77) {
|
||||
portal = Portal.getByControl(block);
|
||||
}
|
||||
if (portal != null) event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
Portal portal = Portal.getByEntrance(event.getBlock());
|
||||
|
Loading…
Reference in New Issue
Block a user