From 7ba6eeee6bbde703ba8a8ed09607709ea216ab53 Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Sun, 4 Mar 2012 11:30:26 -0800 Subject: [PATCH] [Version 0.7.5.9] - Quick event fix for latest dev builds - Fix for sign ClassCastException --- README | 3 +++ src/net/TheDgtl/Stargate/Portal.java | 7 ++++++- src/net/TheDgtl/Stargate/event/StargateEvent.java | 2 +- src/plugin.yml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README b/README index 5c88e95..564087d 100644 --- a/README +++ b/README @@ -201,6 +201,9 @@ createConflict=Gate conflicts with existing gate ============= Changes ============= +[Version 0.7.5.9] + - Quick event fix for latest dev builds + - Fix for sign ClassCastException [Version 0.7.5.8] - Fixed an exploit with pistons to destroy gates [Version 0.7.5.7] diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index b4d1f43..608e40a 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -590,6 +590,11 @@ public class Portal { } public final void drawSign() { + if (!(id.getBlock().getState() instanceof Sign)) { + Stargate.log.warning("[Stargate] Sign block is not a Sign object"); + Stargate.debug("Portal::drawSign", "Block: " + id.getBlock().getType() + " @ " + id.getBlock().getLocation()); + return; + } Sign sign = (Sign)id.getBlock().getState(); sign.setLine(0, "--" + name + "--"); int max = destinations.size() - 1; @@ -696,7 +701,7 @@ public class Portal { allPortalsNet.get(getNetwork().toLowerCase()).remove(getName().toLowerCase()); - if (id.getBlock().getType() == Material.WALL_SIGN) { + if (id.getBlock().getType() == Material.WALL_SIGN && id.getBlock().getState() instanceof Sign) { Sign sign = (Sign)id.getBlock().getState(); sign.setLine(0, getName()); sign.setLine(1, ""); diff --git a/src/net/TheDgtl/Stargate/event/StargateEvent.java b/src/net/TheDgtl/Stargate/event/StargateEvent.java index 1d59cbc..2c886d4 100644 --- a/src/net/TheDgtl/Stargate/event/StargateEvent.java +++ b/src/net/TheDgtl/Stargate/event/StargateEvent.java @@ -5,7 +5,7 @@ import net.TheDgtl.Stargate.Portal; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; -public class StargateEvent extends Event implements Cancellable { +public abstract class StargateEvent extends Event implements Cancellable { protected Portal portal; protected boolean cancelled; diff --git a/src/plugin.yml b/src/plugin.yml index 6173113..c80ece1 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.7.5.8 +version: 0.7.5.9 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net