Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm trying to make an armor set... i saw other modders go through this perfectly w/o errors, but i do.

public enum ModArmorMaterial implements IArmorMaterial {
	;
	// ruby_layer_1 ruby_layer_2
	// this constructor \/ is the error
	WOOD(Main.MOD_ID + ":wood", 5, new int[] { 1, 1, 1, 1 }, 6, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.3f, () -> { return Ingredient.fromItems(Items.OAK_WOOD, Items.ACACIA_WOOD, Items.SPRUCE_WOOD, Items.BIRCH_WOOD, Items.DARK_OAK_WOOD); });
	
	private static final int[] MAX_DAMAGE_ARRAY = new int[] { 13, 16, 15, 11 };
	private final String name;
	private final int maxDamageFactor;
	private final int[] damageReductionAmountArray;
	private final int enchantability;
	private final SoundEvent soundEvent;
	private final float toughness;
	private final Supplier<Ingredient> repairMaterial;
	
	ModArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmountArray,
			int enchantability, SoundEvent soundEvent, float toughness, Supplier<Ingredient> 
	repairMaterial) {
		this.name = name;
		this.maxDamageFactor = maxDamageFactor;
		this.damageReductionAmountArray = damageReductionAmountArray;
		this.enchantability = enchantability;
		this.soundEvent = soundEvent;
		this.toughness = toughness;
		this.repairMaterial = repairMaterial;
	}
	
	@Override
	public int getDurability(EquipmentSlotType slotIn) {
		// TODO Auto-generated method stub
		return MAX_DAMAGE_ARRAY[slotIn.getIndex()] + this.maxDamageFactor;
	}

	@Override
	public int getDamageReductionAmount(EquipmentSlotType slotIn) {
		// TODO Auto-generated method stub
		return this.damageReductionAmountArray[slotIn.getIndex()];
	}

	@Override
	public int getEnchantability() {
		// TODO Auto-generated method stub
		return this.enchantability;
	}

	@Override
	public SoundEvent getSoundEvent() {
		// TODO Auto-generated method stub
		return this.soundEvent;
	}

	@Override
	public Ingredient getRepairMaterial() {
		// TODO Auto-generated method stub
		return this.repairMaterial.get();
	}
	
	@OnlyIn(Dist.CLIENT)
	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return this.name;
	}

	@Override
	public float getToughness() {
		// TODO Auto-generated method stub
		return this.toughness;
	}

	@Override
	public float func_230304_f_() {
		// TODO Auto-generated method stub
		return 0;
	}

}

I don't know what to do. Am i forgetting something?

 

Suggestion fixes suggest me to either add void modifier or change to constructor.

 

err.png

err2.png

err3.png

err4.png

Edited by SonPlaying

Quote

public enum ModArmorMaterial implements IArmorMaterial {
	;
	// ruby_layer_1 ruby_layer_2
	// this constructor \/ is the error
	WOOD(Main.MOD_ID + ":wood", 5, new int[] { 1, 1, 1, 1 }, 6, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.3f, () -> { return Ingredient.fromItems(Items.OAK_WOOD, Items.ACACIA_WOOD, Items.SPRUCE_WOOD, Items.BIRCH_WOOD, Items.DARK_OAK_WOOD); });

You see there is a " ; " right after:

public enum ModArmorMaterial implements IArmorMaterial {

that is a sintax error and needs to be removed.

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

  • Author
59 minutes ago, Beethoven92 said:

You see there is a " ; " right after:


public enum ModArmorMaterial implements IArmorMaterial {

that is a sintax error and needs to be removed.

That automatically adds when i implement IArmorMaterial, but ok.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.