This commit is contained in:
fewizz committed 2016-02-04 17:10:07 +03:00
1 parent 17dc565ece
commit ba138b6eb2
12 files changed
+215 -161

No files matched your search

@@ -4,7 +4,7 @@ public class ModInformation {
public static final String name = "Electro-Magic Tools";
public static final String modid = "EMT";
public static final String version = "1.2.5";
public static final String version = "1.2.6";
public static final String texturePath = "electromagictools";
public static final String guiFactory = "tombenpotter.emt.client.gui.config.EMTGuiFactory";
public static final String clientProxy = "tombenpotter.emt.proxy.ClientProxy";
@@ -6,21 +6,21 @@ import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
public abstract class BlockBase extends Block {
public final String name;
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
super(material);
name = unlocName;
setBlockName(ModInformation.modid + ".block." + unlocName);
setBlockTextureName(ModInformation.texturePath + ":" + textureName);
if (textureName != null) {
setBlockTextureName(ModInformation.texturePath + ":" + textureName);
}
setCreativeTab(ElectroMagicTools.tabEMT);
setStepSound(soundType);
setHardness(hardness);
}
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
super(material);
setBlockName(ModInformation.modid + ".block." + unlocName);
setCreativeTab(ElectroMagicTools.tabEMT);
setStepSound(soundType);
setHardness(hardness);
this(unlocName, material, null, soundType, hardness);
}
}
@@ -1,12 +1,18 @@
package tombenpotter.emt.common.block;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.client.fx.ParticleEngine;
@@ -15,12 +21,15 @@ import thaumcraft.client.fx.particles.FXWisp;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
import thaumcraft.common.tiles.TileNitor;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.tile.TileElectricCloud;
public class BlockElectricCloud extends BlockBase {
public IIcon icon;
public BlockElectricCloud(String unlocName) {
super(unlocName, Material.cloth, soundTypeCloth, 1);
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
}
@Override
@@ -34,6 +43,31 @@ public class BlockElectricCloud extends BlockBase {
public TileEntity createTileEntity(World world, int metadata) {
return new TileElectricCloud();
}
@Override
public String getUnlocalizedName() {
return "tile.EMT." + super.getUnlocalizedName().substring(15);
}
@Override
public void registerBlockIcons(IIconRegister ir) {
icon = ir.registerIcon(ModInformation.texturePath + ":empty");
}
@Override
public IIcon getIcon(int side, int meta) {
return icon;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
return null;
}
@Override
public int getLightValue() {
return 15;
}
@Override
public boolean isAir(IBlockAccess world, int x, int y, int z) {
@@ -22,7 +22,7 @@ import java.util.Random;
public class BlockPortableNode extends BlockAiry {
public IIcon[] texture = new IIcon[1];
public IIcon texture;
public BlockPortableNode(String name) {
this.setCreativeTab(ElectroMagicTools.tabEMT);
@@ -65,17 +65,12 @@ public class BlockPortableNode extends BlockAiry {
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister ri) {
this.texture[0] = ri.registerIcon(ModInformation.texturePath + ":portablenode");
texture = ri.registerIcon(ModInformation.texturePath + ":portablenode");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.texture[0];
}
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
return texture;
}
@Override
@@ -1,12 +1,34 @@
package tombenpotter.emt.common.item.block;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.EMTTextHelper;
public class ItemBlockElectricCloud extends ItemBlock{
public IIcon icon;
public ItemBlockElectricCloud(Block block) {
super(block);
}
@Override
public IIcon getIconFromDamage(int meta) {
return icon;
}
@Override
public void registerIcons(IIconRegister ir) {
icon = ir.registerIcon(ModInformation.texturePath + ":" + "electricCloud");
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
return EMTTextHelper.PURPLE + EMTTextHelper.BOLD + StatCollector.translateToLocal(getUnlocalizedName() + ".name");
}
}
@@ -22,73 +22,73 @@ public class ItemBlockSolars extends ItemBlock {
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0: {
name = "compressed";
break;
}
case 1: {
name = "doublecompressed";
break;
}
case 2: {
name = "triplecompressed";
break;
}
case 3: {
name = "water";
break;
}
case 4: {
name = "doublewater";
break;
}
case 5: {
name = "triplewater";
break;
}
case 6: {
name = "dark";
break;
}
case 7: {
name = "doubledark";
break;
}
case 8: {
name = "tripledark";
break;
}
case 9: {
name = "order";
break;
}
case 10: {
name = "doubleorder";
break;
}
case 11: {
name = "tripleorder";
break;
}
case 12: {
name = "fire";
break;
}
case 13: {
name = "doublefire";
break;
}
case 14: {
name = "triplefire";
break;
}
case 15: {
name = "air";
break;
}
default:
name = "nothing";
break;
case 0: {
name = "compressed";
break;
}
case 1: {
name = "doublecompressed";
break;
}
case 2: {
name = "triplecompressed";
break;
}
case 3: {
name = "water";
break;
}
case 4: {
name = "doublewater";
break;
}
case 5: {
name = "triplewater";
break;
}
case 6: {
name = "dark";
break;
}
case 7: {
name = "doubledark";
break;
}
case 8: {
name = "tripledark";
break;
}
case 9: {
name = "order";
break;
}
case 10: {
name = "doubleorder";
break;
}
case 11: {
name = "tripleorder";
break;
}
case 12: {
name = "fire";
break;
}
case 13: {
name = "doublefire";
break;
}
case 14: {
name = "triplefire";
break;
}
case 15: {
name = "air";
break;
}
default:
name = "nothing";
break;
}
return getUnlocalizedName() + "." + name;
}
@@ -102,83 +102,83 @@ public class ItemBlockSolars extends ItemBlock {
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
switch (itemstack.getItemDamage()) {
case 0: {
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 1: {
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 2: {
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 3: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 4: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 5: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 6: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 7: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 8: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 9: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 10: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 0: {
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 1: {
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 2: {
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 3: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 4: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 5: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
break;
}
case 6: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 7: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 8: {
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
break;
}
case 9: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 10: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 11: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 12: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 13: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 14: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 15: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
break;
}
default: {
list.add(localize("tooltip.EMT.forget"));
break;
}
case 11: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
break;
}
case 12: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 13: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 14: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 15: {
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
break;
}
default: {
list.add(localize("tooltip.EMT.forget"));
break;
}
}
}
}