Fix CraftBanner initialisation.

Dieser Commit ist enthalten in:
Lukas Hennig 2017-08-07 03:30:41 +02:00 committet von md_5
Ursprung b5878783ad
Commit e1f296d115
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -16,7 +16,7 @@ import org.bukkit.block.banner.PatternType;
public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> implements Banner { public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> implements Banner {
private DyeColor base; private DyeColor base;
private List<Pattern> patterns = new ArrayList<Pattern>(); private List<Pattern> patterns;
public CraftBanner(final Block block) { public CraftBanner(final Block block) {
super(block, TileEntityBanner.class); super(block, TileEntityBanner.class);
@ -31,6 +31,7 @@ public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> impleme
super.load(banner); super.load(banner);
base = DyeColor.getByDyeData((byte) banner.color.getInvColorIndex()); base = DyeColor.getByDyeData((byte) banner.color.getInvColorIndex());
patterns = new ArrayList<Pattern>();
if (banner.patterns != null) { if (banner.patterns != null) {
for (int i = 0; i < banner.patterns.size(); i++) { for (int i = 0; i < banner.patterns.size(); i++) {

Datei anzeigen

@ -84,7 +84,7 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
return snapshot.save(new NBTTagCompound()); return snapshot.save(new NBTTagCompound());
} }
// copies the data of the given tile entity data to this block state // copies the data of the given tile entity to this block state
protected void load(T tileEntity) { protected void load(T tileEntity) {
if (tileEntity != null && tileEntity != snapshot) { if (tileEntity != null && tileEntity != snapshot) {
copyData(tileEntity, snapshot); copyData(tileEntity, snapshot);