mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Add better documentation for Frames
This commit is contained in:
1 parent
9f66b811c9
commit
f7ad61a2f3
3 files changed
+49
-3
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package forestry.apiculture.compat;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
|
||||
@JEIPlugin
|
||||
public class ApicultureJeiPlugin extends BlankModPlugin {
|
||||
@Override
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
List<ItemStack> frames = Arrays.asList(
|
||||
new ItemStack(PluginApiculture.items.frameImpregnated),
|
||||
new ItemStack(PluginApiculture.items.frameProven),
|
||||
new ItemStack(PluginApiculture.items.frameUntreated)
|
||||
);
|
||||
registry.addDescription(frames, "for.jei.description.frames");
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.DefaultBeeModifier;
|
||||
@@ -21,9 +24,11 @@ import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ItemForestry;
|
||||
|
||||
import mezz.jei.util.Translator;
|
||||
|
||||
public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
|
||||
|
||||
private final IBeeModifier beeModifier;
|
||||
private final HiveFrameBeeModifier beeModifier;
|
||||
|
||||
public ItemHiveFrame(int maxDamage, float geneticDecay) {
|
||||
setMaxStackSize(1);
|
||||
@@ -48,7 +53,17 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
|
||||
return beeModifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
beeModifier.addInformation(stack, playerIn, tooltip, advanced);
|
||||
if (!stack.isItemDamaged()) {
|
||||
tooltip.add(Translator.translateToLocalFormatted("item.for.frame.durability", stack.getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
private static class HiveFrameBeeModifier extends DefaultBeeModifier {
|
||||
private static final float production = 2f;
|
||||
private final float geneticDecay;
|
||||
|
||||
public HiveFrameBeeModifier(float geneticDecay) {
|
||||
@@ -57,12 +72,17 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return currentModifier < 10f ? 2f : 1f;
|
||||
return currentModifier < 10f ? production : 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return this.geneticDecay;
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
tooltip.add(Translator.translateToLocalFormatted("item.for.bee.modifier.production", production));
|
||||
tooltip.add(Translator.translateToLocalFormatted("item.for.bee.modifier.genetic.decay", geneticDecay));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user