summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-11-21 16:19:56 -0600
committerfeildmaster <admin@feildmaster.com>2012-11-21 16:19:56 -0600
commitf0325da814e5681e937e0586c508aac5f9835e8c (patch)
tree88e9b25ad3c3b9e3c15de9a796ee6fd218915c75 /src/main/java/net
parent45e891959890a1fd7dd8174ec7fb7977356e1e6b (diff)
downloadcraftbukkit-f0325da814e5681e937e0586c508aac5f9835e8c.tar
craftbukkit-f0325da814e5681e937e0586c508aac5f9835e8c.tar.gz
craftbukkit-f0325da814e5681e937e0586c508aac5f9835e8c.tar.lz
craftbukkit-f0325da814e5681e937e0586c508aac5f9835e8c.tar.xz
craftbukkit-f0325da814e5681e937e0586c508aac5f9835e8c.zip
Add ItemMapEmpty for diff visibility
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/ItemMapEmpty.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemMapEmpty.java b/src/main/java/net/minecraft/server/ItemMapEmpty.java
new file mode 100644
index 00000000..7bab738a
--- /dev/null
+++ b/src/main/java/net/minecraft/server/ItemMapEmpty.java
@@ -0,0 +1,34 @@
+package net.minecraft.server;
+
+public class ItemMapEmpty extends ItemWorldMapBase {
+
+ protected ItemMapEmpty(int i) {
+ super(i);
+ this.a(CreativeModeTab.f);
+ }
+
+ public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
+ ItemStack itemstack1 = new ItemStack(Item.MAP, 1, world.b("map"));
+ String s = "map_" + itemstack1.getData();
+ WorldMap worldmap = new WorldMap(s);
+
+ world.a(s, (WorldMapBase) worldmap);
+ worldmap.scale = 0;
+ int i = 128 * (1 << worldmap.scale);
+
+ worldmap.centerX = (int) (Math.round(entityhuman.locX / (double) i) * (long) i);
+ worldmap.centerZ = (int) (Math.round(entityhuman.locZ / (double) i) * (long) i);
+ worldmap.map = (byte) world.worldProvider.dimension;
+ worldmap.c();
+ --itemstack.count;
+ if (itemstack.count <= 0) {
+ return itemstack1;
+ } else {
+ if (!entityhuman.inventory.pickup(itemstack1.cloneItemStack())) {
+ entityhuman.drop(itemstack1);
+ }
+
+ return itemstack;
+ }
+ }
+}