From 5ea4688e8800050847aff26b24344f08a0bb0041 Mon Sep 17 00:00:00 2001 From: "Matthew (or Maya) Peng" <54301439+MEEPofFaith@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:43:31 -0800 Subject: [PATCH] get by name (#6396) --- core/src/mindustry/core/ContentLoader.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index 715c22a89b..7d738135cd 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -264,6 +264,10 @@ public class ContentLoader{ return getByID(ContentType.item, id); } + public Item item(String name){ + return getByName(ContentType.item, name); + } + public Seq liquids(){ return getBy(ContentType.liquid); } @@ -272,6 +276,10 @@ public class ContentLoader{ return getByID(ContentType.liquid, id); } + public Liquid liquid(String name){ + return getByName(ContentType.liquid, name); + } + public Seq bullets(){ return getBy(ContentType.bullet); } @@ -284,10 +292,18 @@ public class ContentLoader{ return getBy(ContentType.status); } + public StatusEffect statusEffect(String name){ + return getByName(ContentType.status, name); + } + public Seq sectors(){ return getBy(ContentType.sector); } + public SectorPreset sector(String name){ + return getByName(ContentType.sector, name); + } + public Seq units(){ return getBy(ContentType.unit); } @@ -296,7 +312,15 @@ public class ContentLoader{ return getByID(ContentType.unit, id); } + public UnitType unit(String name){ + return getByName(ContentType.unit, name); + } + public Seq planets(){ return getBy(ContentType.planet); } -} + + public Planet planet(String name){ + return getByName(ContentType.planet, name); + } +} \ No newline at end of file