diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index a6b9264f9a..c56c0930b0 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -830,7 +830,6 @@ liquid.water.name = Water liquid.slag.name = Slag liquid.oil.name = Oil liquid.cryofluid.name = Cryofluid -item.corestorable = [lightgray]Storable in Core: {0} item.explosiveness = [lightgray]Explosiveness: {0}% item.flammability = [lightgray]Flammability: {0}% item.radioactivity = [lightgray]Radioactivity: {0}% diff --git a/core/src/mindustry/content/Items.java b/core/src/mindustry/content/Items.java index 1aea6e89c1..08f5868b76 100644 --- a/core/src/mindustry/content/Items.java +++ b/core/src/mindustry/content/Items.java @@ -1,9 +1,8 @@ package mindustry.content; -import arc.graphics.Color; -import mindustry.ctype.ContentList; -import mindustry.type.Item; -import mindustry.type.ItemType; +import arc.graphics.*; +import mindustry.ctype.*; +import mindustry.type.*; public class Items implements ContentList{ public static Item scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium, phasefabric, surgealloy, @@ -12,26 +11,22 @@ public class Items implements ContentList{ @Override public void load(){ copper = new Item("copper", Color.valueOf("d99d73")){{ - type = ItemType.material; hardness = 1; cost = 0.5f; alwaysUnlocked = true; }}; lead = new Item("lead", Color.valueOf("8c7fa9")){{ - type = ItemType.material; hardness = 1; cost = 0.7f; alwaysUnlocked = true; }}; metaglass = new Item("metaglass", Color.valueOf("ebeef5")){{ - type = ItemType.material; cost = 1.5f; }}; graphite = new Item("graphite", Color.valueOf("b2c6d2")){{ - type = ItemType.material; cost = 1f; }}; @@ -46,13 +41,11 @@ public class Items implements ContentList{ }}; titanium = new Item("titanium", Color.valueOf("8da1e3")){{ - type = ItemType.material; hardness = 3; cost = 1f; }}; thorium = new Item("thorium", Color.valueOf("f9a3c7")){{ - type = ItemType.material; explosiveness = 0.2f; hardness = 4; radioactivity = 1f; @@ -64,25 +57,21 @@ public class Items implements ContentList{ }}; silicon = new Item("silicon", Color.valueOf("53565c")){{ - type = ItemType.material; cost = 0.8f; }}; plastanium = new Item("plastanium", Color.valueOf("cbd97f")){{ - type = ItemType.material; flammability = 0.1f; explosiveness = 0.2f; cost = 1.3f; }}; phasefabric = new Item("phase-fabric", Color.valueOf("f4ba6e")){{ - type = ItemType.material; cost = 1.3f; radioactivity = 0.6f; }}; surgealloy = new Item("surge-alloy", Color.valueOf("f3e979")){{ - type = ItemType.material; }}; sporePod = new Item("spore-pod", Color.valueOf("7457ce")){{ diff --git a/core/src/mindustry/game/Stats.java b/core/src/mindustry/game/Stats.java index 931baa4dcd..4a03f6199e 100644 --- a/core/src/mindustry/game/Stats.java +++ b/core/src/mindustry/game/Stats.java @@ -39,7 +39,7 @@ public class Stats{ //weigh used fractions float frac = 0f; - Seq obtainable = Seq.select(zone.data.resources, i -> i instanceof Item && ((Item)i).type == ItemType.material).as(); + Seq obtainable = Seq.select(zone.data.resources, i -> i instanceof Item).as(); for(Item item : obtainable){ frac += Mathf.clamp((float)itemsDelivered.get(item, 0) / capacity) / (float)obtainable.size; } diff --git a/core/src/mindustry/type/Item.java b/core/src/mindustry/type/Item.java index bd9e28b66e..6558636343 100644 --- a/core/src/mindustry/type/Item.java +++ b/core/src/mindustry/type/Item.java @@ -12,8 +12,6 @@ import static mindustry.Vars.content; public class Item extends UnlockableContent{ public final Color color; - /** type of the item; used for tabs and core acceptance. default value is {@link ItemType#resource}. */ - public ItemType type = ItemType.resource; /** how explosive this item is. */ public float explosiveness = 0f; /** flammability above 0.3 makes this eleigible for item burners. */ diff --git a/core/src/mindustry/type/ItemType.java b/core/src/mindustry/type/ItemType.java deleted file mode 100644 index 3d943c478a..0000000000 --- a/core/src/mindustry/type/ItemType.java +++ /dev/null @@ -1,8 +0,0 @@ -package mindustry.type; - -public enum ItemType{ - /** Not used for anything besides crafting inside blocks. */ - resource, - /** Can be used for constructing blocks. Only materials are accepted into the core. */ - material -} diff --git a/core/src/mindustry/ui/ContentDisplay.java b/core/src/mindustry/ui/ContentDisplay.java index 7208c42f41..524c1dfb7b 100644 --- a/core/src/mindustry/ui/ContentDisplay.java +++ b/core/src/mindustry/ui/ContentDisplay.java @@ -84,9 +84,6 @@ public class ContentDisplay{ table.left().defaults().fillX(); - table.add(Core.bundle.format("item.corestorable", item.type == ItemType.material ? Core.bundle.format("yes") : Core.bundle.format("no"))); - table.row(); - table.add(Core.bundle.format("item.explosiveness", (int)(item.explosiveness * 100))); table.row(); table.add(Core.bundle.format("item.flammability", (int)(item.flammability * 100))); diff --git a/core/src/mindustry/ui/ItemsDisplay.java b/core/src/mindustry/ui/ItemsDisplay.java index 4781c4d677..351b3f17f2 100644 --- a/core/src/mindustry/ui/ItemsDisplay.java +++ b/core/src/mindustry/ui/ItemsDisplay.java @@ -30,7 +30,7 @@ public class ItemsDisplay extends Table{ t.marginRight(30f); t.left(); for(Item item : content.items()){ - if(item.type == ItemType.material && item.unlocked()){ + if(item.unlocked()){ t.label(() -> format(item)).left(); t.image(item.icon(Cicon.small)).size(8 * 3).padLeft(4).padRight(4); t.add(item.localizedName).color(Color.lightGray).left(); diff --git a/core/src/mindustry/ui/dialogs/LoadoutDialog.java b/core/src/mindustry/ui/dialogs/LoadoutDialog.java index 1b5d067bb4..e367bc08da 100644 --- a/core/src/mindustry/ui/dialogs/LoadoutDialog.java +++ b/core/src/mindustry/ui/dialogs/LoadoutDialog.java @@ -106,8 +106,7 @@ public class LoadoutDialog extends BaseDialog{ private void reseed(){ this.stacks = originalStacks.map(ItemStack::copy); - this.stacks.addAll(content.items().select(i -> i.type == ItemType.material && - !stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0))); + this.stacks.addAll(content.items().select(i -> !stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0))); this.stacks.sort(Structs.comparingInt(s -> s.item.id)); } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index dbfbf3f400..28ac322757 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -76,7 +76,7 @@ public class CoreBlock extends StorageBlock{ new Bar( () -> Core.bundle.format("bar.capacity", ui.formatAmount(e.storageCapacity)), () -> Pal.items, - () -> e.items().total() / ((float)e.storageCapacity * content.items().count(i -> i.type == ItemType.material)) + () -> e.items().total() / ((float)e.storageCapacity * content.items().size) )); bars.add("units", e -> @@ -154,7 +154,7 @@ public class CoreBlock extends StorageBlock{ @Override public int getMaximumAccepted(Item item){ - return item.type == ItemType.material ? storageCapacity : 0; + return storageCapacity; } @Override diff --git a/desktop/src/mindustry/desktop/steam/SStats.java b/desktop/src/mindustry/desktop/steam/SStats.java index c77998d4da..28f4cb4d3a 100644 --- a/desktop/src/mindustry/desktop/steam/SStats.java +++ b/desktop/src/mindustry/desktop/steam/SStats.java @@ -64,7 +64,7 @@ public class SStats implements SteamUserStatsCallback{ } for(Building entity : player.team().cores()){ - if(!content.items().contains(i -> i.type == ItemType.material && entity.items.get(i) < entity.block().itemCapacity)){ + if(!content.items().contains(i -> entity.items.get(i) < entity.block().itemCapacity)){ fillCoreAllCampaign.complete(); break; } diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 7848e7f757..33eccd26dd 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -418,9 +418,7 @@ public class ServerControl implements ApplicationListener{ } for(Item item : content.items()){ - if(item.type == ItemType.material){ - state.teams.cores(team).first().items().set(item, state.teams.cores(team).first().block().itemCapacity); - } + state.teams.cores(team).first().items().set(item, state.teams.cores(team).first().block().itemCapacity); } info("Core filled.");