From 651d0f5162e6875a5851a77b2b223b80e7ac48b5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 15 Jan 2020 13:55:52 -0500 Subject: [PATCH] Cleanup --- core/src/mindustry/entities/type/TileEntity.java | 3 +++ .../world/blocks/distribution/Sorter.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/entities/type/TileEntity.java b/core/src/mindustry/entities/type/TileEntity.java index 9db5eb9588..9535ef69fe 100644 --- a/core/src/mindustry/entities/type/TileEntity.java +++ b/core/src/mindustry/entities/type/TileEntity.java @@ -251,6 +251,9 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ return null; } + /** Set configuration. */ + public void setConfig(Object config){} + @Override public void removed(){ if(sound != null){ diff --git a/core/src/mindustry/world/blocks/distribution/Sorter.java b/core/src/mindustry/world/blocks/distribution/Sorter.java index 1e23486548..1b07681752 100644 --- a/core/src/mindustry/world/blocks/distribution/Sorter.java +++ b/core/src/mindustry/world/blocks/distribution/Sorter.java @@ -40,18 +40,13 @@ public class Sorter extends Block{ @Override public void playerPlaced(Tile tile){ if(lastItem != null){ - tile.configure(lastItem.id); + tile.configure(lastItem); } } - @Override - public void configured(Tile tile, Player player, int value){ - tile.ent().sortItem = content.item(value); - } - @Override public void drawRequestConfig(BuildRequest req, Eachable list){ - drawRequestConfigCenter(req, content.item(req.config), "center"); + drawRequestConfigCenter(req, (Item)req.config, "center"); } @Override @@ -143,10 +138,15 @@ public class Sorter extends Block{ @Nullable Item sortItem; @Override - public Object config(){ + public Item config(){ return sortItem; } + @Override + public void setConfig(Object config){ + sortItem = (Item)config; + } + @Override public byte version(){ return 2;