Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Armor Constructor Error


SonPlaying
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.