mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 20:52:26 +00:00
Merge branch 'master' into weaponry
This commit is contained in:
commit
72dcd8ac5f
12 files changed
+144
-134
No files matched your search
@@ -5,6 +5,7 @@ import cpw.mods.fml.common.eventhandler.*;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
@@ -13,6 +14,7 @@ import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import net.minecraftforge.oredict.*;
|
||||
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
import tconstruct.TConstruct;
|
||||
@@ -381,4 +383,26 @@ public class TinkerToolEvents
|
||||
TinkerTools.modAttack.addStackToMatchList(evt.Ore, 24);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void damageToolsOnDeath (PlayerDropsEvent event)
|
||||
{
|
||||
if(!PHConstruct.deathPenality)
|
||||
return;
|
||||
|
||||
for(EntityItem drop : event.drops)
|
||||
{
|
||||
// we're only interested in tools
|
||||
if(!(drop.getEntityItem().getItem() instanceof ToolCore) || !drop.getEntityItem().hasTagCompound())
|
||||
continue;
|
||||
|
||||
// damage tools by 10% of their total durability!
|
||||
NBTTagCompound tags = drop.getEntityItem().getTagCompound().getCompoundTag("InfiTool");
|
||||
int dur = tags.getInteger("TotalDurability");
|
||||
dur /= 10;
|
||||
|
||||
AbilityHelper.damageTool(drop.getEntityItem(), dur, event.entityPlayer, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,7 +729,7 @@ public class TinkerTools
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Manyullyn, "Manyullyn", 5, 1200, 900, 4, 2.5F, 0, 0f, DARK_PURPLE.toString(), 0x7338A5);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Copper, "Copper", 1, 180, 500, 2, 1.15F, 0, 0f, RED.toString(), 0xCC6410);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Bronze, "Bronze", 2, 550, 800, 2, 1.3F, 1, 0f, GOLD.toString(), 0xCA9956);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Alumite, "Alumite", 4, 700, 800, 3, 1.3F, 2, 0f, LIGHT_PURPLE.toString(), 0xffddff);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Alumite, "Alumite", 4, 700, 800, 3, 1.3F, 2, 0f, LIGHT_PURPLE.toString(), 0xffa7e9);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.Steel, "Steel", 4, 750, 1000, 4, 1.3F, 2, 0f, GRAY.toString(), 0xA0A0A0);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.BlueSlime, "BlueSlime", 0, 1200, 150, 0, 2.0F, 0, 0f, AQUA.toString(), 0x66AEB0);
|
||||
TConstructRegistry.addToolMaterial(MaterialID.PigIron, "PigIron", 3, 250, 600, 2, 1.3F, 1, 0f, RED.toString(), 0xF0A8A4);
|
||||
@@ -772,7 +772,7 @@ public class TinkerTools
|
||||
if (PHConstruct.enableTPaper)
|
||||
pb.registerFullMaterial(new ItemStack(materials, 1, 0), 2, "Paper", new ItemStack(Items.paper, 2), new ItemStack(toolRod, 1, 9), 9);
|
||||
else
|
||||
pb.registerMaterialSet("BlueSlime", new ItemStack(Items.paper, 2), new ItemStack(TinkerTools.toolRod, 1, 9), 9);
|
||||
pb.registerMaterialSet("Paper", new ItemStack(Items.paper, 2), new ItemStack(TinkerTools.toolRod, 1, 9), 9);
|
||||
pb.registerMaterialSet("Cobalt", new ItemStack(toolShard, 1, 10), new ItemStack(toolRod, 1, 10), 10);
|
||||
pb.registerMaterialSet("Ardite", new ItemStack(toolShard, 1, 11), new ItemStack(toolRod, 1, 11), 11);
|
||||
pb.registerMaterialSet("Manyullyn", new ItemStack(toolShard, 1, 12), new ItemStack(toolRod, 1, 12), 12);
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class TableRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
@@ -16,7 +17,7 @@ public class TableRender implements ISimpleBlockRenderingHandler
|
||||
if (modelID == model)
|
||||
{
|
||||
// until we get the new model.. finally...
|
||||
if(metadata >= 5 && metadata <= 9) {
|
||||
if(block == TinkerTools.toolStationWood && metadata >= 5 && metadata <= 9) {
|
||||
// pattern chest
|
||||
renderer.setRenderBounds(0,0,0,1,0.875,1);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
@@ -43,7 +44,7 @@ public class TableRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x,y,z);
|
||||
// until we get the new model.. finally...
|
||||
if(metadata >= 5 && metadata <= 9) {
|
||||
if(block == TinkerTools.toolStationWood && metadata >= 5 && metadata <= 9) {
|
||||
// pattern chest
|
||||
renderer.setRenderBounds(0,0,0,1,0.875,1);
|
||||
renderer.renderStandardBlock(block, x,y,z);
|
||||
|
||||
Reference in new issue
Block a user