Skip to content

Commit

Permalink
set facing direction
Browse files Browse the repository at this point in the history
  • Loading branch information
fechan committed May 12, 2020
1 parent d1dcdc4 commit 74b4c03
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ItemFrame;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -42,9 +43,12 @@ public void run() {
for (int y = 0; y < tiles[0].length; y++) {
Location backboardLocation = bottomNorthWestCorner.clone().add(x, y, 0);
this.world.getBlockAt(backboardLocation).setType(Material.OAK_PLANKS);
Location itemFrameLocation = backboardLocation.add(0, 0, 1);
this.world.getBlockAt(backboardLocation).setType(Material.AIR);
ItemFrame frame = (ItemFrame) this.world.spawnEntity(
backboardLocation.add(0, 0, 1), EntityType.ITEM_FRAME
);
itemFrameLocation, EntityType.ITEM_FRAME
);
frame.setFacingDirection(BlockFace.SOUTH);
frame.setItem(createMap(this.tiles[x][y]));
}
}
Expand Down

0 comments on commit 74b4c03

Please sign in to comment.