diff --git a/pom.xml b/pom.xml
index 22de8ed..41fd796 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
de.craftlancer.imagemaps
ImageMaps
- 0.5.0-SNAPSHOT
+ 0.4.1
ImageMaps
Draw Images on maps!
diff --git a/src/main/java/de/craftlancer/imagemaps/ImageMaps.java b/src/main/java/de/craftlancer/imagemaps/ImageMaps.java
index 5ce8663..163d82c 100644
--- a/src/main/java/de/craftlancer/imagemaps/ImageMaps.java
+++ b/src/main/java/de/craftlancer/imagemaps/ImageMaps.java
@@ -156,10 +156,21 @@ public class ImageMaps extends JavaPlugin implements Listener
private void setItemFrame(Block bb, BufferedImage image, BlockFace face, int x, int y, PlacingCacheEntry cache)
{
- bb.setType(Material.AIR);
- ItemFrame i = bb.getWorld().spawn(bb.getRelative(face.getOppositeFace()).getLocation(), ItemFrame.class);
- i.teleport(bb.getLocation());
- i.setFacingDirection(face, true);
+ ItemFrame i;
+ String cbPackage = getServer().getClass().getPackage().getName();
+ String version = cbPackage.substring(cbPackage.lastIndexOf('.') + 1);
+ if (version.startsWith("v1_8"))
+ {
+ i = bb.getWorld().spawn(bb.getLocation(), ItemFrame.class);
+ i.setFacingDirection(face, false);
+ }
+ else
+ {
+ bb.setType(Material.AIR);
+ i = bb.getWorld().spawn(bb.getRelative(face.getOppositeFace()).getLocation(), ItemFrame.class);
+ i.teleport(bb.getLocation());
+ i.setFacingDirection(face, true);
+ }
ItemStack item = getMapItem(cache.getImage(), x, y, image);
i.setItem(item);