Untitled

作者 Scorching Marten, 1 年 前, 書かれた言語は Java, 閲覧 157 回. [paste_expire] 1 秒.
URL https://paste.mikumikudance.jp/view/5374f6cd 埋込コード
コピペをダウンロードする または 生データを見る
  1. package featurecreep.api.bg.ui.tabs.vanilla;
  2.  
  3. import featurecreep.api.bg.ui.tabs.UnifiedItemGroupGetter;
  4. import game.BuiltInRegistries;
  5. import game.CreativeTab;
  6. import game.CreativeTabs;
  7.  
  8. public class VanillaCreativeTab implements UnifiedItemGroupGetter {
  9.         public String tabname;
  10.  
  11.         public VanillaCreativeTab(String name) {
  12.                 tabname = name;
  13.                 setTabName(getVanillaGroupFromString(this).getUnlocalisedName().getString()); // May not work, ideally tabname
  14.                                                                                                                                                                                 // will be used for most //In
  15.                                                                                                                                                                                 // Yarn the ID is the String
  16.                                                                                                                                                                                 // name, kinda throws off
  17.                                                                                                                                                                                 // considering here its the
  18.                                                                                                                                                                                 // number
  19.                 setID(0);// TODO
  20.         }
  21.  
  22. //Minecraft Only gotta change the mappings for these once i figure them out
  23.         public static CreativeTab getVanillaGroupFromString(VanillaCreativeTab groupname) {
  24.                 if (groupname.tabname.equals("BUILDING_BLOCKS")) {
  25.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.BUILDING_BLOCKS);
  26.                 } else if (groupname.tabname.equals("BREWING")) {
  27.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.MISULANIOUS);
  28.                 } else if (groupname.tabname.equals("COMBAT")) {
  29.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.COMBAT);
  30.                 } else if (groupname.tabname.equals("DECORATIONS")) {
  31.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.BUILDING_BLOCKS);
  32.                 } else if (groupname.tabname.equals("FOOD")) {
  33.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.FOODSTUFFS);
  34.                 } else if (groupname.tabname.equals("MATERIALS")) {
  35.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.PLANTS);
  36.                 } else if (groupname.tabname.equals("MISC")) {
  37.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.MISULANIOUS);
  38.                 } else if (groupname.tabname.equals("REDSTONE")) {
  39.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.REDSTONE);
  40.                 } else if (groupname.tabname.equals("TOOLS")) {
  41.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.TOOLS);
  42.                 } else if (groupname.tabname.equals("TRANSPORTATION")) {
  43.                         return BuiltInRegistries.CREATIVE_TABS.get(CreativeTabs.FUNCTION);
  44.                 } else {
  45.                         return null;
  46.                 }
  47.  
  48.         }
  49.  
  50.         @Override
  51.         public CreativeTab get() {
  52.                 // TODO Auto-generated method stub
  53.                 return getVanillaGroupFromString(this);
  54.         }
  55.  
  56. }

コピペに返事 "Untitled"

ここにコピペに対する返事を書き込むことができます