mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-28 07:55:41 +00:00
Update buildscript & spotlessApply (#78)
* Update buildscript & spotlessApply * Add mapping version
This commit is contained in:
1 parent
f272840987
commit
cf41b89ae4
851 files changed
+95348
-92599
No files matched your search
@@ -1,7 +1,13 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -12,94 +18,89 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockIngotStorage extends BlockEio implements IAdvancedTooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public static BlockIngotStorage create() {
|
||||
BlockIngotStorage res = new BlockIngotStorage();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private BlockIngotStorage() {
|
||||
super(ModObject.blockIngotStorage.unlocalisedName, null, Material.iron);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, BlockItemIngotStorage.class, ModObject.blockIngotStorage.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[Alloy.values().length];
|
||||
for (Alloy alloy : Alloy.values()) {
|
||||
icons[alloy.ordinal()] = register.registerIcon(alloy.iconKey + "Block");
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public static BlockIngotStorage create() {
|
||||
BlockIngotStorage res = new BlockIngotStorage();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
meta = MathHelper.clamp_int(meta, 0, Alloy.values().length - 1);
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World world, int x, int y, int z) {
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
return Alloy.values()[world.getBlockMetadata(x, y, z)].getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
|
||||
return getBlockHardness(world, x, y, z) * 2.0f; // vanilla default is / 5.0f, this means hardness*2 = resistance
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnderIO.lang.localize("tooltip.isBeaconBase"));
|
||||
}
|
||||
private BlockIngotStorage() {
|
||||
super(ModObject.blockIngotStorage.unlocalisedName, null, Material.iron);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
@Override
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, BlockItemIngotStorage.class, ModObject.blockIngotStorage.unlocalisedName);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[Alloy.values().length];
|
||||
for (Alloy alloy : Alloy.values()) {
|
||||
icons[alloy.ordinal()] = register.registerIcon(alloy.iconKey + "Block");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
meta = MathHelper.clamp_int(meta, 0, Alloy.values().length - 1);
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getDamageValue(World world, int x, int y, int z) {
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
return Alloy.values()[world.getBlockMetadata(x, y, z)].getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(
|
||||
Entity par1Entity,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
double explosionX,
|
||||
double explosionY,
|
||||
double explosionZ) {
|
||||
return getBlockHardness(world, x, y, z) * 2.0f; // vanilla default is / 5.0f, this means hardness*2 = resistance
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnderIO.lang.localize("tooltip.isBeaconBase"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {}
|
||||
}
|
||||
Reference in new issue
Block a user