Search in sources :

Example 1 with SpongeCookedFish

use of org.spongepowered.common.data.type.SpongeCookedFish in project SpongeCommon by SpongePowered.

the class CookedFishRegistryModule method registerAdditional.

@AdditionalRegistration
public void registerAdditional() {
    for (ItemFishFood.FishType fishType : ItemFishFood.FishType.values()) {
        if (fishType.canCook() && !this.fishMap.containsKey(fishType.name().toLowerCase(Locale.ENGLISH))) {
            CookedFish cooked = new SpongeCookedFish(fishType.name(), new SpongeTranslation("item.fish." + fishType.getUnlocalizedName() + ".cooked.name"), fishType);
            this.fishMap.put(cooked.getId().toLowerCase(Locale.ENGLISH), cooked);
        }
    }
}
Also used : CookedFish(org.spongepowered.api.data.type.CookedFish) SpongeCookedFish(org.spongepowered.common.data.type.SpongeCookedFish) SpongeTranslation(org.spongepowered.common.text.translation.SpongeTranslation) ItemFishFood(net.minecraft.item.ItemFishFood) SpongeCookedFish(org.spongepowered.common.data.type.SpongeCookedFish) AdditionalRegistration(org.spongepowered.api.registry.util.AdditionalRegistration)

Example 2 with SpongeCookedFish

use of org.spongepowered.common.data.type.SpongeCookedFish in project SpongeCommon by SpongePowered.

the class CookedFishRegistryModule method registerDefaults.

@Override
public void registerDefaults() {
    for (ItemFishFood.FishType fishType : ItemFishFood.FishType.values()) {
        if (fishType.canCook()) {
            CookedFish cooked = new SpongeCookedFish(fishType.name(), new SpongeTranslation("item.fish." + fishType.getUnlocalizedName() + ".cooked.name"), fishType);
            this.fishMap.put(cooked.getId().toLowerCase(Locale.ENGLISH), cooked);
        }
    }
}
Also used : CookedFish(org.spongepowered.api.data.type.CookedFish) SpongeCookedFish(org.spongepowered.common.data.type.SpongeCookedFish) SpongeTranslation(org.spongepowered.common.text.translation.SpongeTranslation) ItemFishFood(net.minecraft.item.ItemFishFood) SpongeCookedFish(org.spongepowered.common.data.type.SpongeCookedFish)

Aggregations

ItemFishFood (net.minecraft.item.ItemFishFood)2 CookedFish (org.spongepowered.api.data.type.CookedFish)2 SpongeCookedFish (org.spongepowered.common.data.type.SpongeCookedFish)2 SpongeTranslation (org.spongepowered.common.text.translation.SpongeTranslation)2 AdditionalRegistration (org.spongepowered.api.registry.util.AdditionalRegistration)1