From f329051399fd3213421c66d5b92c8d9d77fe08c6 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Thu, 5 May 2016 18:25:51 -0400 Subject: [PATCH] Changed design of billboard and fixed its centering in hubs --- .../core/sponsorbranding/BrandingPost.java | 27 +++++++++++++++++-- .../hub/modules/BillboardManager.java | 2 +- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/sponsorbranding/BrandingPost.java b/Plugins/Mineplex.Core/src/mineplex/core/sponsorbranding/BrandingPost.java index 0abca904a..63ee5887c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/sponsorbranding/BrandingPost.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/sponsorbranding/BrandingPost.java @@ -3,6 +3,8 @@ package mineplex.core.sponsorbranding; import java.awt.image.BufferedImage; import java.util.List; +import mineplex.core.common.util.UtilMath; + import org.bukkit.Bukkit; import org.bukkit.DyeColor; import org.bukkit.Location; @@ -178,8 +180,29 @@ public class BrandingPost if (set.getBlock().getType() == Material.STAINED_CLAY) continue; - set.getBlock().setType(Material.WOOD); - set.getBlock().setData((byte)1); + if (UtilMath.offset2d(corner3.getBlock().getLocation(), set.getBlock().getLocation()) == 0 || UtilMath.offset2d(corner4.getBlock().getLocation(), set.getBlock().getLocation()) == 0) + { + if (corner3.getBlockY() != set.getBlockY() && corner4.getBlockY() != set.getBlockY()) + { + Material type = Material.COBBLE_WALL; + if (_center.getBlockY() == set.getBlockY()) + { + type = Material.FENCE; + } + + set.getBlock().setType(type); + continue; + } + } + + byte data = (byte)5; + if (set.getBlockY() == corner4.getBlockY()) + { + data = (byte)13; + } + + set.getBlock().setType(Material.STEP); + set.getBlock().setData(data); } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/BillboardManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/BillboardManager.java index 1bbd2b7d4..4c083a533 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/BillboardManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/BillboardManager.java @@ -31,7 +31,7 @@ public class BillboardManager extends MiniPlugin private void generateBoards() { - _branding.createPost(new Location(Bukkit.getWorld("world"), -2, 77, -33), BlockFace.SOUTH, "logitech.jpg"); + _branding.createPost(new Location(Bukkit.getWorld("world"), -5, 79, -35), BlockFace.SOUTH, "logitech.jpg"); } @EventHandler