improve item burning
This commit is contained in:
parent
32d6f15c4a
commit
1766dfd4dc
12 changed files with 47 additions and 31 deletions
|
@ -1025,6 +1025,10 @@ public class Block {
|
|||
return null;
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getFuelAmount() {
|
||||
return this.material == Material.WOOD ? 300 : 0;
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
|
||||
public class BlockMagnetic extends Block
|
||||
{
|
||||
public BlockMagnetic(Material material)
|
||||
{
|
||||
super(material);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
}
|
18
common/src/main/java/common/block/artificial/BlockMagneticExplosive.java
Executable file
18
common/src/main/java/common/block/artificial/BlockMagneticExplosive.java
Executable file
|
@ -0,0 +1,18 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
|
||||
public class BlockMagneticExplosive extends Block {
|
||||
public BlockMagneticExplosive(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return 3;
|
||||
}
|
||||
}
|
|
@ -41,6 +41,10 @@ public class BlockMetalBlock extends Block {
|
|||
tooltip.add(this.metal.formatRarity());
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return this.metal.radioactivity > 0.0f ? 3 : 0;
|
||||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map)
|
||||
{
|
||||
if(this.metal.radioactivity > 0.0f)
|
||||
|
|
|
@ -36,6 +36,10 @@ public class BlockMetalOre extends BlockOre {
|
|||
tooltip.add(this.metal.formatRarity());
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return this.metal.radioactivity > 0.0f ? 2 : 0;
|
||||
}
|
||||
|
||||
public void getModifiers(Map<Attribute, Float> map)
|
||||
{
|
||||
if(this.metal.radioactivity > 0.0f)
|
||||
|
|
|
@ -57,4 +57,8 @@ public class BlockNuke extends Block
|
|||
public Color getItemColor() {
|
||||
return Color.RED;
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,6 +165,10 @@ public class BlockTNT extends Block
|
|||
return Color.RED;
|
||||
}
|
||||
|
||||
public int getExplosive() {
|
||||
return 1 + this.power;
|
||||
}
|
||||
|
||||
public boolean dispense(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
blockpos = blockpos.offset(facing);
|
||||
EntityTnt entitytntprimed = new EntityTnt(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLiving)null, this.power);
|
||||
|
|
|
@ -11,7 +11,7 @@ import common.block.artificial.BlockBed;
|
|||
import common.block.artificial.BlockBookshelf;
|
||||
import common.block.artificial.BlockCake;
|
||||
import common.block.artificial.BlockCarpet;
|
||||
import common.block.artificial.BlockMagnetic;
|
||||
import common.block.artificial.BlockMagneticExplosive;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.block.artificial.BlockDragonEgg;
|
||||
import common.block.artificial.BlockFence;
|
||||
|
@ -412,7 +412,7 @@ public abstract class BlockRegistry {
|
|||
.setSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningTool(Equipment.PICKAXE, 1));
|
||||
register("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
|
||||
.setSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningTool(Equipment.PICKAXE, 2));
|
||||
register("charged_block", (new BlockMagnetic(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
|
||||
register("charged_block", (new BlockMagneticExplosive(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
|
||||
.setSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS));
|
||||
|
||||
register("glass", (new BlockGlass()).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Glas"));
|
||||
|
|
|
@ -409,7 +409,7 @@ public abstract class Blocks {
|
|||
public static final BlockFalling red_sand = get("red_sand");
|
||||
public static final BlockFlower red_tulip = get("red_tulip");
|
||||
public static final BlockWool red_wool = get("red_wool");
|
||||
public static final BlockMagnetic charged_block = get("charged_block");
|
||||
public static final BlockMagneticExplosive charged_block = get("charged_block");
|
||||
public static final BlockOre charge_ore = get("charge_ore");
|
||||
public static final BlockReed reeds = get("reeds");
|
||||
public static final Block rock = get("rock");
|
||||
|
|
|
@ -55,7 +55,9 @@ public class Item {
|
|||
this.setMaxAmount(this.block.getMaxAmount());
|
||||
if(this.block.getItemColor() != null)
|
||||
this.setColor(this.block.getItemColor());
|
||||
if(this.block.getFuelAmount() > 0)
|
||||
if(this.block.getExplosive() > 0)
|
||||
this.setExplosive(this.block.getExplosive());
|
||||
else if(this.block.getFuelAmount() > 0)
|
||||
this.setFuelAmount(this.block.getFuelAmount());
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
package common.tileentity;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.block.artificial.BlockSlab;
|
||||
import common.block.foliage.BlockSapling;
|
||||
import common.block.tech.BlockFurnace;
|
||||
import common.collect.Lists;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.init.SmeltingRegistry;
|
||||
import common.init.ToolType;
|
||||
import common.inventory.Container;
|
||||
import common.inventory.ContainerFurnace;
|
||||
import common.inventory.IInventory;
|
||||
|
@ -18,8 +12,6 @@ import common.inventory.ISidedInventory;
|
|||
import common.inventory.SlotFurnaceFuel;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemBucket;
|
||||
import common.item.tool.ItemTool;
|
||||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
import common.util.ExtMath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue