Skip to content

Instantly share code, notes, and snippets.

@Prospector
Created July 29, 2015 16:08
Show Gist options
  • Select an option

  • Save Prospector/64ae68d20da74981e5db to your computer and use it in GitHub Desktop.

Select an option

Save Prospector/64ae68d20da74981e5db to your computer and use it in GitHub Desktop.
package com.thedoctorsoda.mechconstruct.tileentity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import com.thedoctorsoda.mechconstruct.init.ModItems;
public class TileEntitySturdyTableTDS extends TileEntityTDS {
@Override
public void updateEntity() {
if (worldObj.getBlock(xCoord, yCoord + 2, zCoord) == Blocks.anvil) {
if (worldObj.getBlock(xCoord, yCoord + 1, zCoord) == Blocks.diamond_block) {
if (!worldObj.isRemote) {
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
EntityItem itemCarbonDust = new EntityItem(worldObj, xCoord, yCoord + 1, zCoord, new ItemStack(ModItems.carbon_dust, 32));
worldObj.spawnEntityInWorld(itemCarbonDust);
}
}
if (worldObj.getBlock(xCoord, yCoord + 1, zCoord) == Blocks.coal_block) {
if (!worldObj.isRemote) {
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
EntityItem itemCarbonDust = new EntityItem(worldObj, xCoord, yCoord + 1, zCoord, new ItemStack(ModItems.carbon_dust, 4));
worldObj.spawnEntityInWorld(itemCarbonDust);
}
}
} else {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment