Cleanup code
This commit is contained in:
		@ -17,16 +17,16 @@ public class ModCreativeTabs {
 | 
			
		||||
            .icon(() -> ModItems.VSU_HELMET_1.get().getDefaultInstance())
 | 
			
		||||
            .title(Component.translatable("item_group." + MilitaryArmor.MOD_ID + ".main"))
 | 
			
		||||
            .displayItems((parameters, output) -> {
 | 
			
		||||
        try {
 | 
			
		||||
            for (var f : ModItems.class.getDeclaredFields()) {
 | 
			
		||||
                if (Modifier.isStatic(f.getModifiers()) && Modifier.isFinal(f.getModifiers()) && f.getType() == RegistryObject.class) {
 | 
			
		||||
                    output.accept(((RegistryObject<? extends Item>) f.get(null)).get());
 | 
			
		||||
                try {
 | 
			
		||||
                    for (var f : ModItems.class.getDeclaredFields()) {
 | 
			
		||||
                        if (Modifier.isStatic(f.getModifiers()) && Modifier.isFinal(f.getModifiers()) && f.getType() == RegistryObject.class) {
 | 
			
		||||
                            output.accept(((RegistryObject<? extends Item>) f.get(null)).get());
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } catch (Throwable throwable) {
 | 
			
		||||
                    MilitaryArmor.LOGGER.error("Error while trying to register items in a tab", throwable);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } catch (Throwable throwable) {
 | 
			
		||||
            MilitaryArmor.LOGGER.error("Error while trying to register items in a tab", throwable);
 | 
			
		||||
        }
 | 
			
		||||
    }).build());
 | 
			
		||||
            }).build());
 | 
			
		||||
 | 
			
		||||
    public static void register(IEventBus bus) {
 | 
			
		||||
        CREATIVE_MODE_TABS.register(bus);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user