need to add bounding for chisel, chisel and sledgehammer crafting, chisel and sledgehammer asset updates
This commit is contained in:
@@ -16,6 +16,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.init.ModBlocks;
|
||||
@@ -65,105 +67,185 @@ public class Chisel extends CustomFacing {
|
||||
if(!player.isSwingInProgress) {
|
||||
if (playerStack.getItem() instanceof SledgeHammer) {
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.CHISEL_HIT, SoundCategory.BLOCKS, 0.8F, 0.3F / (PrimalAPI.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
playerStack.damageItem(1, player);
|
||||
|
||||
if (state.getValue(FACING) == EnumFacing.UP) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (1), (i - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, pos, breakState);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.up(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (1), (i - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.getValue(FACING) == EnumFacing.DOWN) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (-1), (i - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, pos, breakState);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.down(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (-1), (i - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.SOUTH) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i-1), (1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, pos, breakState);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.south(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i-1), (1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.NORTH) {
|
||||
if(PrimalAPI.getRandom().nextInt(1,10)!=1) {
|
||||
if (state.getValue(FACING) == EnumFacing.UP) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a-1), (i-1), (1));
|
||||
BlockPos movePos = pos.add((a - 1), (1), (i - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doBreaking(world, movePos, pos, breakState);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.up(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (1), (i - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.getValue(FACING) == EnumFacing.DOWN) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (-1), (i - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.down(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (-1), (i - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.SOUTH) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i - 1), (1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.south(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i - 1), (1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.NORTH) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i - 1), (-1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.north(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((a - 1), (i - 1), (-1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.EAST) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((1), (i - 1), (a - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.east(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((1), (i - 1), (a - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (state.getValue(FACING) == EnumFacing.WEST) {
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((-1), (i - 1), (a - 1));
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
if (state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
doBreaking(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos.west(), state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
||||
world.setBlockToAir(pos);
|
||||
return true;
|
||||
}
|
||||
if (!state.getValue(PrimalAPI.States.ACTIVE)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int a = 0; a < 3; a++) {
|
||||
BlockPos movePos = pos.add((-1), (i - 1), (a - 1));
|
||||
if (world.getBlockState(movePos).getBlock() != ModBlocks.chisel) {
|
||||
IBlockState breakState = world.getBlockState(movePos);
|
||||
doDamaging(world, movePos, breakState, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalAPI.States.ACTIVE, true), 2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,13 +306,27 @@ public class Chisel extends CustomFacing {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void doBreaking(World world, BlockPos movePos, BlockPos pos, IBlockState state){
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasCustomBreakingProgress(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void doBreaking(World world, BlockPos movePos, IBlockState state, EntityPlayer player){
|
||||
if (!(state.getBlock().equals(Blocks.AIR))) {
|
||||
NonNullList<ItemStack> tempDrops = NonNullList.create();
|
||||
world.getBlockState(movePos).getBlock().getDrops(tempDrops, world, movePos, state, 0);
|
||||
PlayerHelper.spawnItemOnGround(world, pos, tempDrops);
|
||||
world.setBlockToAir(movePos);
|
||||
if(world.getBlockState(movePos).getBlock().getBlockHardness(state, world, movePos)>0) {
|
||||
world.destroyBlock(movePos, player.canHarvestBlock(state));
|
||||
world.sendBlockBreakProgress(player.getEntityId()+PrimalAPI.getRandom().nextInt(100), movePos, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doDamaging(World world, BlockPos movePos, IBlockState state, EntityPlayer player){
|
||||
if (!(state.getBlock().equals(Blocks.AIR))) {
|
||||
if(world.getBlockState(movePos).getBlock().getBlockHardness(state, world, movePos)>0) {
|
||||
world.sendBlockBreakProgress(player.getEntityId() + PrimalAPI.getRandom().nextInt(100), movePos, PrimalAPI.getRandom().nextInt(3,10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ public class ModBlocks {
|
||||
public static Block blockbreaker;
|
||||
public static Block castingform;
|
||||
|
||||
public static Block chisel;
|
||||
public static Block bronzechisel;
|
||||
public static Block copperchisel;
|
||||
public static Block ironchisel;
|
||||
public static Block cleanironchisel;
|
||||
public static Block steelchisel;
|
||||
public static Block wootzchisel;
|
||||
|
||||
public static Block pistonbellowsoak;
|
||||
public static Block pistonbellowsjungle;
|
||||
@@ -54,7 +59,12 @@ public class ModBlocks {
|
||||
blockbreaker = new Breaker(Material.WOOD, "blockbreaker", 4.0f);
|
||||
castingform = new CastingForm(Material.WOOD, "castingform");
|
||||
|
||||
chisel = new Chisel(Material.IRON, "chisel");
|
||||
copperchisel = new Chisel(Material.IRON, "copperchisel");
|
||||
ironchisel = new Chisel(Material.IRON, "ironchisel");
|
||||
bronzechisel = new Chisel(Material.IRON, "bronzechisel");
|
||||
cleanironchisel = new Chisel(Material.IRON, "cleanironchisel");
|
||||
steelchisel = new Chisel(Material.IRON, "steelchisel");
|
||||
wootzchisel = new Chisel(Material.IRON, "wootzchisel");
|
||||
|
||||
pistonbellowsoak = new PistonBellows(Material.WOOD, "pistonbellowsoak");
|
||||
pistonbellowsjungle = new PistonBellows(Material.WOOD, "pistonbellowsjungle");
|
||||
@@ -80,7 +90,12 @@ public class ModBlocks {
|
||||
registerBlockWithItem(blockbreaker);
|
||||
registerBlockWithItem(castingform);
|
||||
|
||||
registerBlockWithItem(chisel);
|
||||
registerBlockWithItem(copperchisel);
|
||||
registerBlockWithItem(bronzechisel);
|
||||
registerBlockWithItem(ironchisel);
|
||||
registerBlockWithItem(cleanironchisel);
|
||||
registerBlockWithItem(steelchisel);
|
||||
registerBlockWithItem(wootzchisel);
|
||||
|
||||
registerBlockWithItem(pistonbellowsoak);
|
||||
registerBlockWithItem(pistonbellowsjungle);
|
||||
@@ -102,7 +117,12 @@ public class ModBlocks {
|
||||
registerRender(forge_adobe);
|
||||
registerRender(castingform);
|
||||
|
||||
registerRender(chisel);
|
||||
registerRender(copperchisel);
|
||||
registerRender(bronzechisel);
|
||||
registerRender(ironchisel);
|
||||
registerRender(cleanironchisel);
|
||||
registerRender(steelchisel);
|
||||
registerRender(wootzchisel);
|
||||
|
||||
registerRender(blockbreaker);
|
||||
registerRender(pistonbellowsoak);
|
||||
|
||||
@@ -53,7 +53,12 @@ public class ModItems {
|
||||
public static Item wootzingotball;
|
||||
public static Item wootzchunk;
|
||||
|
||||
public static Item IRON_SLEDGE_HAMMER;
|
||||
public static Item ironsledgehammer;
|
||||
public static Item coppersledgehammer;
|
||||
public static Item bronzesledgehammer;
|
||||
public static Item cleanironsledgehammer;
|
||||
public static Item steelsledgehammer;
|
||||
public static Item wootzsledgehammer;
|
||||
|
||||
public static Item copperpickaxehead;
|
||||
public static Item copperaxehead;
|
||||
@@ -180,12 +185,6 @@ public class ModItems {
|
||||
coppershovelhead= new ToolPart("coppershovelhead", PrimalAPI.ToolMaterials.TOOL_COPPER, "shovel");
|
||||
copperhoehead = new ToolPart("copperhoehead", PrimalAPI.ToolMaterials.TOOL_COPPER, "hoe");
|
||||
|
||||
copperpickaxe = new CustomPickaxe("copperpickaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperaxe = new CustomAxe("copperaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool, 4, -2.6F);
|
||||
coppershovel = new CustomShovel("coppershovel", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperhoe = new CustomHoe("copperhoe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
|
||||
|
||||
bronzepickaxehead = new ToolPart("bronzepickaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "pickaxe");
|
||||
bronzeaxehead = new ToolPart("bronzeaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "axe");
|
||||
bronzeshovelhead = new ToolPart("bronzeshovelhead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "shovel");
|
||||
@@ -214,31 +213,41 @@ public class ModItems {
|
||||
/**********
|
||||
TOOLS
|
||||
**********/
|
||||
copperpickaxe = new CustomPickaxe("copperpickaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperaxe = new CustomAxe("copperaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool, 4, -2.6F);
|
||||
coppershovel = new CustomShovel("coppershovel", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperhoe = new CustomHoe("copperhoe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
coppersledgehammer = new SledgeHammer("coppersledgehammer", PrimalAPI.ToolMaterials.TOOL_COPPER);
|
||||
|
||||
bronzepickaxe = new CustomPickaxe("bronzepickaxe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzepickaxehead);
|
||||
bronzeaxe = new CustomAxe("bronzeaxe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzeaxehead, 5, -2.4f);
|
||||
bronzeshovel = new CustomShovel("bronzeshovel", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzeshovelhead);
|
||||
bronzehoe = new CustomHoe("bronzehoe", PrimalAPI.ToolMaterials.TOOL_BRONZE, bronzehoehead);
|
||||
bronzesledgehammer = new SledgeHammer("bronzesledgehammer", PrimalAPI.ToolMaterials.TOOL_BRONZE);
|
||||
|
||||
ironpickaxe = new CustomPickaxe("ironpickaxe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, pickaxehead);
|
||||
ironaxe = new CustomAxe("ironaxe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironaxehead, 5, -3.6f);
|
||||
ironshovel = new CustomShovel("ironshovel", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironshovelhead);
|
||||
ironhoe = new CustomHoe("ironhoe", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, ironhoehead);
|
||||
IRON_SLEDGE_HAMMER = new SledgeHammer("ironsledgehammer", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL);
|
||||
ironsledgehammer = new SledgeHammer("ironsledgehammer", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON);
|
||||
|
||||
cleanironpickaxe = new CustomPickaxe("cleanironpickaxe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironpickaxehead);
|
||||
cleanironaxe = new CustomAxe("cleanironaxe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironaxehead, 6, -3.2f);
|
||||
cleanironshovel = new CustomShovel("cleanironshovel", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironshovelhead);
|
||||
cleanironhoe = new CustomHoe("cleanironhoe", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON, cleanironhoehead);
|
||||
cleanironsledgehammer = new SledgeHammer("cleanironsledgehammer", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON);
|
||||
|
||||
steelpickaxe = new CustomPickaxe("steelpickaxe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelpickaxehead);
|
||||
steelaxe = new CustomAxe("steelaxe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelaxehead, 7, -2.8f);
|
||||
steelshovel = new CustomShovel("steelshovel", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelshovelhead);
|
||||
steelhoe = new CustomHoe("steelhoe", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL, steelhoehead);
|
||||
steelsledgehammer = new SledgeHammer("steelsledgehammer", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL);
|
||||
|
||||
wootzpickaxe = new CustomPickaxe("wootzpickaxe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzpickaxehead);
|
||||
wootzaxe = new CustomAxe("wootzaxe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzaxehead, 8, -2.4f);
|
||||
wootzshovel = new CustomShovel("wootzshovel", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzshovelhead);
|
||||
wootzhoe = new CustomHoe("wootzhoe", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL, wootzhoehead);
|
||||
wootzsledgehammer = new SledgeHammer("wootzsledgehammer", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL);
|
||||
|
||||
/**********
|
||||
WEAPONS
|
||||
@@ -328,12 +337,6 @@ public class ModItems {
|
||||
ForgeRegistries.ITEMS.register(coppershovelhead);
|
||||
ForgeRegistries.ITEMS.register(copperhoehead);
|
||||
|
||||
ForgeRegistries.ITEMS.register(copperpickaxe);
|
||||
ForgeRegistries.ITEMS.register(copperaxe);
|
||||
ForgeRegistries.ITEMS.register(coppershovel);
|
||||
ForgeRegistries.ITEMS.register(copperhoe);
|
||||
|
||||
|
||||
ForgeRegistries.ITEMS.register(bronzepickaxehead);
|
||||
ForgeRegistries.ITEMS.register(bronzeaxehead);
|
||||
ForgeRegistries.ITEMS.register(bronzeshovelhead);
|
||||
@@ -343,7 +346,6 @@ public class ModItems {
|
||||
ForgeRegistries.ITEMS.register(ironaxehead);
|
||||
ForgeRegistries.ITEMS.register(ironshovelhead);
|
||||
ForgeRegistries.ITEMS.register(ironhoehead);
|
||||
ForgeRegistries.ITEMS.register(IRON_SLEDGE_HAMMER);
|
||||
|
||||
ForgeRegistries.ITEMS.register(cleanironpickaxehead);
|
||||
ForgeRegistries.ITEMS.register(cleanironaxehead);
|
||||
@@ -363,30 +365,41 @@ public class ModItems {
|
||||
/**********
|
||||
TOOLS
|
||||
**********/
|
||||
ForgeRegistries.ITEMS.register(copperpickaxe);
|
||||
ForgeRegistries.ITEMS.register(copperaxe);
|
||||
ForgeRegistries.ITEMS.register(coppershovel);
|
||||
ForgeRegistries.ITEMS.register(copperhoe);
|
||||
ForgeRegistries.ITEMS.register(coppersledgehammer);
|
||||
|
||||
ForgeRegistries.ITEMS.register(bronzepickaxe);
|
||||
ForgeRegistries.ITEMS.register(bronzeaxe);
|
||||
ForgeRegistries.ITEMS.register(bronzeshovel);
|
||||
ForgeRegistries.ITEMS.register(bronzehoe);
|
||||
ForgeRegistries.ITEMS.register(bronzesledgehammer);
|
||||
|
||||
ForgeRegistries.ITEMS.register(ironpickaxe);
|
||||
ForgeRegistries.ITEMS.register(ironaxe);
|
||||
ForgeRegistries.ITEMS.register(ironshovel);
|
||||
ForgeRegistries.ITEMS.register(ironhoe);
|
||||
ForgeRegistries.ITEMS.register(ironsledgehammer);
|
||||
|
||||
ForgeRegistries.ITEMS.register(cleanironpickaxe);
|
||||
ForgeRegistries.ITEMS.register(cleanironaxe);
|
||||
ForgeRegistries.ITEMS.register(cleanironshovel);
|
||||
ForgeRegistries.ITEMS.register(cleanironhoe);
|
||||
ForgeRegistries.ITEMS.register(cleanironsledgehammer);
|
||||
|
||||
ForgeRegistries.ITEMS.register(steelpickaxe);
|
||||
ForgeRegistries.ITEMS.register(steelaxe);
|
||||
ForgeRegistries.ITEMS.register(steelshovel);
|
||||
ForgeRegistries.ITEMS.register(steelhoe);
|
||||
ForgeRegistries.ITEMS.register(steelsledgehammer);
|
||||
|
||||
ForgeRegistries.ITEMS.register(wootzpickaxe);
|
||||
ForgeRegistries.ITEMS.register(wootzaxe);
|
||||
ForgeRegistries.ITEMS.register(wootzshovel);
|
||||
ForgeRegistries.ITEMS.register(wootzhoe);
|
||||
ForgeRegistries.ITEMS.register(wootzsledgehammer);
|
||||
|
||||
/**********
|
||||
WEAPONS
|
||||
@@ -462,12 +475,6 @@ public class ModItems {
|
||||
registerRender(coppershovelhead);
|
||||
registerRender(copperhoehead);
|
||||
|
||||
registerRender(copperpickaxe);
|
||||
registerRender(copperaxe);
|
||||
registerRender(coppershovel);
|
||||
registerRender(copperhoe);
|
||||
|
||||
|
||||
registerRender(bronzepickaxehead);
|
||||
registerRender(bronzeaxehead);
|
||||
registerRender(bronzeshovelhead);
|
||||
@@ -496,31 +503,41 @@ public class ModItems {
|
||||
/**********
|
||||
TOOLS
|
||||
**********/
|
||||
registerRender(copperpickaxe);
|
||||
registerRender(copperaxe);
|
||||
registerRender(coppershovel);
|
||||
registerRender(copperhoe);
|
||||
registerRender(coppersledgehammer);
|
||||
|
||||
registerRender(bronzepickaxe);
|
||||
registerRender(bronzeaxe);
|
||||
registerRender(bronzeshovel);
|
||||
registerRender(bronzehoe);
|
||||
registerRender(bronzesledgehammer);
|
||||
|
||||
registerRender(ironpickaxe);
|
||||
registerRender(ironaxe);
|
||||
registerRender(ironshovel);
|
||||
registerRender(ironhoe);
|
||||
registerRender(IRON_SLEDGE_HAMMER);
|
||||
registerRender(ironsledgehammer);
|
||||
|
||||
registerRender(cleanironpickaxe);
|
||||
registerRender(cleanironaxe);
|
||||
registerRender(cleanironshovel);
|
||||
registerRender(cleanironhoe);
|
||||
registerRender(cleanironsledgehammer);
|
||||
|
||||
registerRender(steelpickaxe);
|
||||
registerRender(steelaxe);
|
||||
registerRender(steelshovel);
|
||||
registerRender(steelhoe);
|
||||
registerRender(steelsledgehammer);
|
||||
|
||||
registerRender(wootzpickaxe);
|
||||
registerRender(wootzaxe);
|
||||
registerRender(wootzshovel);
|
||||
registerRender(wootzhoe);
|
||||
registerRender(wootzsledgehammer);
|
||||
|
||||
/**********
|
||||
WEAPONS
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package nmd.primal.forgecraft.items;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.MobEffects;
|
||||
@@ -10,9 +12,14 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.forgecraft.util.ToolMaterialMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class SledgeHammer extends BaseItem implements ToolMaterialMap {
|
||||
|
||||
|
||||
@@ -45,7 +52,8 @@ public class SledgeHammer extends BaseItem implements ToolMaterialMap {
|
||||
{
|
||||
if(!world.isRemote) {
|
||||
if (!player.isSwingInProgress) {
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, (100/materialModifiers.get(this.getMaterial()) / (player.getActivePotionEffect(MobEffects.STRENGTH).getAmplifier()+1)), 100));
|
||||
int tempInt = 0;
|
||||
player.addPotionEffect(new PotionEffect(MobEffects.MINING_FATIGUE, (100/(materialModifiers.get(this.getMaterial())+tempInt)), 100));
|
||||
player.swingArm(hand);
|
||||
return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand));
|
||||
}
|
||||
@@ -56,4 +64,12 @@ public class SledgeHammer extends BaseItem implements ToolMaterialMap {
|
||||
public ToolMaterial getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -136,11 +136,10 @@ public abstract class AbstractPickaxe extends ItemPickaxe implements ToolNBT {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
//tooltip.add(ChatFormatting.GRAY + "Damage: " + item.getItemDamage() );
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades left: " + (ToolMaterialMap.materialModifiers.get(this.toolMaterial) - getModifiers(item)));
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.GRAY + "Total Allowed: " + (ToolMaterialMap.materialModifiers.get(this.toolMaterial) ));
|
||||
if (getEmerald(item)) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
|
||||
@@ -287,7 +287,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable {
|
||||
}
|
||||
if(index == 1){
|
||||
if (stack.getItem() == ModItems.softcrucible) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if(Block.getBlockFromItem(stack.getItem()) instanceof NBTCrucible ){
|
||||
return true;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -84,7 +84,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -92,7 +92,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -100,7 +100,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -108,7 +108,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -116,7 +116,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -124,7 +124,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
},
|
||||
@@ -132,7 +132,7 @@
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture": "forgecraft:blocks/stone_slab_hot",
|
||||
"texture1": "forgecraft:items/hot_bronze"
|
||||
"texture1": "forgecraft:items/bronze/1"
|
||||
},
|
||||
"model": "forgecraft:castingcrucible"
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 846 B |
Reference in New Issue
Block a user