Merge branch 'master-1.11' into armortest
This commit is contained in:
@@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx3G
|
|||||||
|
|
||||||
mod_group=nmd.primal.forgecraft
|
mod_group=nmd.primal.forgecraft
|
||||||
mod_name=ForgeCraft
|
mod_name=ForgeCraft
|
||||||
mod_version=1.2.62
|
mod_version=1.2.65
|
||||||
forge_version=13.20.0.2315
|
forge_version=13.20.1.2388
|
||||||
mcp_mappings=snapshot_20170121
|
mcp_mappings=snapshot_20170610
|
||||||
mc_version=1.11.2
|
mc_version=1.11.2
|
||||||
|
|
||||||
primal_version=0.4+
|
primal_version=0.4+
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public class ModInfo {
|
|||||||
public static final String MOD_CONFIG = "primal/" + MOD_ID;
|
public static final String MOD_CONFIG = "primal/" + MOD_ID;
|
||||||
//public static final String MOD_PREFIX = MOD_ID + ":";
|
//public static final String MOD_PREFIX = MOD_ID + ":";
|
||||||
public static final String MOD_CHANNEL = MOD_ID;
|
public static final String MOD_CHANNEL = MOD_ID;
|
||||||
public static final String MOD_VERSION = "1.2.62";
|
public static final String MOD_VERSION = "1.2.65";
|
||||||
public static final String MC_VERSIONS = "[1.11.0, 1.12.0)";
|
public static final String MC_VERSIONS = "[1.11.0, 1.12.0)";
|
||||||
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2315,);" + "required-after:primal@[0.4,);";
|
public static final String DEPENDENCIES = "required-after:forge@[13.20.1.2388,);" + "required-after:primal@[0.4,);";
|
||||||
|
|
||||||
/** Mod Structures **/
|
/** Mod Structures **/
|
||||||
public static final String SERVER_PROXY = "nmd.primal.forgecraft.proxy.ServerProxy";
|
public static final String SERVER_PROXY = "nmd.primal.forgecraft.proxy.ServerProxy";
|
||||||
|
|||||||
@@ -119,12 +119,6 @@ public abstract class AnvilBase extends CustomContainerFacing implements AnvilHa
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,12 +33,6 @@ public class BlockCustomBase extends BlockBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import net.minecraft.item.ItemSpade;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
@@ -38,6 +39,7 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
|
|||||||
|
|
||||||
//public static final PropertyBool COVERED = PropertyBool.create("covered");
|
//public static final PropertyBool COVERED = PropertyBool.create("covered");
|
||||||
private int maxHeat;
|
private int maxHeat;
|
||||||
|
public AxisAlignedBB AABB = new AxisAlignedBB(5/32D, 0.0D, 5/32D, 27/32D, 12/16D, 27/32D);
|
||||||
|
|
||||||
public BloomeryBase(Material material, String registryName, Integer maxHeat) {
|
public BloomeryBase(Material material, String registryName, Integer maxHeat) {
|
||||||
super(material, registryName);
|
super(material, registryName);
|
||||||
@@ -48,6 +50,12 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
|
|||||||
this.maxHeat=maxHeat;
|
this.maxHeat=maxHeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||||
|
{
|
||||||
|
return AABB;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMaxHeat() {
|
public int getMaxHeat() {
|
||||||
return maxHeat;
|
return maxHeat;
|
||||||
}
|
}
|
||||||
@@ -76,105 +84,107 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if (!world.isRemote) {
|
|
||||||
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
|
|
||||||
if (tile != null) {
|
|
||||||
ItemStack pItem = player.inventory.getCurrentItem();
|
|
||||||
ItemStack tileItem = tile.getSlotStack(0);
|
|
||||||
ItemStack tileItem1 = tile.getSlotStack(1);
|
|
||||||
if(pItem.isEmpty()) {
|
|
||||||
|
|
||||||
if(!player.isSneaking()){
|
if (world.isRemote)
|
||||||
if(world.getBlockState(pos).getValue(PrimalStates.ACTIVE) == true){
|
return true;
|
||||||
Integer bloomeryHeat = tile.getHeat();
|
|
||||||
Integer idealTemp = null;
|
|
||||||
|
|
||||||
|
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
|
||||||
|
if (tile != null) {
|
||||||
|
ItemStack pItem = player.inventory.getCurrentItem();
|
||||||
|
ItemStack tileItem = tile.getSlotStack(0);
|
||||||
|
ItemStack tileItem1 = tile.getSlotStack(1);
|
||||||
|
if(pItem.isEmpty()) {
|
||||||
|
|
||||||
|
if(!player.isSneaking()){
|
||||||
|
if(world.getBlockState(pos).getValue(PrimalStates.ACTIVE) == true){
|
||||||
|
|
||||||
|
Integer bloomeryHeat = tile.getHeat();
|
||||||
|
String display = "\n" + "Current Temp: " + bloomeryHeat.toString() +
|
||||||
|
" Fuel Remaining: " + tileItem.getCount();
|
||||||
|
ITextComponent itextcomponent = new TextComponentString(display);
|
||||||
|
player.sendStatusMessage(itextcomponent, false);
|
||||||
|
|
||||||
|
BloomeryCrafting recipe = BloomeryCrafting.getRecipe(tile.getSlotStack(1));
|
||||||
|
if(recipe != null) {
|
||||||
|
Integer minTemp = recipe.getHeatThreshold();
|
||||||
Integer cookCounter = tile.getCookCounter();
|
Integer cookCounter = tile.getCookCounter();
|
||||||
Integer idealCookTime = null;
|
Integer idealTime = recipe.getIdealTime();
|
||||||
Integer remainingTime = null;
|
Integer remainingTime = idealTime - cookCounter;
|
||||||
|
|
||||||
String stringBloomeryHeat = bloomeryHeat.toString();
|
String display1 =
|
||||||
String stringIdealTemp = "";
|
"Cooking: " + tileItem1.getDisplayName() +
|
||||||
String stringRemainingTime = "";
|
" Target Temp: " + minTemp.toString() +
|
||||||
|
" Time Left: " + remainingTime.toString();
|
||||||
|
ITextComponent itextcomponent1 = new TextComponentString(display1);
|
||||||
|
player.sendStatusMessage(itextcomponent1, false);
|
||||||
|
|
||||||
BloomeryCrafting recipe = BloomeryCrafting.getRecipe(tile.getSlotStack(1));
|
|
||||||
if(recipe != null) {
|
|
||||||
idealTemp = recipe.getHeatThreshold();
|
|
||||||
idealCookTime = recipe.getIdealTime();
|
|
||||||
stringIdealTemp = idealTemp.toString();
|
|
||||||
remainingTime = idealCookTime - cookCounter;
|
|
||||||
stringRemainingTime = remainingTime.toString();
|
|
||||||
|
|
||||||
}
|
|
||||||
String display =
|
|
||||||
"Current Temp: " + stringBloomeryHeat
|
|
||||||
+ "Ideal Temp: " + stringIdealTemp
|
|
||||||
+ "Ticks Remaining: " + stringRemainingTime
|
|
||||||
+ "Fuel Remaining: " + tile.getSlotStack(0).getCount();
|
|
||||||
ITextComponent itextcomponent = new TextComponentString(display);
|
|
||||||
player.sendStatusMessage(itextcomponent, true);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if(tile.getSlotStack(0) != ItemStack.EMPTY) {
|
|
||||||
if((FireSource.useSource(world, pos, player, pItem, hand, facing, hitX, hitY, hitZ))) {
|
|
||||||
world.setBlockState(pos, state.withProperty(PrimalStates.ACTIVE, true), 2);
|
|
||||||
tile.setHeat(100);
|
|
||||||
tile.markDirty();
|
|
||||||
tile.updateBlock();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
|
|
||||||
if (!tileItem.isEmpty()){
|
|
||||||
if(pItem.getItem() == tileItem.getItem()){
|
|
||||||
if(tileItem.getCount() < 64){
|
|
||||||
if(tileItem.getCount() + pItem.getCount() <= 64){
|
|
||||||
tileItem.grow(pItem.getCount());
|
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
|
||||||
tile.markDirty();
|
|
||||||
tile.updateBlock();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(tileItem.getCount() + pItem.getCount() > 64){
|
|
||||||
pItem.setCount(64-pItem.getCount());
|
|
||||||
tileItem.setCount(64);
|
|
||||||
tile.markDirty();
|
|
||||||
tile.updateBlock();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(tileItem.isEmpty()) {
|
|
||||||
tile.setSlotStack(0, pItem);
|
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if((!pItem.isEmpty()) && tile.isItemValidForSlot(1, pItem)) {
|
|
||||||
if (!tileItem1.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(tileItem1.isEmpty()){
|
|
||||||
ItemStack tempItem = new ItemStack(pItem.getItem(), 1);
|
|
||||||
tile.setSlotStack(1, tempItem);
|
|
||||||
pItem.shrink(1);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
if (!tile.getSlotStack(0).isEmpty()) {
|
|
||||||
if(player.inventory.getCurrentItem().getItem() instanceof ItemSpade) {
|
|
||||||
ItemStack returnStack = tile.getSlotStack(0).copy();
|
|
||||||
PlayerHelper.spawnItemOnPlayer(world, player, returnStack);
|
|
||||||
tile.clearSlot(0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tile.getSlotStack(0) != ItemStack.EMPTY) {
|
||||||
|
if((FireSource.useSource(world, pos, player, pItem, hand, facing, hitX, hitY, hitZ))) {
|
||||||
|
world.setBlockState(pos, state.withProperty(PrimalStates.ACTIVE, true), 2);
|
||||||
|
tile.setHeat(100);
|
||||||
|
tile.markDirty();
|
||||||
|
tile.updateBlock();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((!pItem.isEmpty()) && tile.isItemValidForSlot(0, pItem)) {
|
||||||
|
if (!tileItem.isEmpty()){
|
||||||
|
if(pItem.getItem() == tileItem.getItem()){
|
||||||
|
if(tileItem.getCount() < 64){
|
||||||
|
if(tileItem.getCount() + pItem.getCount() <= 64){
|
||||||
|
tileItem.grow(pItem.getCount());
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
||||||
|
tile.markDirty();
|
||||||
|
tile.updateBlock();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(tileItem.getCount() + pItem.getCount() > 64){
|
||||||
|
pItem.setCount(64-pItem.getCount());
|
||||||
|
tileItem.setCount(64);
|
||||||
|
tile.markDirty();
|
||||||
|
tile.updateBlock();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tileItem.isEmpty()) {
|
||||||
|
tile.setSlotStack(0, pItem);
|
||||||
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if((!pItem.isEmpty()) && tile.isItemValidForSlot(1, pItem)) {
|
||||||
|
if (!tileItem1.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(tileItem1.isEmpty()){
|
||||||
|
ItemStack tempItem = new ItemStack(pItem.getItem(), 1);
|
||||||
|
tile.setSlotStack(1, tempItem);
|
||||||
|
pItem.shrink(1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (player.isSneaking()) {
|
||||||
|
if (!tile.getSlotStack(0).isEmpty()) {
|
||||||
|
if(player.inventory.getCurrentItem().getItem() instanceof ItemSpade) {
|
||||||
|
ItemStack returnStack = tile.getSlotStack(0).copy();
|
||||||
|
PlayerHelper.spawnItemOnPlayer(world, player, returnStack);
|
||||||
|
tile.clearSlot(0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -354,11 +364,6 @@ public class BloomeryBase extends CustomContainerFacing implements ITileEntityPr
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.EnumBlockRenderType;
|
import net.minecraft.util.EnumBlockRenderType;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -28,6 +29,8 @@ import nmd.primal.forgecraft.util.BreakerHandler;
|
|||||||
*/
|
*/
|
||||||
public class Breaker extends CustomContainerFacing implements BreakerHandler {
|
public class Breaker extends CustomContainerFacing implements BreakerHandler {
|
||||||
|
|
||||||
|
public AxisAlignedBB AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 6/16D, 1.0D);
|
||||||
|
|
||||||
public Breaker(Material material, String registryName, Float hardness) {
|
public Breaker(Material material, String registryName, Float hardness) {
|
||||||
super(material, registryName);
|
super(material, registryName);
|
||||||
setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||||
@@ -35,6 +38,12 @@ public class Breaker extends CustomContainerFacing implements BreakerHandler {
|
|||||||
setHardness(hardness);
|
setHardness(hardness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||||
|
{
|
||||||
|
return AABB;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
|
||||||
|
|
||||||
@@ -42,17 +51,6 @@ public class Breaker extends CustomContainerFacing implements BreakerHandler {
|
|||||||
TileBreaker tile = (TileBreaker) world.getTileEntity(pos);
|
TileBreaker tile = (TileBreaker) world.getTileEntity(pos);
|
||||||
ItemStack pItem = player.inventory.getCurrentItem();
|
ItemStack pItem = player.inventory.getCurrentItem();
|
||||||
|
|
||||||
/*if(tile.getCharge() < 5 ){
|
|
||||||
if(pItem == ItemStack.EMPTY){
|
|
||||||
if(player.isSneaking()){
|
|
||||||
ItemStack tempStack = tile.getSlotStack(0).copy();
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, tempStack);
|
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(state.getValue(PrimalStates.ACTIVE) == true && player.isSneaking() && pItem.isEmpty()){
|
if(state.getValue(PrimalStates.ACTIVE) == true && player.isSneaking() && pItem.isEmpty()){
|
||||||
doBreaking(world, state, pos, tile);
|
doBreaking(world, state, pos, tile);
|
||||||
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalStates.ACTIVE, false));
|
world.setBlockState(pos, state.withProperty(FACING, state.getValue(FACING)).withProperty(PrimalStates.ACTIVE, false));
|
||||||
@@ -215,11 +213,6 @@ public class Breaker extends CustomContainerFacing implements BreakerHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||||||
import nmd.primal.core.common.helper.CommonUtils;
|
import nmd.primal.core.common.helper.CommonUtils;
|
||||||
import nmd.primal.core.common.helper.PlayerHelper;
|
import nmd.primal.core.common.helper.PlayerHelper;
|
||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
|
import nmd.primal.forgecraft.init.ModBlocks;
|
||||||
import nmd.primal.forgecraft.init.ModItems;
|
import nmd.primal.forgecraft.init.ModItems;
|
||||||
import nmd.primal.forgecraft.items.casting.CastingPart;
|
import nmd.primal.forgecraft.items.casting.CastingPart;
|
||||||
import nmd.primal.forgecraft.tiles.TileCastingBlock;
|
import nmd.primal.forgecraft.tiles.TileCastingBlock;
|
||||||
@@ -98,10 +99,13 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(pItem.getItem() == ModItems.stonetongs ){
|
if(pItem.getItem() == ModItems.stonetongs ){
|
||||||
|
ItemStack dropCrucible = new ItemStack(ModBlocks.emptycrucible);
|
||||||
if(pItem.getTagCompound().getInteger("type") == 40){
|
if(pItem.getTagCompound().getInteger("type") == 40){
|
||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_hoe){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_hoe){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzehoehead);
|
ItemStack dropStack = new ItemStack(ModItems.bronzehoehead);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -112,6 +116,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_pickaxe){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_pickaxe){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzepickaxehead);
|
ItemStack dropStack = new ItemStack(ModItems.bronzepickaxehead);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -121,6 +126,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_axe){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_axe){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzeaxehead);
|
ItemStack dropStack = new ItemStack(ModItems.bronzeaxehead);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -130,6 +136,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_shovel){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_shovel){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzeshovelhead);
|
ItemStack dropStack = new ItemStack(ModItems.bronzeshovelhead);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -139,6 +146,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_gladius){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_gladius){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -170,6 +178,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -191,6 +200,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -212,6 +222,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -233,6 +244,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -242,6 +254,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if(tile.getSlotStack(0).getItem() == ModItems.cast_gladius){
|
if(tile.getSlotStack(0).getItem() == ModItems.cast_gladius){
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -264,6 +277,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if (CommonUtils.randomCheck(2)) {
|
if (CommonUtils.randomCheck(2)) {
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -284,6 +298,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if (CommonUtils.randomCheck(2)) {
|
if (CommonUtils.randomCheck(2)) {
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -306,6 +321,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if (CommonUtils.randomCheck(2)) {
|
if (CommonUtils.randomCheck(2)) {
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -328,6 +344,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if (CommonUtils.randomCheck(2)) {
|
if (CommonUtils.randomCheck(2)) {
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -337,6 +354,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if (CommonUtils.randomCheck(2)) {
|
if (CommonUtils.randomCheck(2)) {
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -359,6 +377,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -379,6 +398,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -401,6 +421,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -423,6 +444,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -432,6 +454,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -454,6 +477,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -474,6 +498,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
dropStack.getSubCompound("tags").setInteger("modifiers", 1);
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -496,6 +521,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -518,6 +544,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
|
|
||||||
|
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -527,6 +554,7 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
if (tile.getSlotStack(0).getItem() == ModItems.cast_gladius) {
|
||||||
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
ItemStack dropStack = new ItemStack(ModItems.bronzegladius);
|
||||||
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
PlayerHelper.spawnItemOnGround(world, pos, dropStack);
|
||||||
|
PlayerHelper.spawnItemOnGround(world, pos, dropCrucible);
|
||||||
pItem.getTagCompound().setInteger("type", 0);
|
pItem.getTagCompound().setInteger("type", 0);
|
||||||
if(CommonUtils.randomCheck(2)){
|
if(CommonUtils.randomCheck(2)){
|
||||||
tile.setSlotStack(0, ItemStack.EMPTY);
|
tile.setSlotStack(0, ItemStack.EMPTY);
|
||||||
@@ -638,12 +666,6 @@ public class CastingBlock extends CustomContainerFacing {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import net.minecraft.block.properties.IProperty;
|
|||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -29,7 +30,7 @@ import java.util.Random;
|
|||||||
*/
|
*/
|
||||||
public class CastingForm extends CustomContainerFacing implements CastingFormHandler{
|
public class CastingForm extends CustomContainerFacing implements CastingFormHandler{
|
||||||
|
|
||||||
protected static AxisAlignedBB bound = new AxisAlignedBB(0/16D, 0.0D, 0/16D, 16/16D, 5/16D, 16/16D);
|
protected static AxisAlignedBB bound = new AxisAlignedBB(0/16D, 0.0D, 0/16D, 16/16D, 3/16D, 16/16D);
|
||||||
|
|
||||||
public CastingForm(Material material, String registryName) {
|
public CastingForm(Material material, String registryName) {
|
||||||
super(material, registryName);
|
super(material, registryName);
|
||||||
@@ -57,7 +58,7 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
|||||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random random)
|
public void updateTick(World world, BlockPos pos, IBlockState state, Random random)
|
||||||
{
|
{
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
if(CommonUtils.randomCheck(10)) {
|
if(CommonUtils.randomCheck(4)) {
|
||||||
TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos);
|
TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos);
|
||||||
String[] tempArray = new String[25];
|
String[] tempArray = new String[25];
|
||||||
for (int i = 0; i < 25; i++) {
|
for (int i = 0; i < 25; i++) {
|
||||||
@@ -68,6 +69,32 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||||
|
{
|
||||||
|
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
|
||||||
|
{
|
||||||
|
TileCastingForm tile = (TileCastingForm) world.getTileEntity(pos);
|
||||||
|
if (tile !=null)
|
||||||
|
{
|
||||||
|
for (ItemStack stack : tile.getSlotList())
|
||||||
|
{
|
||||||
|
if (stack != null) {
|
||||||
|
float offset = 0.7F;
|
||||||
|
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
|
||||||
|
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
|
||||||
|
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
|
||||||
|
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
|
||||||
|
item.setDefaultPickupDelay();
|
||||||
|
world.spawnEntity(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.breakBlock(world, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||||
@@ -142,11 +169,6 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
|
|||||||
@@ -167,12 +167,6 @@ public class Crucible extends Block {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,12 +78,6 @@ public class CrucibleHot extends Block implements ITileEntityProvider {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -420,12 +420,6 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,12 +342,6 @@ public class PistonBellows extends CustomContainerFacing {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFullyOpaque(IBlockState state)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state)
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable {
|
|||||||
|
|
||||||
private void slotZeroManager(World world){
|
private void slotZeroManager(World world){
|
||||||
if(this.getSlotStack(0) != ItemStack.EMPTY) {
|
if(this.getSlotStack(0) != ItemStack.EMPTY) {
|
||||||
Integer decrInt = (int) Math.floor(CommonUtils.getVanillaItemBurnTime(this.getSlotStack(0)) / 5);
|
Integer decrInt = (int) Math.floor(CommonUtils.getBurnTime(this.getSlotStack(0)) / 5);
|
||||||
if(decrInt == 0) {
|
if(decrInt == 0) {
|
||||||
decrInt = 1;
|
decrInt = 1;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ public class TileBloomery extends TileBaseSlot implements ITickable {
|
|||||||
}
|
}
|
||||||
if (world.rand.nextInt(decrInt) == 0) {
|
if (world.rand.nextInt(decrInt) == 0) {
|
||||||
if (world.rand.nextInt(burnModifier) == 0) {
|
if (world.rand.nextInt(burnModifier) == 0) {
|
||||||
System.out.println("Fuel Burn" + this.getSlotStack(0));
|
//System.out.println("Fuel Burn" + this.getSlotStack(0));
|
||||||
this.decrStackSize(0, 1);
|
this.decrStackSize(0, 1);
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
this.updateBlock();
|
this.updateBlock();
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class TileForge extends TileBaseSlot implements ITickable {
|
|||||||
|
|
||||||
private void slotZeroManager(World world){
|
private void slotZeroManager(World world){
|
||||||
if(this.getSlotStack(0) != ItemStack.EMPTY) {
|
if(this.getSlotStack(0) != ItemStack.EMPTY) {
|
||||||
Integer decrInt = (int) Math.floor(getVanillaItemBurnTime(this.getSlotStack(0)) / 5);
|
Integer decrInt = (int) Math.floor(CommonUtils.getBurnTime(this.getSlotStack(0)) / 5);
|
||||||
if(decrInt == 0) {
|
if(decrInt == 0) {
|
||||||
decrInt = 1;
|
decrInt = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package nmd.primal.forgecraft.util;
|
|||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
@@ -35,61 +37,53 @@ public interface BreakerHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
int checkid = OreDictionary.getOreID(oreDictName);
|
|
||||||
for (int id:OreDictionary.getOreIDs(stack))
|
|
||||||
if(id == checkid) return true;
|
|
||||||
return false;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// somewhere else
|
|
||||||
//if(hasOreName(new ItemStack(Blocks.LOG), "logWood"))
|
|
||||||
// item is logWood
|
|
||||||
|
|
||||||
default boolean doBreaking(World world, IBlockState state, BlockPos pos, TileBreaker tile) {
|
default boolean doBreaking(World world, IBlockState state, BlockPos pos, TileBreaker tile) {
|
||||||
for (int i=0; i < EnumFacing.HORIZONTALS.length; i++) {
|
for (int i=0; i < EnumFacing.HORIZONTALS.length; i++) {
|
||||||
EnumFacing face = world.getBlockState(pos).getValue(CustomContainerFacing.FACING);
|
EnumFacing face = world.getBlockState(pos).getValue(CustomContainerFacing.FACING);
|
||||||
if(face.equals(world.getBlockState(pos).getValue(CustomContainerFacing.FACING))){
|
if(face.equals(world.getBlockState(pos).getValue(CustomContainerFacing.FACING))){
|
||||||
Block smashBlock = world.getBlockState(pos.offset(face)).getBlock();
|
//Block smashBlock = world.getBlockState(pos.offset(face)).getBlock();
|
||||||
ItemStack smashStack = new ItemStack(smashBlock);
|
IBlockState smashState = world.getBlockState(pos.offset(face));
|
||||||
if (hasOreName(smashStack, "oreIron")) {
|
if(!smashState.getBlock().equals(Blocks.AIR)) {
|
||||||
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
ItemStack smashStack = new ItemStack(Item.getItemFromBlock(smashState.getBlock()), 1, smashState.getBlock().getMetaFromState(state));
|
||||||
world.setBlockToAir(pos.offset(face));
|
if (hasOreName(smashStack, "oreIron")) {
|
||||||
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.IRON_DUST, randomChanceReturn(9, 1, 2)));
|
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
||||||
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
world.setBlockToAir(pos.offset(face));
|
||||||
return true;
|
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.IRON_DUST, randomChanceReturn(9, 1, 2)));
|
||||||
|
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (hasOreName(smashStack, "oreCopper")) {
|
||||||
if (hasOreName(smashStack, "oreCopper")) {
|
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
||||||
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
world.setBlockToAir(pos.offset(face));
|
||||||
world.setBlockToAir(pos.offset(face));
|
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.COPPER_DUST, randomChanceReturn(9, 1, 2)));
|
||||||
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.COPPER_DUST, randomChanceReturn(9, 1, 2)));
|
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
||||||
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
if (hasOreName(smashStack, "oreTin")) {
|
||||||
if (hasOreName(smashStack, "oreTin")) {
|
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
||||||
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
world.setBlockToAir(pos.offset(face));
|
||||||
world.setBlockToAir(pos.offset(face));
|
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.TIN_DUST, randomChanceReturn(9, 1, 2)));
|
||||||
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.TIN_DUST, randomChanceReturn(9, 1, 2)));
|
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
||||||
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
if (hasOreName(smashStack, "oreZinc")) {
|
||||||
if (hasOreName(smashStack, "oreZinc")) {
|
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
||||||
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
world.setBlockToAir(pos.offset(face));
|
||||||
world.setBlockToAir(pos.offset(face));
|
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.ZINC_DUST, randomChanceReturn(9, 1, 2)));
|
||||||
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.ZINC_DUST, randomChanceReturn(9, 1, 2)));
|
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
||||||
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
if (hasOreName(smashStack, "oreGold")) {
|
||||||
if (hasOreName(smashStack, "oreGold")) {
|
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
||||||
if (tile.getCharge() > getThreshold(world, pos.offset(face))) {
|
world.setBlockToAir(pos.offset(face));
|
||||||
world.setBlockToAir(pos.offset(face));
|
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.GOLD_DUST, randomChanceReturn(9, 1, 2)));
|
||||||
PlayerHelper.spawnItemOnGround(world, pos.offset(face), new ItemStack(PrimalItems.GOLD_DUST, randomChanceReturn(9, 1, 2)));
|
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
||||||
tile.getSlotStack(0).setItemDamage(tile.getSlotStack(0).getItemDamage() + 1);
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -618,7 +618,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -654,7 +654,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 130, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -690,7 +690,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -690,7 +690,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -718,7 +718,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -684,7 +684,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -764,7 +764,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -774,7 +774,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -559,7 +559,7 @@
|
|||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 10, 3, 5 ],
|
"rotation": [ 13, 3, 5 ],
|
||||||
"translation": [ -2, 0, 0 ],
|
"translation": [ -2, 0, 0 ],
|
||||||
"scale": [ 0.5, 0.875, 0.75 ]
|
"scale": [ 0.5, 0.875, 0.75 ]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"modid": "forgecraft",
|
"modid": "forgecraft",
|
||||||
"name": "Kitsu's Forgecraft",
|
"name": "Kitsu's Forgecraft",
|
||||||
"description": "Forged with sweat and blood",
|
"description": "Forged with sweat and blood",
|
||||||
"version": "1.2.62",
|
"version": "1.2.65",
|
||||||
"mcversion": "1.11.2",
|
"mcversion": "1.11.2",
|
||||||
"url": "",
|
"url": "",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user