Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
Get Colors from ShulkerBox; Implement CustomName for Tiles.
Dieser Commit ist enthalten in:
Ursprung
93b8244115
Commit
5e51afde49
@ -1,5 +1,14 @@
|
|||||||
--- a/net/minecraft/server/BlockShulkerBox.java
|
--- a/net/minecraft/server/BlockShulkerBox.java
|
||||||
+++ b/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 @@
|
@@ -89,7 +89,32 @@
|
||||||
tileentityshulkerbox.d(entityhuman);
|
tileentityshulkerbox.d(entityhuman);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import org.bukkit.inventory.Inventory;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
public class CraftBeacon extends CraftContainer implements Beacon {
|
public class CraftBeacon extends CraftLootable implements Beacon {
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
private final TileEntityBeacon beacon;
|
private final TileEntityBeacon beacon;
|
||||||
|
|
||||||
|
@ -59,4 +59,14 @@ public class CraftBrewingStand extends CraftContainer implements BrewingStand {
|
|||||||
public void setFuelLevel(int level) {
|
public void setFuelLevel(int level) {
|
||||||
brewingStand.setProperty(1, 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory;
|
|||||||
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
|
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
||||||
public class CraftChest extends CraftContainer implements Chest {
|
public class CraftChest extends CraftLootable implements Chest {
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
private final TileEntityChest chest;
|
private final TileEntityChest chest;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.projectiles.BlockProjectileSource;
|
import org.bukkit.projectiles.BlockProjectileSource;
|
||||||
|
|
||||||
public class CraftDispenser extends CraftContainer implements Dispenser {
|
public class CraftDispenser extends CraftLootable implements Dispenser {
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
private final TileEntityDispenser dispenser;
|
private final TileEntityDispenser dispenser;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.CraftWorld;
|
|||||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
||||||
public class CraftDropper extends CraftContainer implements Dropper {
|
public class CraftDropper extends CraftLootable implements Dropper {
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
private final TileEntityDropper dropper;
|
private final TileEntityDropper dropper;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftWorld;
|
|||||||
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
||||||
import org.bukkit.inventory.FurnaceInventory;
|
import org.bukkit.inventory.FurnaceInventory;
|
||||||
|
|
||||||
public class CraftFurnace extends CraftContainer implements Furnace {
|
public class CraftFurnace extends CraftLootable implements Furnace {
|
||||||
private final TileEntityFurnace furnace;
|
private final TileEntityFurnace furnace;
|
||||||
|
|
||||||
public CraftFurnace(final Block block) {
|
public CraftFurnace(final Block block) {
|
||||||
|
@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftWorld;
|
|||||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
||||||
public class CraftHopper extends CraftContainer implements Hopper {
|
public class CraftHopper extends CraftLootable implements Hopper {
|
||||||
private final TileEntityHopper hopper;
|
private final TileEntityHopper hopper;
|
||||||
|
|
||||||
public CraftHopper(final Block block) {
|
public CraftHopper(final Block block) {
|
||||||
|
35
src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
Normale Datei
35
src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java
Normale Datei
@ -0,0 +1,35 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package org.bukkit.craftbukkit.block;
|
package org.bukkit.craftbukkit.block;
|
||||||
|
|
||||||
|
import net.minecraft.server.BlockShulkerBox;
|
||||||
import net.minecraft.server.TileEntityShulkerBox;
|
import net.minecraft.server.TileEntityShulkerBox;
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.ShulkerBox;
|
import org.bukkit.block.ShulkerBox;
|
||||||
@ -8,7 +10,7 @@ import org.bukkit.craftbukkit.CraftWorld;
|
|||||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
|
||||||
public class CraftShulkerBox extends CraftContainer implements ShulkerBox {
|
public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
|
||||||
|
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
private final TileEntityShulkerBox box;
|
private final TileEntityShulkerBox box;
|
||||||
@ -31,4 +33,9 @@ public class CraftShulkerBox extends CraftContainer implements ShulkerBox {
|
|||||||
public Inventory getInventory() {
|
public Inventory getInventory() {
|
||||||
return new CraftInventory(box);
|
return new CraftInventory(box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DyeColor getColor() {
|
||||||
|
return DyeColor.getByWoolData((byte) ((BlockShulkerBox) box.getBlock()).b.getColorIndex());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren