Update to Minecraft 1.3 beta
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import org.bukkit.block.BlockFace;
|
||||
@@ -349,7 +348,7 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public boolean isBlockFacePowered(BlockFace face) {
|
||||
return chunk.getHandle().d.j(x, y, z, blockFaceToNotch(face));
|
||||
return chunk.getHandle().d.i(x, y, z, blockFaceToNotch(face));
|
||||
}
|
||||
|
||||
public boolean isBlockFaceIndirectlyPowered(BlockFace face) {
|
||||
|
||||
80
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
Normal file → Executable file
80
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
Normal file → Executable file
@@ -1,40 +1,40 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityChest;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
/**
|
||||
* Represents a chest.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class CraftChest extends CraftBlockState implements Chest {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityChest chest;
|
||||
|
||||
public CraftChest(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
chest = (TileEntityChest)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
return new CraftInventory(chest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean force) {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
chest.d();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityChest;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
/**
|
||||
* Represents a chest.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class CraftChest extends CraftBlockState implements Chest {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityChest chest;
|
||||
|
||||
public CraftChest(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
chest = (TileEntityChest)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
return new CraftInventory(chest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean force) {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
chest.h();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,84 +1,84 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityMobSpawner;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.block.MobSpawner;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.MobType;
|
||||
|
||||
public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner, MobSpawner {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityMobSpawner spawner;
|
||||
|
||||
public CraftCreatureSpawner(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
spawner = (TileEntityMobSpawner)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public CreatureType getCreatureType() {
|
||||
return CreatureType.fromName(spawner.h);
|
||||
}
|
||||
|
||||
public void setCreatureType(CreatureType creatureType) {
|
||||
spawner.h = creatureType.getName();
|
||||
}
|
||||
|
||||
public String getCreatureTypeId() {
|
||||
return spawner.h;
|
||||
}
|
||||
|
||||
public void setCreatureTypeId(String creatureType) {
|
||||
// Verify input
|
||||
CreatureType type = CreatureType.fromName(creatureType);
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
spawner.h = type.getName();
|
||||
}
|
||||
|
||||
public int getDelay() {
|
||||
return spawner.e;
|
||||
}
|
||||
|
||||
public void setDelay(int delay) {
|
||||
spawner.e = delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use getCreatureType() instead.
|
||||
*/
|
||||
public MobType getMobType() {
|
||||
return MobType.fromName(spawner.h);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use setCreatureType() instead.
|
||||
*/
|
||||
public void setMobType(MobType mobType) {
|
||||
spawner.h = mobType.getName();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use getCreatureTypeId() instead.
|
||||
*/
|
||||
public String getMobTypeId() {
|
||||
return spawner.h;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use setCreatureTypeId() instead.
|
||||
*/
|
||||
public void setMobTypeId(String mobType) {
|
||||
// Verify input
|
||||
MobType type = MobType.fromName(mobType);
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
spawner.h = type.getName();
|
||||
}
|
||||
}
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityMobSpawner;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.block.MobSpawner;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.MobType;
|
||||
|
||||
public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner, MobSpawner {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityMobSpawner spawner;
|
||||
|
||||
public CraftCreatureSpawner(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
spawner = (TileEntityMobSpawner)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public CreatureType getCreatureType() {
|
||||
return CreatureType.fromName(spawner.h);
|
||||
}
|
||||
|
||||
public void setCreatureType(CreatureType creatureType) {
|
||||
spawner.h = creatureType.getName();
|
||||
}
|
||||
|
||||
public String getCreatureTypeId() {
|
||||
return spawner.h;
|
||||
}
|
||||
|
||||
public void setCreatureTypeId(String creatureType) {
|
||||
// Verify input
|
||||
CreatureType type = CreatureType.fromName(creatureType);
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
spawner.h = type.getName();
|
||||
}
|
||||
|
||||
public int getDelay() {
|
||||
return spawner.a;
|
||||
}
|
||||
|
||||
public void setDelay(int delay) {
|
||||
spawner.a = delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use getCreatureType() instead.
|
||||
*/
|
||||
public MobType getMobType() {
|
||||
return MobType.fromName(spawner.h);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use setCreatureType() instead.
|
||||
*/
|
||||
public void setMobType(MobType mobType) {
|
||||
spawner.h = mobType.getName();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use getCreatureTypeId() instead.
|
||||
*/
|
||||
public String getMobTypeId() {
|
||||
return spawner.h;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use setCreatureTypeId() instead.
|
||||
*/
|
||||
public void setMobTypeId(String mobType) {
|
||||
// Verify input
|
||||
MobType type = MobType.fromName(mobType);
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
spawner.h = type.getName();
|
||||
}
|
||||
}
|
||||
|
||||
2
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java
Normal file → Executable file
2
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java
Normal file → Executable file
@@ -49,7 +49,7 @@ public class CraftDispenser extends CraftBlockState implements Dispenser {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
dispenser.d();
|
||||
dispenser.h();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
112
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
Normal file → Executable file
112
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
Normal file → Executable file
@@ -1,56 +1,56 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityFurnace;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Furnace;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
/**
|
||||
* Represents a furnace.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class CraftFurnace extends CraftBlockState implements Furnace {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityFurnace furnace;
|
||||
|
||||
public CraftFurnace(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
furnace = (TileEntityFurnace)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
return new CraftInventory(furnace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean force) {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
furnace.d();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public short getBurnTime() {
|
||||
return (short)furnace.e;
|
||||
}
|
||||
|
||||
public void setBurnTime(short burnTime) {
|
||||
furnace.e = burnTime;
|
||||
}
|
||||
|
||||
public short getCookTime() {
|
||||
return (short)furnace.g;
|
||||
}
|
||||
|
||||
public void setCookTime(short cookTime) {
|
||||
furnace.g = cookTime;
|
||||
}
|
||||
}
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntityFurnace;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Furnace;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
/**
|
||||
* Represents a furnace.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class CraftFurnace extends CraftBlockState implements Furnace {
|
||||
private final CraftWorld world;
|
||||
private final TileEntityFurnace furnace;
|
||||
|
||||
public CraftFurnace(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
furnace = (TileEntityFurnace)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
return new CraftInventory(furnace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(boolean force) {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
furnace.h();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public short getBurnTime() {
|
||||
return (short)furnace.a;
|
||||
}
|
||||
|
||||
public void setBurnTime(short burnTime) {
|
||||
furnace.a = burnTime;
|
||||
}
|
||||
|
||||
public short getCookTime() {
|
||||
return (short)furnace.c;
|
||||
}
|
||||
|
||||
public void setCookTime(short cookTime) {
|
||||
furnace.c = cookTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock {
|
||||
}
|
||||
|
||||
public byte getNote() {
|
||||
return note.e;
|
||||
return note.a;
|
||||
}
|
||||
|
||||
public void setNote(byte n) {
|
||||
note.e = n;
|
||||
note.a = n;
|
||||
}
|
||||
|
||||
public boolean play() {
|
||||
|
||||
9
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
Normal file → Executable file
9
paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
Normal file → Executable file
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.TileEntitySign;
|
||||
@@ -18,15 +17,15 @@ public class CraftSign extends CraftBlockState implements Sign {
|
||||
}
|
||||
|
||||
public String[] getLines() {
|
||||
return sign.e;
|
||||
return sign.a;
|
||||
}
|
||||
|
||||
public String getLine(int index) throws IndexOutOfBoundsException {
|
||||
return sign.e[index];
|
||||
return sign.a[index];
|
||||
}
|
||||
|
||||
public void setLine(int index, String line) throws IndexOutOfBoundsException {
|
||||
sign.e[index] = line;
|
||||
sign.a[index] = line;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,7 +33,7 @@ public class CraftSign extends CraftBlockState implements Sign {
|
||||
boolean result = super.update(force);
|
||||
|
||||
if (result) {
|
||||
sign.d();
|
||||
sign.h();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user