Added molten textures

This commit is contained in:
Calclavia 2014-01-28 22:53:53 +08:00
parent 22f75bf48d
commit 9a580564fb
9 changed files with 45 additions and 58 deletions

View file

@ -78,6 +78,7 @@ public class TileFirebox extends TileExternalInventory implements IPacketSender,
if (heatEnergy >= requiredMeltIronEnergy) if (heatEnergy >= requiredMeltIronEnergy)
{ {
TileEntity dustTile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord); TileEntity dustTile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
if (dustTile instanceof TileMaterial) if (dustTile instanceof TileMaterial)
{ {
String name = ((TileMaterial) dustTile).name; String name = ((TileMaterial) dustTile).name;

View file

@ -47,6 +47,7 @@ public class BlockDust extends BlockRI
} }
} }
@SideOnly(Side.CLIENT)
@Override @Override
public int colorMultiplier(IBlockAccess access, int x, int y, int z) public int colorMultiplier(IBlockAccess access, int x, int y, int z)
{ {
@ -54,10 +55,7 @@ public class BlockDust extends BlockRI
if (tileEntity instanceof TileMaterial) if (tileEntity instanceof TileMaterial)
{ {
if (((TileMaterial) tileEntity).name != null) return ((TileMaterial) tileEntity).clientColor;
{
return ResourceGenerator.materialColors.get(((TileMaterial) tileEntity).name);
}
} }
return 16777215; return 16777215;
@ -128,52 +126,6 @@ public class BlockDust extends BlockRI
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
} }
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y,
* z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return true;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed
* (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
this.canSnowStay(par1World, par2, par3, par4);
}
/**
* Checks if this snow block can stay at this location.
*/
private boolean canSnowStay(World par1World, int par2, int par3, int par4)
{
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{
par1World.setBlockToAir(par2, par3, par4);
return false;
}
else
{
return true;
}
}
/**
* Called when the player destroys a block with an item that can harvest it. (i, j, k) are the
* coordinates of the
* block and l is the block's subtype/damage.
*/
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
par1World.setBlockToAir(par3, par4, par5);
}
/** /**
* Returns the ID of the items to drop on destruction. * Returns the ID of the items to drop on destruction.
*/ */

View file

@ -1,6 +1,16 @@
package resonantinduction.core.resource; package resonantinduction.core.resource;
import resonantinduction.core.ResonantInduction;
import com.google.common.io.ByteArrayDataInput;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import calclavia.lib.network.IPacketReceiver;
import calclavia.lib.prefab.tile.TileAdvanced; import calclavia.lib.prefab.tile.TileAdvanced;
/** /**
@ -9,9 +19,10 @@ import calclavia.lib.prefab.tile.TileAdvanced;
* @author Calclavia * @author Calclavia
* *
*/ */
public class TileMaterial extends TileAdvanced public class TileMaterial extends TileAdvanced implements IPacketReceiver
{ {
public String name; public String name;
public int clientColor;
@Override @Override
public boolean canUpdate() public boolean canUpdate()
@ -19,6 +30,24 @@ public class TileMaterial extends TileAdvanced
return false; return false;
} }
@Override
public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra)
{
clientColor = data.readInt();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
@Override
public Packet getDescriptionPacket()
{
if (name != null)
{
return ResonantInduction.PACKET_TILE.getPacket(this, ResourceGenerator.materialColors.get(name));
}
return null;
}
@Override @Override
public void readFromNBT(NBTTagCompound nbt) public void readFromNBT(NBTTagCompound nbt)
{ {

View file

@ -30,7 +30,7 @@ public class BlockFluidMaterial extends BlockFluidFinite implements ITileEntityP
public BlockFluidMaterial() public BlockFluidMaterial()
{ {
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMaterial", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMaterial, Material.lava); super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMaterial", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMaterial, Material.lava);
setTextureName("lava_flow"); setTextureName(Reference.PREFIX + "molten_flow");
this.setUnlocalizedName(Reference.PREFIX + "fluidMaterial"); this.setUnlocalizedName(Reference.PREFIX + "fluidMaterial");
} }
@ -56,13 +56,10 @@ public class BlockFluidMaterial extends BlockFluidFinite implements ITileEntityP
public int colorMultiplier(IBlockAccess access, int x, int y, int z) public int colorMultiplier(IBlockAccess access, int x, int y, int z)
{ {
TileEntity tileEntity = access.getBlockTileEntity(x, y, z); TileEntity tileEntity = access.getBlockTileEntity(x, y, z);
if (tileEntity instanceof TileMaterial) if (tileEntity instanceof TileMaterial)
{ {
if (((TileMaterial) tileEntity).name != null) return ((TileMaterial) tileEntity).clientColor;
{
return ResourceGenerator.materialColors.get(((TileMaterial) tileEntity).name);
}
} }
return 16777215; return 16777215;

View file

@ -27,7 +27,7 @@ public class BlockFluidMixture extends BlockFluidFinite implements ITileEntityPr
public BlockFluidMixture() public BlockFluidMixture()
{ {
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMixture", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMixture, Material.water); super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, "fluidMixture", Settings.getNextBlockID()).getInt(), ResonantInduction.fluidMixture, Material.water);
setTextureName("water_flow"); setTextureName(Reference.PREFIX + "mixture_flow");
this.setUnlocalizedName(Reference.PREFIX + "fluidMixture"); this.setUnlocalizedName(Reference.PREFIX + "fluidMixture");
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View file

@ -0,0 +1,3 @@
{
"animation": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 3
}
}