mirror of
https://github.com/SydMontague/ImageMaps.git
synced 2024-11-26 04:15:16 +01:00
Added compatibility for Spigot's 1.8 CraftBukkit builds.
This commit is contained in:
parent
6b32d60a73
commit
bce3907086
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.craftlancer.imagemaps</groupId>
|
<groupId>de.craftlancer.imagemaps</groupId>
|
||||||
<artifactId>ImageMaps</artifactId>
|
<artifactId>ImageMaps</artifactId>
|
||||||
<version>0.5.0-SNAPSHOT</version>
|
<version>0.4.1</version>
|
||||||
<name>ImageMaps</name>
|
<name>ImageMaps</name>
|
||||||
<description>Draw Images on maps!</description>
|
<description>Draw Images on maps!</description>
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -155,11 +155,22 @@ public class ImageMaps extends JavaPlugin implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setItemFrame(Block bb, BufferedImage image, BlockFace face, int x, int y, PlacingCacheEntry cache)
|
private void setItemFrame(Block bb, BufferedImage image, BlockFace face, int x, int y, PlacingCacheEntry cache)
|
||||||
|
{
|
||||||
|
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);
|
bb.setType(Material.AIR);
|
||||||
ItemFrame i = bb.getWorld().spawn(bb.getRelative(face.getOppositeFace()).getLocation(), ItemFrame.class);
|
i = bb.getWorld().spawn(bb.getRelative(face.getOppositeFace()).getLocation(), ItemFrame.class);
|
||||||
i.teleport(bb.getLocation());
|
i.teleport(bb.getLocation());
|
||||||
i.setFacingDirection(face, true);
|
i.setFacingDirection(face, true);
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack item = getMapItem(cache.getImage(), x, y, image);
|
ItemStack item = getMapItem(cache.getImage(), x, y, image);
|
||||||
i.setItem(item);
|
i.setItem(item);
|
||||||
|
Loading…
Reference in New Issue
Block a user