SPIGOT-2793: Revert Nameable changes

This commit is contained in:
md_5 2016-11-19 03:10:04 +11:00
parent 88eede85cc
commit f15e07b1a9
10 changed files with 7 additions and 68 deletions

View File

@ -1,14 +1,5 @@
--- a/net/minecraft/server/BlockShulkerBox.java
+++ b/net/minecraft/server/BlockShulkerBox.java
@@ -3,7 +3,7 @@
public class BlockShulkerBox extends BlockTileEntity {
public static final BlockStateEnum<EnumDirection> a = BlockStateDirection.of("facing");
- private final EnumColor b;
+ public final EnumColor b; // PAIL: public, rename
public BlockShulkerBox(EnumColor enumcolor) {
super(Material.STONE, MaterialMapColor.b);
@@ -89,7 +89,32 @@
tileentityshulkerbox.d(entityhuman);
}

View File

@ -15,7 +15,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class CraftBeacon extends CraftLootable implements Beacon {
public class CraftBeacon extends CraftContainer implements Beacon {
private final CraftWorld world;
private final TileEntityBeacon beacon;

View File

@ -59,14 +59,4 @@ public class CraftBrewingStand extends CraftContainer implements BrewingStand {
public void setFuelLevel(int level) {
brewingStand.setProperty(1, level);
}
@Override
public String getCustomName() {
return brewingStand.hasCustomName() ? brewingStand.getName() : null;
}
@Override
public void setCustomName(String name) {
brewingStand.a(name); // PAIL: setCustomName
}
}

View File

@ -11,7 +11,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
import org.bukkit.inventory.Inventory;
public class CraftChest extends CraftLootable implements Chest {
public class CraftChest extends CraftContainer implements Chest {
private final CraftWorld world;
private final TileEntityChest chest;

View File

@ -14,7 +14,7 @@ import org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource;
import org.bukkit.inventory.Inventory;
import org.bukkit.projectiles.BlockProjectileSource;
public class CraftDispenser extends CraftLootable implements Dispenser {
public class CraftDispenser extends CraftContainer implements Dispenser {
private final CraftWorld world;
private final TileEntityDispenser dispenser;

View File

@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
public class CraftDropper extends CraftLootable implements Dropper {
public class CraftDropper extends CraftContainer implements Dropper {
private final CraftWorld world;
private final TileEntityDropper dropper;

View File

@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
import org.bukkit.inventory.FurnaceInventory;
public class CraftFurnace extends CraftLootable implements Furnace {
public class CraftFurnace extends CraftContainer implements Furnace {
private final TileEntityFurnace furnace;
public CraftFurnace(final Block block) {

View File

@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
public class CraftHopper extends CraftLootable implements Hopper {
public class CraftHopper extends CraftContainer implements Hopper {
private final TileEntityHopper hopper;
public CraftHopper(final Block block) {

View File

@ -1,35 +0,0 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntity;
import net.minecraft.server.TileEntityLootable;
import org.bukkit.Material;
import org.bukkit.Nameable;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftWorld;
public class CraftLootable extends CraftContainer implements Nameable {
private final TileEntityLootable te;
public CraftLootable(Block block) {
super(block);
te = (TileEntityLootable) ((CraftWorld) block.getWorld()).getTileEntityAt(getX(), getY(), getZ());
}
public CraftLootable(Material material, TileEntity tileEntity) {
super(material, tileEntity);
te = (TileEntityLootable) tileEntity;
}
@Override
public String getCustomName() {
return te.hasCustomName() ? te.getName() : null;
}
@Override
public void setCustomName(String name) {
te.a(name); // PAIL: setCustomName
}
}

View File

@ -1,9 +1,7 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.BlockShulkerBox;
import net.minecraft.server.TileEntity;
import net.minecraft.server.TileEntityShulkerBox;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.ShulkerBox;
@ -11,7 +9,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
public class CraftShulkerBox extends CraftContainer implements ShulkerBox {
private final CraftWorld world;
private final TileEntityShulkerBox box;
@ -39,9 +37,4 @@ public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
public Inventory getInventory() {
return new CraftInventory(box);
}
@Override
public DyeColor getColor() {
return DyeColor.getByWoolData((byte) ((BlockShulkerBox) box.getBlock()).b.getColorIndex());
}
}