Merge branch 'master' into weaponry

This commit is contained in:
Bernhard Bonigl committed 2014-10-06 11:19:06 +02:00
commit 6adeb21d7c
7 files changed
+40 -8

No files matched your search

@@ -68,7 +68,7 @@ public class SlimeLeaves extends BlockLeaves
@SideOnly(Side.CLIENT)
public IIcon getIcon (int side, int meta)
{
int tex = meta % 4;
int tex = meta % 1;
this.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics);
if (this.field_150121_P)
return fancyIcons[tex];
@@ -11,6 +11,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.BowstringMaterial;
import tconstruct.library.tools.CustomMaterial;
import tconstruct.tools.TinkerTools;
import tconstruct.weaponry.TinkerWeaponry;
@@ -45,8 +46,11 @@ public class Shortbow extends BowBase
@Override
protected int getDefaultColor(int renderPass, int materialID) {
// bowstring uses custom material
if(renderPass == 0)
return TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class).color;
if(renderPass == 0) {
CustomMaterial mat = TConstructRegistry.getCustomMaterial(materialID, BowstringMaterial.class);
if(mat != null)
return mat.color;
}
return super.getDefaultColor(renderPass, materialID);
}
@@ -37,15 +37,19 @@ public class ShapelessToolRecipe extends ShapelessRecipes
ItemStack itemstack1 = (ItemStack) iterator.next();
// TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage());
if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
if (itemstack.getItem() == itemstack1.getItem())
{
if (itemstack.getItem() instanceof ToolCore)
{
NBTTagCompound tags = itemstack.getTagCompound().getCompoundTag("InfiTool");
if (tags.getBoolean("Broken"))
return false;
flag = true;
}
flag = true;
else if((itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
flag = true;
arraylist.remove(itemstack1);
break;
}
@@ -82,7 +82,7 @@ public abstract class AOEHarvestTool extends HarvestTool {
// don't break the originally already broken block, duh
if (xPos == x && yPos == y && zPos == z)
continue;
breakExtraBlock(player.worldObj, xPos, yPos, zPos, sideHit, player);
breakExtraBlock(player.worldObj, xPos, yPos, zPos, sideHit, player, x,y,z);
}
}
@@ -221,7 +221,7 @@ public abstract class HarvestTool extends ToolCore
return used;
}
protected void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer player) {
protected void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer player, int refX, int refY, int refZ) {
// prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events
if (world.isAirBlock(x, y, z))
return;
@@ -235,8 +235,12 @@ public abstract class HarvestTool extends ToolCore
if (!isEffective(block, meta))
return;
Block refBlock = world.getBlock(refX, refY, refZ);
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
float strength = ForgeHooks.blockStrength(block, player, world, x,y,z);
// only harvestable blocks that aren't impossibly slow to harvest
if (!ForgeHooks.canHarvestBlock(block, player, meta) || ForgeHooks.blockStrength(block, player, world, x, y, z) <= 0.0001f)
if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f)
return;
if (player.capabilities.isCreativeMode) {
@@ -15,6 +15,14 @@ public class TableRender implements ISimpleBlockRenderingHandler
{
if (modelID == model)
{
// until we get the new model.. finally...
if(metadata >= 5 && metadata <= 9) {
// pattern chest
renderer.setRenderBounds(0,0,0,1,0.875,1);
renderStandardInvBlock(renderer, block, metadata);
return;
}
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderStandardInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
@@ -33,6 +41,15 @@ public class TableRender implements ISimpleBlockRenderingHandler
{
if (modelID == model)
{
int metadata = world.getBlockMetadata(x,y,z);
// until we get the new model.. finally...
if(metadata >= 5 && metadata <= 9) {
// pattern chest
renderer.setRenderBounds(0,0,0,1,0.875,1);
renderer.renderStandardBlock(block, x,y,z);
return true;
}
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
@@ -41,6 +41,9 @@ public class TerrainGenEventHandler
private void generateSurfaceOres (Random random, int xChunk, int zChunk, World world)
{
if(random == null)
return;
int xPos, yPos, zPos;
if (PHConstruct.generateIronSurface && random.nextInt(PHConstruct.ironsRarity) == 0)
{