Added new textures for detector and thermopile

This commit is contained in:
Calclavia 2014-02-22 18:54:06 +08:00
parent 64b3690463
commit adc21a724a
13 changed files with 33 additions and 68 deletions

View file

@ -11,7 +11,6 @@ public class BlockThermopile extends BlockTile
public BlockThermopile(int id)
{
super(id, UniversalElectricity.machine);
setTextureName(Reference.PREFIX + "material_metal_top");
}
@Override

View file

@ -29,8 +29,8 @@ import resonantinduction.electrical.Electrical;
import resonantinduction.electrical.tesla.TileTesla;
import universalelectricity.api.vector.Vector3;
import universalelectricity.api.vector.VectorWorld;
import calclavia.components.tool.ToolModeLink;
import calclavia.lib.render.EnumColor;
import calclavia.lib.utility.LinkUtility;
import calclavia.lib.utility.WrenchUtility;
import calclavia.lib.utility.inventory.InventoryUtility;
import codechicken.lib.data.MCDataInput;
@ -79,19 +79,19 @@ public class PartLevitator extends PartFace
{
if (WrenchUtility.isWrench(itemStack))
{
if (tryLink(ToolModeLink.getLink(itemStack), ToolModeLink.getSide(itemStack)))
if (tryLink(LinkUtility.getLink(itemStack), LinkUtility.getSide(itemStack)))
{
if (world().isRemote)
player.addChatMessage("Successfully linked devices.");
ToolModeLink.clearLink(itemStack);
LinkUtility.clearLink(itemStack);
}
else
{
if (world().isRemote)
player.addChatMessage("Marked link for device.");
ToolModeLink.setLink(itemStack, new VectorWorld(world(), x(), y(), z()));
ToolModeLink.setSide(itemStack, (byte) placementSide.ordinal());
LinkUtility.setLink(itemStack, new VectorWorld(world(), x(), y(), z()));
LinkUtility.setSide(itemStack, (byte) placementSide.ordinal());
}
return true;

View file

@ -14,9 +14,9 @@ import resonantinduction.core.Reference;
import resonantinduction.core.render.RIBlockRenderingHandler;
import universalelectricity.api.UniversalElectricity;
import universalelectricity.api.vector.VectorWorld;
import calclavia.components.tool.ToolModeLink;
import calclavia.lib.prefab.block.BlockSidedIO;
import calclavia.lib.utility.LanguageUtility;
import calclavia.lib.utility.LinkUtility;
import calclavia.lib.utility.WrenchUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -106,18 +106,18 @@ public class BlockTesla extends BlockSidedIO implements ITileEntityProvider
if (WrenchUtility.isWrench(itemStack))
{
if (((TileTesla)tile).tryLink(ToolModeLink.getLink(itemStack)))
if (((TileTesla)tile).tryLink(LinkUtility.getLink(itemStack)))
{
if (world.isRemote)
player.addChatMessage("Successfully linked devices.");
ToolModeLink.clearLink(itemStack);
LinkUtility.clearLink(itemStack);
}
else
{
if (world.isRemote)
player.addChatMessage("Marked link for device.");
ToolModeLink.setLink(itemStack, new VectorWorld(world, x, y, z));
LinkUtility.setLink(itemStack, new VectorWorld(world, x, y, z));
}
return true;

View file

@ -19,8 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly;
/** @author Briman0094 */
public class BlockDetector extends BlockImprintable
{
Icon eye_red;
Icon eye_green;
Icon front_red, front_green, side_green, side_red;
public BlockDetector(int id)
{
@ -28,47 +27,14 @@ public class BlockDetector extends BlockImprintable
setTextureName(Reference.PREFIX + "material_metal_side");
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack)
{
int angle = MathHelper.floor_double((entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int change = 2;
switch (angle)
{
case 0:
change = ForgeDirection.NORTH.ordinal();
break;
case 1:
change = ForgeDirection.EAST.ordinal();
break;
case 2:
change = ForgeDirection.SOUTH.ordinal();
break;
case 3:
change = ForgeDirection.WEST.ordinal();
break;
}
if (entity.rotationPitch < -70f) // up
{
change = ForgeDirection.DOWN.ordinal();
}
if (entity.rotationPitch > 70f) // down
{
change = ForgeDirection.UP.ordinal();
}
world.setBlockMetadataWithNotify(x, y, z, change, 3);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconReg)
{
super.registerIcons(iconReg);
this.eye_green = iconReg.registerIcon(Reference.PREFIX + "detector_green");
this.eye_red = iconReg.registerIcon(Reference.PREFIX + "detector_red");
front_green = iconReg.registerIcon(Reference.PREFIX + "detector_front_green");
front_red = iconReg.registerIcon(Reference.PREFIX + "detector_front_red");
side_green = iconReg.registerIcon(Reference.PREFIX + "detector_side_green");
side_red = iconReg.registerIcon(Reference.PREFIX + "detector_side_red");
super.registerIcons(iconReg);
}
@ -76,24 +42,17 @@ public class BlockDetector extends BlockImprintable
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess iBlockAccess, int x, int y, int z, int side)
{
boolean isInverted = false;
boolean isFront = false;
TileEntity tileEntity = iBlockAccess.getBlockTileEntity(x, y, z);
if (tileEntity instanceof TileDetector)
{
if (side == ForgeDirection.getOrientation(iBlockAccess.getBlockMetadata(x, y, z)).ordinal())
{
if (((TileDetector) tileEntity).isInverted())
{
return this.eye_red;
}
else
{
return this.eye_green;
}
}
isFront = side == ((TileDetector) tileEntity).getDirection().ordinal();
isInverted = ((TileDetector) tileEntity).isInverted();
}
return this.blockIcon;
return isInverted ? (isFront ? front_red : side_red) : (isFront ? front_green : side_green);
}
@Override
@ -102,17 +61,24 @@ public class BlockDetector extends BlockImprintable
{
if (side == ForgeDirection.SOUTH.ordinal())
{
return this.eye_green;
return front_green;
}
return this.blockIcon;
return side_green;
}
@Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
world.setBlockMetadataWithNotify(x, y, z, side, 3);
return true;
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity instanceof TileDetector)
{
((TileDetector) tileEntity).toggleInversion();
return true;
}
return false;
}
@Override

View file

@ -21,13 +21,13 @@ import resonantinduction.core.resource.TileMaterial;
import resonantinduction.core.resource.fluid.TileFluidMixture;
import resonantinduction.core.resource.item.ItemOreResource;
import calclavia.components.tool.ToolMode;
import calclavia.components.tool.ToolModeLink;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.network.PacketAnnotation;
import calclavia.lib.network.PacketHandler;
import calclavia.lib.network.PacketTile;
import calclavia.lib.prefab.item.ItemBlockMetadata;
import calclavia.lib.utility.LanguageUtility;
import calclavia.lib.utility.LinkUtility;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -92,7 +92,6 @@ public class ResonantInduction
ResonantInduction.LOGGER.setParent(FMLLog.getLogger());
NetworkRegistry.instance().registerGuiHandler(this, proxy);
Modstats.instance().getReporter().registerMod(this);
ToolMode.REGISTRY.add(new ToolModeLink());
Settings.load();

View file

@ -75,6 +75,7 @@ tile.resonantinduction\:grate.name=Grate
tile.resonantinduction\:conveyorBelt.name=Conveyor Belt
tile.resonantinduction\:tank.name=Tank
tile.resonantinduction\:detector.name=Detector
tile.resonantinduction\:detector.tooltip=Outputs a Redstone signal upon item detection. Wrench to invert imprint filter.
tile.resonantinduction\:manipulator.name=Manipulator
tile.resonantinduction\:rejector.name=Rejector

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB