added default implementation of getDescription so it can be safely omitted from new modules
This commit is contained in:
parent
dc200d360d
commit
c94142580e
6 changed files with 8 additions and 15 deletions
|
@ -166,6 +166,11 @@ public abstract class PowerModuleBase implements ILocalizeableModule {
|
||||||
return StatCollector.translateToLocal("module." + getUnlocalizedName() + ".name");
|
return StatCollector.translateToLocal("module." + getUnlocalizedName() + ".name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return StatCollector.translateToLocal("module." + getUnlocalizedName() + ".desc");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
return "Unknown Module";
|
return "Unknown Module";
|
||||||
|
|
|
@ -36,8 +36,6 @@ class SprintAssistModule(validItems: List[IModularItem]) extends PowerModuleBase
|
||||||
|
|
||||||
override def getUnlocalizedName = "sprintAssist"
|
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) {
|
def onPlayerTickActive(player: EntityPlayer, item: ItemStack) {
|
||||||
val motionX = player.posX - player.lastTickPosX
|
val motionX = player.posX - player.lastTickPosX
|
||||||
val motionY = player.posY - player.lastTickPosY
|
val motionY = player.posY - player.lastTickPosY
|
||||||
|
|
|
@ -26,8 +26,6 @@ class FieldTinkerModule(list: java.util.List[IModularItem]) extends PowerModuleB
|
||||||
|
|
||||||
override def getUnlocalizedName = "fieldTinkerer"
|
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 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) {}
|
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {}
|
||||||
|
|
|
@ -36,9 +36,6 @@ class OmniWrenchModule(validItems: List[IModularItem]) extends PowerModuleBase(v
|
||||||
|
|
||||||
override def getUnlocalizedName = "omniwrench"
|
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 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) {}
|
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {}
|
||||||
|
|
|
@ -24,8 +24,6 @@ class RedstoneLaser(list: java.util.List[IModularItem]) extends PowerModuleBase(
|
||||||
|
|
||||||
override def getUnlocalizedName = "redstoneLaser"
|
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 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) {
|
def onItemUse(itemStack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package net.machinemuse.powersuits.powermodule.tool;
|
package net.machinemuse.powersuits.powermodule.tool;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import net.machinemuse.api.IModularItem;
|
import net.machinemuse.api.IModularItem;
|
||||||
import net.machinemuse.api.ModuleManager;
|
import net.machinemuse.api.ModuleManager;
|
||||||
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
|
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
|
||||||
import net.machinemuse.powersuits.common.ModCompatability;
|
|
||||||
import net.machinemuse.powersuits.item.ItemComponent;
|
import net.machinemuse.powersuits.item.ItemComponent;
|
||||||
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
|
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
|
||||||
import net.machinemuse.utils.ElectricItemUtils;
|
import net.machinemuse.utils.ElectricItemUtils;
|
||||||
|
@ -13,13 +13,10 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.StatCollector;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
import net.minecraftforge.common.ForgeHooks;
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +50,7 @@ public class ScoopModule extends PowerModuleBase implements IBlockBreakingModule
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName() {
|
public String getUnlocalizedName() {
|
||||||
return "scoop"
|
return "scoop";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,7 +75,7 @@ public class ScoopModule extends PowerModuleBase implements IBlockBreakingModule
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityPlayer player) {
|
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)) {
|
if (canHarvestBlock(stack, block, meta, player)) {
|
||||||
ElectricItemUtils.drainPlayerEnergy(player, ModuleManager.computeModularProperty(stack, SCOOP_ENERGY_CONSUMPTION));
|
ElectricItemUtils.drainPlayerEnergy(player, ModuleManager.computeModularProperty(stack, SCOOP_ENERGY_CONSUMPTION));
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue