added default implementation of getDescription so it can be safely omitted from new modules

This commit is contained in:
MachineMuse 2015-09-08 12:36:11 -06:00
parent dc200d360d
commit c94142580e
6 changed files with 8 additions and 15 deletions

View file

@ -166,6 +166,11 @@ public abstract class PowerModuleBase implements ILocalizeableModule {
return StatCollector.translateToLocal("module." + getUnlocalizedName() + ".name");
}
@Override
public String getDescription() {
return StatCollector.translateToLocal("module." + getUnlocalizedName() + ".desc");
}
@Override
public String getUnlocalizedName() {
return "Unknown Module";

View file

@ -36,8 +36,6 @@ class SprintAssistModule(validItems: List[IModularItem]) extends PowerModuleBase
override def getUnlocalizedName = "sprintAssist"
def getDescription: String = "A set of servo motors to help you sprint (double-tap forward) and walk faster."
def onPlayerTickActive(player: EntityPlayer, item: ItemStack) {
val motionX = player.posX - player.lastTickPosX
val motionY = player.posY - player.lastTickPosY

View file

@ -26,8 +26,6 @@ class FieldTinkerModule(list: java.util.List[IModularItem]) extends PowerModuleB
override def getUnlocalizedName = "fieldTinkerer"
def getDescription: String = "Maybe you can't memorize the blueprints, but you should at least be able to fine tune your modules without Inspiration\u2122 Inc. LLC."
def getTextureFile: String = "transparentarmor"
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {}

View file

@ -36,9 +36,6 @@ class OmniWrenchModule(validItems: List[IModularItem]) extends PowerModuleBase(v
override def getUnlocalizedName = "omniwrench"
def getDescription: String = "A wrench which can interact with almost every mod."
def onRightClick(playerClicking: EntityPlayer, world: World, item: ItemStack) {}
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {}

View file

@ -24,8 +24,6 @@ class RedstoneLaser(list: java.util.List[IModularItem]) extends PowerModuleBase(
override def getUnlocalizedName = "redstoneLaser"
def getDescription: String = "No need for a lever if you're just giving it a pulse."
def getTextureFile: String = "laser"
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {

View file

@ -1,9 +1,9 @@
package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.powersuits.common.ModCompatability;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.ElectricItemUtils;
@ -13,13 +13,10 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.List;
/**
@ -53,7 +50,7 @@ public class ScoopModule extends PowerModuleBase implements IBlockBreakingModule
@Override
public String getUnlocalizedName() {
return "scoop"
return "scoop";
}
@Override
@ -78,7 +75,7 @@ public class ScoopModule extends PowerModuleBase implements IBlockBreakingModule
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityPlayer player) {
int meta = world.getBlockMetadata(x,y,z);
int meta = world.getBlockMetadata(x, y, z);
if (canHarvestBlock(stack, block, meta, player)) {
ElectricItemUtils.drainPlayerEnergy(player, ModuleManager.computeModularProperty(stack, SCOOP_ENERGY_CONSUMPTION));
return true;