2222
2323package com .falsepattern .falsetweaks .modules .dynlights .base ;
2424
25+ import lombok .val ;
2526import mods .battlegear2 .api .core .IInventoryPlayerBattle ;
2627import mods .battlegear2 .api .core .InventoryPlayerBattle ;
2728import xonin .backhand .api .core .BackhandUtils ;
3132import net .minecraft .launchwrapper .Launch ;
3233import cpw .mods .fml .common .Loader ;
3334
35+ import java .util .ArrayList ;
36+ import java .util .Collections ;
37+ import java .util .List ;
38+
3439public enum OffhandMod {
35- None ,
3640 Backhand {
3741 @ Override
3842 public ItemStack getOffhandItem (EntityPlayer player ) {
@@ -52,25 +56,28 @@ public ItemStack getOffhandItem(EntityPlayer player) {
5256 }
5357 };
5458
55- public static final OffhandMod CURRENT = detectCurrent ();
59+ public static final List < OffhandMod > CURRENT = detectCurrent ();
5660
57- private static OffhandMod detectCurrent () {
61+ private static List <OffhandMod > detectCurrent () {
62+ val result = new ArrayList <OffhandMod >();
5863 if (Loader .isModLoaded ("battlegear2" )) {
5964 try {
6065 if (Launch .classLoader .getClassBytes ("mods.battlegear2.api.core.InventoryPlayerBattle" ) != null ) {
61- return OffhandMod . Battlegear2 ;
66+ result . add ( Battlegear2 ) ;
6267 }
6368 } catch (Throwable ignored ) {
6469 }
65- return OffhandMod .Battlegear2GTNH ;
70+ try {
71+ if (Launch .classLoader .getClassBytes ("mods.battlegear2.api.core.IInventoryPlayerBattle" ) != null ) {
72+ result .add (Battlegear2GTNH );
73+ }
74+ } catch (Throwable ignored ) {}
6675 }
6776 if (Loader .isModLoaded ("backhand" )) {
68- return OffhandMod . Backhand ;
77+ result . add ( Backhand ) ;
6978 }
70- return None ;
79+ return Collections . unmodifiableList ( result ) ;
7180 }
7281
73- public ItemStack getOffhandItem (EntityPlayer player ) {
74- return null ;
75- }
82+ public abstract ItemStack getOffhandItem (EntityPlayer player );
7683}
0 commit comments