File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ buildscript {
1313
1414apply plugin : ' net.minecraftforge.gradle.forge'
1515
16- version = " 1.10-1.0 .0"
16+ version = " 1.10-1.1 .0"
1717group= " com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1818archivesBaseName = " StorageDrawersExtras"
1919
Original file line number Diff line number Diff line change 66
77public enum EnumMod implements IStringSerializable
88{
9- NATURA ("natura" ),
10- BOP ("BiomesOPlenty" ),
11- FORESTRY ("forestry" ),
9+ NATURA ("natura" , EnumVariant . NATURA_WILLOW ),
10+ BOP ("BiomesOPlenty" , EnumVariant . BOP_WILLOW ),
11+ FORESTRY ("forestry" , EnumVariant . FORESTRY_WILLOW ),
1212 ;
1313
1414 private String id ;
15+ private EnumVariant defaultMaterial ;
1516
16- EnumMod (String modId ) {
17+ EnumMod (String modId , EnumVariant defaultMaterial ) {
1718 this .id = modId ;
19+ this .defaultMaterial = defaultMaterial ;
1820 }
1921
2022 @ Override
2123 public String getName () {
2224 return id ;
2325 }
2426
27+ public EnumVariant getDefaultMaterial () {
28+ return defaultMaterial ;
29+ }
30+
2531 public boolean isLoaded () {
2632 return Loader .isModLoaded (id );
2733 }
Original file line number Diff line number Diff line change 11package com .jaquadro .minecraft .storagedrawersextra .core ;
22
3+ import com .jaquadro .minecraft .storagedrawersextra .block .EnumMod ;
34import com .jaquadro .minecraft .storagedrawersextra .block .EnumVariant ;
45import net .minecraft .creativetab .CreativeTabs ;
56import net .minecraft .item .Item ;
@@ -19,8 +20,16 @@ private ModCreativeTabs () { }
1920 public ItemStack getIconItemStack () {
2021 ItemStack stack = super .getIconItemStack ();
2122
23+ EnumVariant material = EnumVariant .DEFAULT ;
24+ for (EnumMod mod : EnumMod .values ()) {
25+ if (mod .isLoaded ()) {
26+ material = mod .getDefaultMaterial ();
27+ break ;
28+ }
29+ }
30+
2231 NBTTagCompound tag = new NBTTagCompound ();
23- tag .setString ("material" , EnumVariant . NATURA_WILLOW .getResource ().toString ());
32+ tag .setString ("material" , material .getResource ().toString ());
2433 stack .setTagCompound (tag );
2534
2635 return stack ;
You can’t perform that action at this time.
0 commit comments