This commit is contained in:
mDiyo 2013-04-24 11:41:22 -07:00
parent d48561d0cd
commit 19a13775dd
116 changed files with 1609 additions and 876 deletions

File diff suppressed because it is too large Load Diff

View File

@ -37,12 +37,20 @@
<entry key="block.oreberry.aluminum.name">Aluminum Oreberry Bush</entry>
<entry key="block.oreberry.silver.name">Silver Oreberry Bush</entry>
<entry key="block.ore.gravel.iron.name">Iron Ore</entry>
<entry key="block.ore.gravel.gold.name">Gold Ore</entry>
<entry key="block.ore.gravel.copper.name">Copper Ore</entry>
<entry key="block.ore.gravel.tin.name">Tin Ore</entry>
<entry key="block.ore.gravel.aluminum.name">Aluminum Ore</entry>
<entry key="block.ore.gravel.cobalt.name">Cobalt Ore</entry>
<entry key="block.ore.gravel.iron.name">Iron Gravel Ore</entry>
<entry key="block.ore.gravel.gold.name">Gold Gravel Ore</entry>
<entry key="block.ore.gravel.copper.name">Copper Gravel Ore</entry>
<entry key="block.ore.gravel.tin.name">Tin Gravel Ore</entry>
<entry key="block.ore.gravel.aluminum.name">Aluminum Gravel Ore</entry>
<entry key="block.ore.gravel.cobalt.name">Cobalt Gravel Ore</entry>
<entry key="block.brownstone.rough.name">Rough Brownstone</entry>
<entry key="block.brownstone.rough.road.name">Brownstone Road</entry>
<entry key="block.brownstone.smooth.name">Brownstone</entry>
<entry key="block.brownstone.smooth.brick.name">Brownstone Brick</entry>
<entry key="block.brownstone.smooth.road.name">Brownstone Road</entry>
<entry key="block.brownstone.smooth.fancy.name">Fancy Brownstone</entry>
<entry key="block.brownstone.smooth.chiseled.name">Chiseled Brownstone</entry>
<entry key="item.oreberry.iron.name">Iron Oreberry</entry>
<entry key="item.oreberry.gold.name">Gold Oreberry</entry>

View File

@ -58,7 +58,7 @@ Effective on: Stone or rock, ores, and metal.</text>
<title>Shovel</title>
<text>The Shovel is a basic digging tool. It is the most common way of moving earth around.</text>
<text>Class: Precision Tool
Effective on: Dirt, sand, and snow.</text>
Effective on: Dirt, sand, gravel, and snow.</text>
<icon>shovelicon</icon>
<item>
<text>Shovel Head</text>
@ -74,7 +74,7 @@ Effective on: Dirt, sand, and snow.</text>
<title>Axe</title>
<text>The Axe is a basic chopping tool. It is the simplest way to shape lumber.</text>
<text>Class: Precision Tool
Effective on: Trees.</text>
Effective on: Wood, Leaves, and Trees.</text>
<icon>axeicon</icon>
<item>
<text>Axe Head</text>

View File

@ -57,7 +57,7 @@ public class PHConstruct
redCreeper = config.get("Mob Spawning", "Activate Nitro Creeper Spawns", true).getBoolean(true);
blueSlime = config.get("Mob Spawning", "Activate Blue Slime Spawns", true).getBoolean(true);
redCreeperWeight = config.get("Mob Spawning", "Spawn Weight for Nitro Creeper", 7).getInt(7);
redCreeperWeight = config.get("Mob Spawning", "Spawn Weight for Nitro Creeper", 8).getInt(8);
blueSlimeWeight = config.get("Mob Spawning", "Spawn Weight for Blue Slime", 8).getInt(8);
woodCrafter = config.getBlock("Wood Tool Station", 1471).getInt(1471);
@ -82,6 +82,7 @@ public class PHConstruct
oreBerrySecond = config.getBlock("Ore Berry Two", 1486).getInt(1486);
//netherOreBerry = config.getBlock("Ore Berry Nether", 1487).getInt(1487);
oreGravel = config.getBlock("Ores Gravel", 1488).getInt(1488);
speedBlock = config.getBlock("Speed Block", 1489).getInt(1489);
manual = config.getItem("Patterns and Misc", "Tinker's Manual", 14018).getInt(14018);
blankPattern = config.getItem("Patterns and Misc", "Blank Patterns", 14019).getInt(14019);
@ -115,6 +116,7 @@ public class PHConstruct
broadsword = config.getItem("Tools", "Broadsword", 14055).getInt(14055);
longsword = config.getItem("Tools", "Longsword", 14056).getInt(14056);
rapier = config.getItem("Tools", "Rapier", 14057).getInt(14057);
dagger = config.getItem("Tools", "Dagger", 14065).getInt(14065);
frypan = config.getItem("Tools", "Frying Pan", 14058).getInt(14058);
battlesign = config.getItem("Tools", "Battlesign", 14059).getInt(14059);
@ -165,6 +167,7 @@ public class PHConstruct
generateTinBush = config.get("Worldgen Disabler", "Generate Tin Bushes", true).getBoolean(true);
generateAluminumBush = config.get("Worldgen Disabler", "Generate Aluminum Bushes", true).getBoolean(true);
generateSilverBush = config.get("Worldgen Disabler", "Generate Silver Bushes", true).getBoolean(true);
addToVillages = config.get("Worldgen Disabler", "Add Village Generation", true).getBoolean(true);
copperuDensity = config.get("Worldgen", "Copper Underground Density", ic2 ? 1 : 0).getInt(ic2 ? 1 : 0);
tinuDensity = config.get("Worldgen", "Tin Underground Density", ic2 ? 1 : 0).getInt(ic2 ? 1 : 0);
@ -236,6 +239,9 @@ public class PHConstruct
//Traps
//public static int landmine;
//InfiBlocks
public static int speedBlock;
//Liquids
public static int metalFlowing;
@ -270,6 +276,7 @@ public class PHConstruct
public static int broadsword;
public static int longsword;
public static int rapier;
public static int dagger;
public static int frypan;
public static int battlesign;
@ -318,6 +325,8 @@ public class PHConstruct
public static boolean generateAluminumBush;
public static boolean generateSilverBush;
public static boolean addToVillages;
public static int copperuDensity;
public static int tinuDensity;
public static int aluminumuDensity;

View File

@ -26,7 +26,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, EBXL API
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3rc.2", dependencies = "required-after:Forge@[7.7.1.659,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.0.2", dependencies = "required-after:Forge@[7.7.1.659,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
@ -68,10 +68,11 @@ public class TConstruct
VillagerRegistry.instance().registerVillagerType(78943, "/mods/tinker/textures/mob/villagertools.png");
VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
/*VillagerRegistry.instance().registerVillagerType(78944, "/mods/tinker/textures/mob/villagersmeltery.png");
VillagerRegistry.instance().registerVillageTradeHandler(78944, trades);*/
if (PHConstruct.addToVillages)
{
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
}
//DimensionManager.unregisterProviderType(0);
//DimensionManager.registerProviderType(0, OverworldProvider.class, true);
@ -86,7 +87,7 @@ public class TConstruct
content.modIntegration();
}
public static TEventHandler events;
public static TPlayerHandler playerTracker;
public static TContent content;

View File

@ -4,8 +4,10 @@ import mods.tinker.common.*;
import mods.tinker.common.fancyitem.FancyEntityItem;
import mods.tinker.tconstruct.blocks.*;
import mods.tinker.tconstruct.blocks.infiblocks.*;
import mods.tinker.tconstruct.crafting.*;
import mods.tinker.tconstruct.entity.*;
import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
import mods.tinker.tconstruct.items.*;
import mods.tinker.tconstruct.items.blocks.*;
import mods.tinker.tconstruct.library.*;
@ -63,6 +65,7 @@ public class TContent implements IFuelHandler
public static ToolCore broadsword;
public static ToolCore longsword;
public static ToolCore rapier;
public static ToolCore dagger;
public static ToolCore frypan;
public static ToolCore battlesign;
@ -104,11 +107,14 @@ public class TContent implements IFuelHandler
//Traps
public static Block landmine;
//InfiBlocks
public static Block speedBlock;
//Liquids
public static Block liquidMetalFlowing;
public static Block liquidMetalStill;
public static Material liquidMetal;
//Ores
public static Block oreSlag;
public static Block oreGravel;
@ -124,7 +130,7 @@ public class TContent implements IFuelHandler
/*public static Block glowSapling;
public static Block glowLeaves;
public static Block glowLog;*/
public static Block redstoneBallRepeater;
public static Item redstoneBallRepeaterItem;
@ -153,6 +159,7 @@ public class TContent implements IFuelHandler
void createEntities ()
{
EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(DaggerEntity.class, "Dagger", 1, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(LaunchedPotion.class, "Launched Potion", 1, TConstruct.instance, 32, 3, true);
//EntityRegistry.registerModEntity(GolemBase.class, "Golembase", 2, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true);
@ -172,7 +179,7 @@ public class TContent implements IFuelHandler
BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach,
BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills };
if (PHConstruct.redCreeper)
EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, overworldBiomes);
EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, BiomeGenBase.hell);
if (PHConstruct.blueSlime)
EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, overworldBiomes);
//EntityRegistry.addSpawn(MetalSlime.class, 1, 4, 4, EnumCreatureType.monster, overworldBiomes);
@ -236,34 +243,37 @@ public class TContent implements IFuelHandler
//Decoration
stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch");
GameRegistry.registerBlock(stoneTorch, "decoration.stonetorch");
//Ores
String[] berryOres = new String[] { "berry_iron", "berry_gold", "berry_copper", "berry_tin", "berry_iron_ripe", "berry_gold_ripe", "berry_copper_ripe", "berry_tin_ripe" };
oreBerry = (OreberryBush) new OreberryBush(PHConstruct.oreBerry, berryOres, 0, 4, new String[] { "oreIron", "oreGold", "oreCopper", "oreTin"}).setUnlocalizedName("ore.berries.one");
oreBerry = (OreberryBush) new OreberryBush(PHConstruct.oreBerry, berryOres, 0, 4, new String[] { "oreIron", "oreGold", "oreCopper", "oreTin" }).setUnlocalizedName("ore.berries.one");
GameRegistry.registerBlock(oreBerry, OreberryBushItem.class, "ore.berries.one");
String[] berryOresTwo = new String[] { "berry_aluminum", "berry_silver", "", "", "berry_aluminum_ripe", "berry_silver_ripe", "", "" };
oreBerrySecond = (OreberryBush) new OreberryBush(PHConstruct.oreBerrySecond, berryOresTwo, 4, 2, new String[] { "oreAluminum", "oreSilver" }).setUnlocalizedName("ore.berries.two");
GameRegistry.registerBlock(oreBerrySecond, OreberryBushSecondItem.class, "ore.berries.two");
String[] oreTypes = new String[] { "nether_slag", "nether_cobalt", "nether_ardite", "ore_copper", "ore_tin", "ore_aluminum", "ore_slag" };
oreSlag = new MetalOre(PHConstruct.oreSlag, Material.iron, 10.0F, oreTypes);
GameRegistry.registerBlock(oreSlag, MetalOreItemBlock .class, "SearedBrick");
GameRegistry.registerBlock(oreSlag, MetalOreItemBlock.class, "SearedBrick");
MinecraftForge.setBlockHarvestLevel(oreSlag, 1, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(oreSlag, 2, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(oreSlag, 3, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(oreSlag, 4, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(oreSlag, 5, "pickaxe", 1);
oreGravel = new GravelOre(PHConstruct.oreGravel);
oreGravel = new GravelOre(PHConstruct.oreGravel).setUnlocalizedName("GravelOre");
GameRegistry.registerBlock(oreGravel, GravelOreItem.class, "GravelOre");
MinecraftForge.setBlockHarvestLevel(oreGravel, 0, "shovel", 1);
MinecraftForge.setBlockHarvestLevel(oreGravel, 1, "shovel", 2);
MinecraftForge.setBlockHarvestLevel(oreGravel, 2, "shovel", 1);
MinecraftForge.setBlockHarvestLevel(oreGravel, 3, "shovel", 1);
MinecraftForge.setBlockHarvestLevel(oreGravel, 4, "shovel", 1);
MinecraftForge.setBlockHarvestLevel(oreGravel, 5, "shovel", 4);
/*speedBlock = new SpeedBlock(PHConstruct.speedBlock).setUnlocalizedName("SpeedBlock");
GameRegistry.registerBlock(speedBlock, SpeedBlockItem.class, "SpeedBlock");*/
/*redstoneBallRepeater = new RedstoneBallRepeater(PHConstruct.redstoneBallRepeater, false).setUnlocalizedName("decoration.redstoneballrepeater");
GameRegistry.registerBlock(redstoneBallRepeater, "decoration.redstoneballrepeater");
Item.itemsList[PHConstruct.redstoneBallRepeater] = null;
@ -276,7 +286,7 @@ public class TContent implements IFuelHandler
golemHead = new GolemHeadBlock(PHConstruct.golemHead).setUnlocalizedName("golemhead");
GameRegistry.registerBlock(golemHead, "Golem Head");*/
/*golemPedestal = new GolemPedestalBlock(PHConstruct.golemPedestal).setUnlocalizedName("golempedestal");
GameRegistry.registerBlock(golemPedestal, "Golem Pedestal");
GameRegistry.registerTileEntity(GolemPedestalLogic.class, "TConstruct.GolemPedestal");*/
@ -293,8 +303,8 @@ public class TContent implements IFuelHandler
"CopperNugget", "TinNugget", "AluminumNugget", "SilverNugget" };
String[] craftingTextures = new String[] { "material_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot",
"material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot", "material_aluminumraw",
"material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot", "material_blueslimecrystal", "material_obsidianingot",
"material_nugget_iron", "material_nugget_copper", "material_nugget_tin", "material_nugget_aluminum", "material_nugget_silver" };
"material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot", "material_blueslimecrystal", "material_obsidianingot", "material_nugget_iron",
"material_nugget_copper", "material_nugget_tin", "material_nugget_aluminum", "material_nugget_silver" };
materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod");
@ -313,6 +323,7 @@ public class TContent implements IFuelHandler
broadsword = new Broadsword(PHConstruct.broadsword);
longsword = new Longsword(PHConstruct.longsword);
rapier = new Rapier(PHConstruct.rapier);
//dagger = new Dagger(PHConstruct.dagger);
frypan = new FryingPan(PHConstruct.frypan);
battlesign = new BattleSign(PHConstruct.battlesign);
@ -492,6 +503,7 @@ public class TContent implements IFuelHandler
tb.addToolRecipe(frypan, frypanHead);
tb.addToolRecipe(battlesign, signHead);
tb.addToolRecipe(mattock, axeHead, shovelHead);
//tb.addToolRecipe(dagger, swordBlade);
//tb.addToolRecipe(longbow, toolRod, toolRod);
//tb.addToolRecipe(lumberaxe, lumberHead);
@ -543,7 +555,7 @@ public class TContent implements IFuelHandler
LiquidCasting lc = LiquidCasting.instance;
//Blank
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), 80);
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 1), 80);
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1), 80);
//Ingots
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 80); //Iron
@ -586,10 +598,11 @@ public class TContent implements IFuelHandler
ItemStack cast = new ItemStack(metalPattern, 1, iter + 1);
for (int iterTwo = 0; iterTwo < liquids.length; iterTwo++)
{
lc.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), liquids[iterTwo], cast, 50);
lc.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), new LiquidStack(liquids[iterTwo].itemID, ((IPattern) metalPattern).getPatternCost(iter)
* TConstruct.ingotLiquidValue / 2, liquids[iterTwo].itemMeta), cast, 50);
}
}
LiquidBlockCasting lbc = LiquidBlockCasting.instance;
lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron
lbc.addBlockCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold
@ -620,7 +633,7 @@ public class TContent implements IFuelHandler
Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockIron.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 150, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1));
Smeltery.addMelting(new ItemStack(Item.bucketEmpty), Block.blockIron.blockID, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 3, 0));
Smeltery.addMelting(new ItemStack(Item.minecartEmpty), Block.blockIron.blockID, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 5, 0));
@ -636,13 +649,13 @@ public class TContent implements IFuelHandler
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 2, 5), new LiquidStack(liquidMetalStill.blockID, 2, 6)); //Manyullyn
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 3, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(
liquidMetalStill.blockID, 2, 11)); //Alumite
//Oreberries
Smeltery.addMelting(new ItemStack(oreBerries, 4, 0), Block.blockIron.blockID, 0, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 0)); //Iron
Smeltery.addMelting(new ItemStack(oreBerries, 4, 1), Block.blockGold.blockID, 0, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 1)); //Gold
Smeltery.addMelting(new ItemStack(oreBerries, 4, 2), metalBlock.blockID, 3, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 2)); //Copper
Smeltery.addMelting(new ItemStack(oreBerries, 4, 3), metalBlock.blockID, 5, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 3)); //Tin
Smeltery.addMelting(new ItemStack(oreBerries, 4, 4), metalBlock.blockID, 6, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 4)); //Aluminum
Smeltery.addMelting(new ItemStack(oreBerries, 4, 0), Block.blockIron.blockID, 0, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 0)); //Iron
Smeltery.addMelting(new ItemStack(oreBerries, 4, 1), Block.blockGold.blockID, 0, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1)); //Gold
Smeltery.addMelting(new ItemStack(oreBerries, 4, 2), metalBlock.blockID, 3, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 2)); //Copper
Smeltery.addMelting(new ItemStack(oreBerries, 4, 3), metalBlock.blockID, 5, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3)); //Tin
Smeltery.addMelting(new ItemStack(oreBerries, 4, 4), metalBlock.blockID, 6, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 4)); //Aluminum
}
void addCraftingRecipes ()
@ -691,20 +704,20 @@ public class TContent implements IFuelHandler
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 3, new ItemStack(materials, 1, 9), 0.5f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 4, new ItemStack(materials, 1, 10), 0.5f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 5, new ItemStack(materials, 1, 12), 0.5f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 0, new ItemStack(materials, 1, 19), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 1, new ItemStack(Item.goldNugget), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 2, new ItemStack(materials, 1, 20), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 3, new ItemStack(materials, 1, 21), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 4, new ItemStack(materials, 1, 22), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreBerries.itemID, 5, new ItemStack(materials, 1, 23), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 0, new ItemStack(Item.ingotIron), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 1, new ItemStack(Item.ingotGold), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 2, new ItemStack(materials, 1, 9), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 3, new ItemStack(materials, 1, 10), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 4, new ItemStack(materials, 1, 12), 0.2f);
//Metal conversion
GameRegistry.addRecipe(new ItemStack(materials, 9, 9), "m", 'm', new ItemStack(metalBlock, 1, 3)); //Copper
GameRegistry.addRecipe(new ItemStack(materials, 9, 10), "m", 'm', new ItemStack(metalBlock, 1, 5)); //Tin
@ -716,12 +729,12 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(materials, 9, 5), "m", 'm', new ItemStack(metalBlock, 1, 2)); //Manyullyn
GameRegistry.addRecipe(new ItemStack(materials, 9, 15), "m", 'm', new ItemStack(metalBlock, 1, 8)); //Alumite
GameRegistry.addRecipe(new ItemStack(materials, 9, 16), "m", 'm', new ItemStack(metalBlock, 1, 9)); //Steel
GameRegistry.addRecipe(new ItemStack(Item.ingotIron), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 19)); //Iron
GameRegistry.addRecipe(new ItemStack(materials, 1, 9), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 20)); //Copper
GameRegistry.addRecipe(new ItemStack(materials, 1, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin
GameRegistry.addRecipe(new ItemStack(materials, 1, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum
LiquidBlockCasting lbc = LiquidBlockCasting.instance;
lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron
lbc.addBlockCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold
@ -754,7 +767,7 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(stoneTorch, 4), "p", "w", 'p', new ItemStack(Item.coal, 1, Short.MAX_VALUE), 'w', new ItemStack(toolRod, 1, 1));
GameRegistry.addRecipe(new ItemStack(toolRod, 4, 1), "c", "c", 'c', new ItemStack(Block.stone));
GameRegistry.addRecipe(new ItemStack(toolRod, 2, 1), "c", "c", 'c', new ItemStack(Block.cobblestone));
ItemStack aluBrass = new ItemStack(materials, 1, 14);
GameRegistry.addRecipe(new ItemStack(Item.pocketSundial), " i ", "iri", " i ", 'i', aluBrass, 'r', new ItemStack(Item.redstone));
GameRegistry.addRecipe(new ItemStack(Block.pressurePlateGold), "ii", 'i', aluBrass);
@ -776,7 +789,7 @@ public class TContent implements IFuelHandler
//TConstruct.
TConstructRegistry.toolTab.init(tool);
}
public static LiquidStack[] liquidIcons;
public static String[] liquidNames;
@ -787,12 +800,12 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("oreCopper", new ItemStack(oreSlag, 1, 3));
OreDictionary.registerOre("oreTin", new ItemStack(oreSlag, 1, 4));
OreDictionary.registerOre("oreNaturalAluminum", new ItemStack(oreSlag, 1, 5));
OreDictionary.registerOre("oreCobalt", new ItemStack(oreGravel, 1, 5));
OreDictionary.registerOre("oreCopper", new ItemStack(oreGravel, 1, 2));
OreDictionary.registerOre("oreTin", new ItemStack(oreGravel, 1, 3));
OreDictionary.registerOre("oreNaturalAluminum", new ItemStack(oreGravel, 1, 4));
OreDictionary.registerOre("ingotCobalt", new ItemStack(materials, 1, 3));
OreDictionary.registerOre("ingotArdite", new ItemStack(materials, 1, 4));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(materials, 1, 5));
@ -815,7 +828,7 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("blockAluminumBrass", new ItemStack(metalBlock, 1, 7));
OreDictionary.registerOre("blockAlumite", new ItemStack(metalBlock, 1, 8));
OreDictionary.registerOre("blockSteel", new ItemStack(metalBlock, 1, 9));
OreDictionary.registerOre("nuggetIron", new ItemStack(materials, 1, 19));
OreDictionary.registerOre("nuggetCopper", new ItemStack(materials, 1, 20));
OreDictionary.registerOre("nuggetTin", new ItemStack(materials, 1, 21));

View File

@ -112,12 +112,12 @@ public class TEventHandler
else if (evt.Name == "crystalQuartz")
{
ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 16));
ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 2));
}
else if (evt.Name == "crystalCerusQuartz")
{
ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 72));
ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 24));
}
//Ingots

View File

@ -1,5 +1,6 @@
package mods.tinker.tconstruct.blocks;
import java.util.List;
import java.util.Random;
import mods.tinker.tconstruct.TContent;
@ -8,7 +9,9 @@ import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
@ -565,6 +568,10 @@ public abstract class LiquidMetalBase extends Block
par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D);
}
}
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
}
/**
* Called whenever the block is added into the world. Args: world, x, y, z

View File

@ -0,0 +1,60 @@
package mods.tinker.tconstruct.blocks.infiblocks;
import java.util.List;
import mods.tinker.tconstruct.blocks.TConstructBlock;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SpeedBlock extends TConstructBlock
{
public static String[] textureNames = new String[] { "brownstone_rough", "brownstone_rough_road", "brownstone_smooth", "brownstone_smooth_brick", "brownstone_smooth_road",
"brownstone_smooth_fancy", "brownstone_smooth_chiseled" };
public SpeedBlock(int id)
{
super(id, Material.rock, 3.0f, textureNames);
//this.setBlockBounds(0f, 0f, 0f, 1.0f, 0.5f, 1.0f);
}
@Override
public void onEntityWalking (World world, int x, int y, int z, Entity entity)
{
double boost = 2.2D;
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 1 || metadata == 4)
boost = 2.7D;
double mX = Math.abs(entity.motionX);
double mZ = Math.abs(entity.motionZ);
if (mX < 0.5D)
{
entity.motionX *= boost;
}
if (mZ < 0.5D)
{
entity.motionZ *= boost;
}
}
@Override
public int damageDropped (int meta)
{
return meta;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks (int id, CreativeTabs tab, List list)
{
for (int iter = 0; iter < textureNames.length; iter++)
{
list.add(new ItemStack(id, 1, iter));
}
}
}

View File

@ -7,44 +7,18 @@ import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import mods.tinker.common.fancyitem.FancyEntityItem;
import mods.tinker.common.fancyitem.FancyItemRender;
import mods.tinker.common.fancyitem.*;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.TProxyCommon;
import mods.tinker.tconstruct.client.blockrender.CastingBasinSpecialRender;
import mods.tinker.tconstruct.client.blockrender.CastingTableSpecialRenderer;
import mods.tinker.tconstruct.client.blockrender.FluidRender;
import mods.tinker.tconstruct.client.blockrender.FrypanRender;
import mods.tinker.tconstruct.client.blockrender.GolemCoreRender;
import mods.tinker.tconstruct.client.blockrender.GolemCoreSpecialRender;
import mods.tinker.tconstruct.client.blockrender.OreberryRender;
import mods.tinker.tconstruct.client.blockrender.SearedRender;
import mods.tinker.tconstruct.client.blockrender.SmallFontRenderer;
import mods.tinker.tconstruct.client.blockrender.SmelteryRender;
import mods.tinker.tconstruct.client.blockrender.TableRender;
import mods.tinker.tconstruct.client.blockrender.TankRender;
import mods.tinker.tconstruct.client.entityrender.CartRender;
import mods.tinker.tconstruct.client.entityrender.CrystalRender;
import mods.tinker.tconstruct.client.entityrender.GolemRender;
import mods.tinker.tconstruct.client.entityrender.SkylaRender;
import mods.tinker.tconstruct.client.entityrender.SlimeRender;
import mods.tinker.tconstruct.client.entityrender.ThrownItemRender;
import mods.tinker.tconstruct.client.blockrender.*;
import mods.tinker.tconstruct.client.entityrender.*;
import mods.tinker.tconstruct.crafting.ToolBuilder;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.CartEntity;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.GolemBase;
import mods.tinker.tconstruct.entity.LaunchedPotion;
import mods.tinker.tconstruct.entity.NitroCreeper;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import mods.tinker.tconstruct.library.client.ToolGuiElement;
import mods.tinker.tconstruct.logic.CastingBasinLogic;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.GolemCoreLogic;
import mods.tinker.tconstruct.player.ArmorExtended;
import mods.tinker.tconstruct.player.TClientTickHandler;
import mods.tinker.tconstruct.entity.*;
import mods.tinker.tconstruct.entity.projectile.*;
import mods.tinker.tconstruct.library.client.*;
import mods.tinker.tconstruct.logic.*;
import mods.tinker.tconstruct.player.*;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
@ -137,6 +111,7 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerEntityRenderingHandler(GolemBase.class, new GolemRender(0));
RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender());
//RenderingRegistry.registerEntityRenderingHandler(DaggerEntity.class, new RangedItemRender());
RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new SkylaRender());
RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender());
RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new ThrownItemRender(Item.potion, 16384));

View File

@ -12,101 +12,102 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
public class TableRender implements ISimpleBlockRenderingHandler
{
public static int tabelModelID = RenderingRegistry.getNextAvailableRenderId();
@Override
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
{
if (modelID == tabelModelID)
{
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderDo(renderer, block, metadata);
}
else
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
}
}
}
public static int tabelModelID = RenderingRegistry.getNextAvailableRenderId();
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == tabelModelID)
{
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
}
else
{
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);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
}
}
return true;
}
@Override
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
{
if (modelID == tabelModelID)
{
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderInvBlock(renderer, block, metadata);
}
else
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderInvBlock(renderer, block, metadata);
}
}
}
@Override
public boolean shouldRender3DInInventory ()
{
return true;
}
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == tabelModelID)
{
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
}
else
{
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);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
}
}
return true;
}
@Override
public int getRenderId ()
{
return tabelModelID;
}
@Override
public boolean shouldRender3DInInventory ()
{
return true;
}
private void renderDo(RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
@Override
public int getRenderId ()
{
return tabelModelID;
}
public static void renderInvBlock (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
}

View File

@ -0,0 +1,509 @@
package mods.tinker.tconstruct.client.entityrender;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RangedItemRender extends Render
{
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
private Random random = new Random();
public boolean renderWithColor = true;
/** Defines the zLevel of rendering of item on GUI. */
public float zLevel = 0.0F;
public static boolean renderInFrame = false;
public RangedItemRender()
{
this.shadowSize = 0.15F;
this.shadowOpaque = 0.75F;
}
/**
* Renders the item
*/
public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
{
this.random.setSeed(187L);
ItemStack itemstack = par1EntityItem.getEntityItem();
if (itemstack.getItem() != null)
{
GL11.glPushMatrix();
float f2 = shouldBob() ? MathHelper.sin(((float) par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI);
byte b0 = getMiniBlockCount(itemstack);
GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
int i;
float f4;
float f5;
float f6;
float f8;
if (itemstack.getItem().requiresMultipleRenderPasses())
{
if (renderInFrame)
{
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
this.loadTexture("/gui/items.png");
for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
{
this.random.setSeed(187L);
Icon icon = itemstack.getItem().getIcon(itemstack, k);
f8 = 1.0F;
if (this.renderWithColor)
{
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
f5 = (float) (i >> 16 & 255) / 255.0F;
f4 = (float) (i >> 8 & 255) / 255.0F;
f6 = (float) (i & 255) / 255.0F;
GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F);
this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8);
}
else
{
this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F);
}
}
}
else
{
if (renderInFrame)
{
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
Icon icon1 = itemstack.getIconIndex();
if (itemstack.getItemSpriteNumber() == 0)
{
this.loadTexture("/terrain.png");
}
else
{
this.loadTexture("/gui/items.png");
}
if (this.renderWithColor)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
f8 = (float) (l >> 16 & 255) / 255.0F;
float f9 = (float) (l >> 8 & 255) / 255.0F;
f5 = (float) (l & 255) / 255.0F;
f4 = 1.0F;
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4);
}
else
{
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, 1.0F, 1.0F, 1.0F);
}
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
/**
* Renders a dropped item
*/
private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
{
Tessellator tessellator = Tessellator.instance;
if (par2Icon == null)
{
par2Icon = this.renderManager.renderEngine.getMissingIcon(par1EntityItem.getEntityItem().getItemSpriteNumber());
}
float f4 = par2Icon.getMinU();
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
float f8 = 1.0F;
float f9 = 0.5F;
float f10 = 0.25F;
float f11;
GL11.glPushMatrix();
if (renderInFrame)
{
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
}
else
{
GL11.glRotatef((((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
}
float f12 = 0.0625F;
f11 = 0.021875F;
ItemStack itemstack = par1EntityItem.getEntityItem();
int j = itemstack.stackSize;
byte b0 = getMiniItemCount(itemstack);
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F));
for (int k = 0; k < b0; ++k)
{
GL11.glTranslatef(0.0F, 0.0F, f12 + f11);
// Makes items offset when in 3D, like when in 2D, looks much
// better. Considered a vanilla bug...
if (k > 0 && shouldSpreadItems())
{
float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
GL11.glTranslatef(x, y, f12 + f11);
}
else
{
GL11.glTranslatef(0f, 0f, f12 + f11);
}
if (itemstack.getItemSpriteNumber() == 0)
{
this.loadTexture("/terrain.png");
}
else
{
this.loadTexture("/gui/items.png");
}
GL11.glColor4f(par5, par6, par7, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12);
if (itemstack != null && itemstack.hasEffect())
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
this.renderManager.renderEngine.bindTexture("%blur%/misc/glint.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f13 = 0.76F;
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
float f14 = 0.125F;
GL11.glScalef(f14, f14, f14);
float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glTranslatef(f15, 0.0F, 0.0F);
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(f14, f14, f14);
f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glTranslatef(-f15, 0.0F, 0.0F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
GL11.glPopMatrix();
}
/**
* Renders the item's icon or block into the UI at the specified position.
*/
public void renderItemIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
int k = par3ItemStack.itemID;
int l = par3ItemStack.getItemDamage();
Icon icon = par3ItemStack.getIconIndex();
float f;
float f1;
float f2;
int j1;
if (Item.itemsList[k].requiresMultipleRenderPasses())
{
GL11.glDisable(GL11.GL_LIGHTING);
par2RenderEngine.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? "/terrain.png" : "/gui/items.png");
for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
{
Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1);
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
f = (float) (k1 >> 16 & 255) / 255.0F;
f1 = (float) (k1 >> 8 & 255) / 255.0F;
float f3 = (float) (k1 & 255) / 255.0F;
if (this.renderWithColor)
{
GL11.glColor4f(f, f1, f3, 1.0F);
}
this.renderIcon(par4, par5, icon1, 16, 16);
}
GL11.glEnable(GL11.GL_LIGHTING);
}
else
{
GL11.glDisable(GL11.GL_LIGHTING);
if (par3ItemStack.getItemSpriteNumber() == 0)
{
par2RenderEngine.bindTexture("/terrain.png");
}
else
{
par2RenderEngine.bindTexture("/gui/items.png");
}
if (icon == null)
{
icon = par2RenderEngine.getMissingIcon(par3ItemStack.getItemSpriteNumber());
}
j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
float f4 = (float) (j1 >> 16 & 255) / 255.0F;
f2 = (float) (j1 >> 8 & 255) / 255.0F;
f = (float) (j1 & 255) / 255.0F;
if (this.renderWithColor)
{
GL11.glColor4f(f4, f2, f, 1.0F);
}
this.renderIcon(par4, par5, icon, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
}
GL11.glEnable(GL11.GL_CULL_FACE);
}
/**
* Render the item's icon or block into the GUI, including the glint effect.
*/
public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
if (par3ItemStack != null)
{
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
{
this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
}
if (par3ItemStack.hasEffect())
{
GL11.glDepthFunc(GL11.GL_GREATER);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
par2RenderEngine.bindTexture("%blur%/misc/glint.png");
this.zLevel -= 50.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
this.zLevel += 50.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
}
private void renderGlint (int par1, int par2, int par3, int par4, int par5)
{
for (int j1 = 0; j1 < 2; ++j1)
{
if (j1 == 0)
{
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
}
if (j1 == 1)
{
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
}
float f = 0.00390625F;
float f1 = 0.00390625F;
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F;
float f3 = 0.0F;
Tessellator tessellator = Tessellator.instance;
float f4 = 4.0F;
if (j1 == 1)
{
f4 = -1.0F;
}
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f),
(double) ((f3 + (float) par5) * f1));
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1));
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1));
tessellator.draw();
}
}
/**
* Renders the item's overlay information. Examples being stack count or
* damage on top of the item's image at the specified position.
*/
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
this.renderItemStack(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null);
}
public void renderItemStack (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str)
{
if (par3ItemStack != null)
{
if (par3ItemStack.stackSize > 1 || par6Str != null)
{
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
if (par3ItemStack.isItemDamaged())
{
int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage());
int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage());
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
Tessellator tessellator = Tessellator.instance;
int i1 = 255 - l << 16 | l << 8;
int j1 = (255 - l) / 4 << 16 | 16128;
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
}
}
/**
* Adds a quad to the tesselator at the specified position with the set
* width and height and color. Args: tessellator, x, y, width, height, color
*/
private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
{
par1Tessellator.startDrawingQuads();
par1Tessellator.setColorOpaque_I(par6);
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D);
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D);
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D);
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D);
par1Tessellator.draw();
}
public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5)
{
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV());
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV());
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV());
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV());
tessellator.draw();
}
/**
* Actually renders the given argument. This is a synthetic bridge method,
* always casting down its argument and then handing it off to a worker
* function which does the actual work. In all probabilty, the class Render
* is generic (Render<T extends Entity) and this method has signature public
* void doRender(T entity, double d, double d1, double d2, float f, float
* f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
this.doRenderItem((EntityItem) par1Entity, par2, par4, par6, par8, par9);
}
/**
* Items should spread out when rendered in 3d?
*
* @return
*/
public boolean shouldSpreadItems ()
{
return true;
}
/**
* Items should have a bob effect
*
* @return
*/
public boolean shouldBob ()
{
return false;
}
public byte getMiniBlockCount (ItemStack stack)
{
return 1;
}
/**
* Allows for a subclass to override how many rendered items appear in a
* "mini item 3d stack"
*
* @param stack
* @return
*/
public byte getMiniItemCount (ItemStack stack)
{
return 1;
}
}

View File

@ -14,11 +14,11 @@ public class PatternBuilder
{
public static PatternBuilder instance = new PatternBuilder();
//Map items to their parts with a hashmap
List<ItemKey> materials = new ArrayList<ItemKey>();
HashMap materialSets = new HashMap<String, MaterialSet>();
public List<ItemKey> materials = new ArrayList<ItemKey>();
public HashMap materialSets = new HashMap<String, MaterialSet>();
//We could use IRecipe if it wasn't tied to InventoryCrafting
List<IPattern> toolPatterns = new ArrayList<IPattern>();
public List<IPattern> toolPatterns = new ArrayList<IPattern>();
/* Register methods */
public void registerMaterial (ItemStack material, int value, String key)

View File

@ -150,4 +150,24 @@ public class Smeltery
}
return liquids;
}
public static HashMap<List<Integer>, LiquidStack> getSmeltingList()
{
return instance.smeltingList;
}
public static HashMap<List<Integer>, Integer> getTemperatureList()
{
return instance.temperatureList;
}
public static HashMap<List<Integer>, ItemStack> getRenderIndex()
{
return instance.renderIndex;
}
public ArrayList<AlloyMix> getAlloyList()
{
return instance.alloys;
}
}

View File

@ -18,9 +18,9 @@ public class ToolBuilder
{
public static ToolBuilder instance = new ToolBuilder();
List<ToolRecipe> combos = new ArrayList<ToolRecipe>();
HashMap<String, String> modifiers = new HashMap<String, String>();
List<ToolMod> toolMods = new ArrayList<ToolMod>();
public List<ToolRecipe> combos = new ArrayList<ToolRecipe>();
public HashMap<String, String> modifiers = new HashMap<String, String>();
public List<ToolMod> toolMods = new ArrayList<ToolMod>();
/* Build tools */
public static void addToolRecipe (ToolCore output, Item head)

View File

@ -8,6 +8,7 @@ import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class NitroCreeper extends EntityCreeper
@ -34,7 +35,7 @@ public class NitroCreeper extends EntityCreeper
public int getMaxHealth ()
{
return 12;
return 20;
}
protected void fall (float distance)
@ -51,7 +52,7 @@ public class NitroCreeper extends EntityCreeper
}
else
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (0.75f * (worldObj.difficultySetting - 1)), false);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3f, false);
}
this.setDead();
@ -114,7 +115,7 @@ public class NitroCreeper extends EntityCreeper
}
else
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius + 1f * (difficulty - 1)), flag);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3f, flag);
}
this.setDead();
@ -189,4 +190,12 @@ public class NitroCreeper extends EntityCreeper
}
return super.attackEntityFrom(source, damage);
}
public boolean getCanSpawnHere()
{
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.boundingBox.minY);
int k = MathHelper.floor_double(this.posZ);
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox) && this.getBlockPathWeight(i, j, k) >= 0.0F;
}
}

View File

@ -2,6 +2,7 @@ package mods.tinker.tconstruct.entity.projectile;
import mods.tinker.tconstruct.library.ToolCore;
import mods.tinker.tconstruct.tools.Dagger;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
@ -23,7 +24,6 @@ import com.google.common.io.ByteArrayDataOutput;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
public class DaggerEntity extends RotatingBase
implements IEntityAdditionalSpawnData
{
public DaggerEntity(World world)
@ -34,23 +34,27 @@ public class DaggerEntity extends RotatingBase
public DaggerEntity(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
super(world, entityplayer, 0.75F, 0.8F);
//System.out.println("check2 " + ((Dagger)(itemstack.getItem())).headType);
System.out.println("Stack: "+itemstack);
this.setEntityItemStack(itemstack);
returnStackSlot = entityplayer.inventory.currentItem;
//texID = itemstack.getIconIndex();
//tex2ID = ((Dagger) itemstack.getItem()).secondIconIndex;
returnStack = itemstack;
//damageDealt = ((Dagger) itemstack.getItem()).toolDamage - 1;
}
public DaggerEntity(World world, EntityPlayer entityplayer, float f, float g)
{
super(world, entityplayer, f, g);
}
@Override
protected void entityInit()
{
this.getDataWatcher().addObjectByDataType(10, 5);
}
public void entityInit ()
/*public void entityInit ()
{
super.entityInit();
}
}*/
@Override
public void onHit (MovingObjectPosition movingobjectposition)
@ -259,22 +263,33 @@ public class DaggerEntity extends RotatingBase
{
}
public void onUpdate ()
/*public void onUpdate ()
{
super.onUpdate();
}
@Override
public void writeSpawnData (ByteArrayDataOutput data)
}*/
public ItemStack getEntityItem()
{
// TODO Auto-generated method stub
}
ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10);
@Override
public void readSpawnData (ByteArrayDataInput data)
if (itemstack == null)
{
if (this.worldObj != null)
{
this.worldObj.getWorldLogAgent().logSevere("Dagger entity " + this.entityId + " has no item?!");
}
return new ItemStack(Block.stone);
}
else
{
return itemstack;
}
}
public void setEntityItemStack(ItemStack itemstack)
{
// TODO Auto-generated method stub
this.getDataWatcher().updateObject(10, itemstack);
this.getDataWatcher().setObjectWatched(10);
}
}

View File

@ -1,4 +1,5 @@
package mods.tinker.tconstruct.entity.projectile;
import java.util.List;
import mods.tinker.tconstruct.library.AbilityHelper;
@ -21,7 +22,7 @@ public class RotatingBase extends Entity
super(world);
System.out.println("single constructor");
texID = 0;
tex2ID = 16*3;
tex2ID = 16 * 3;
returnStackSlot = -1;
hasHitGround = false;
hasHitMob = false;
@ -48,7 +49,7 @@ public class RotatingBase extends Entity
{
this(world);
owner = entityliving;
setLocationAndAngles(entityliving.posX, entityliving.posY + (double)entityliving.getEyeHeight(), entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch);
setLocationAndAngles(entityliving.posX, entityliving.posY + (double) entityliving.getEyeHeight(), entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch);
posX -= MathHelper.cos((rotationYaw / 180F) * 3.141593F) * 0.16F;
posY -= 0.10000000149011612D;
posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F;
@ -60,24 +61,19 @@ public class RotatingBase extends Entity
setArrowHeading(motionX, motionY, motionZ, f, f1);
}
protected void entityInit()
protected void entityInit ()
{
}
public void damageDagger(int i, boolean flag)
public void damageDagger (int i, boolean flag)
{
/*if(returnStack.itemID == mod_2by2.daggerWood.shiftedIndex && fire > 0)
{
i *= 6;
}
returnStack.damageItem(1, this);*/
if(!flag)
if (!flag)
{
return;
}
if(returnStack.stackSize < 1)
if (returnStack.stackSize < 1)
{
for(int j = 0; j < 8; j++)
for (int j = 0; j < 8; j++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
@ -104,27 +100,26 @@ public class RotatingBase extends Entity
}
*/
public void determineRotation()
public void determineRotation ()
{
rotationPitch = -57.29578F * (float)Math.atan2(motionY, motionX);
double d = Math.sqrt((double)(rotationYaw * rotationYaw) + motionY * motionY);
prevRotationYaw = -57.29578F * (float)Math.atan2(motionZ, d);
rotationPitch = -57.29578F * (float) Math.atan2(motionY, motionX);
double d = Math.sqrt((double) (rotationYaw * rotationYaw) + motionY * motionY);
prevRotationYaw = -57.29578F * (float) Math.atan2(motionZ, d);
}
public void onHit(MovingObjectPosition movingobjectposition)
public void onHit (MovingObjectPosition movingobjectposition)
{
}
public void setArrowHeading(double d, double d1, double d2, float f,
float f1)
public void setArrowHeading (double d, double d1, double d2, float f, float f1)
{
float f2 = MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2);
d /= f2;
d1 /= f2;
d2 /= f2;
d += rand.nextGaussian() * 0.0074999998323619366D * (double)f1;
d1 += rand.nextGaussian() * 0.0074999998323619366D * (double)f1;
d2 += rand.nextGaussian() * 0.0074999998323619366D * (double)f1;
d += rand.nextGaussian() * 0.0074999998323619366D * (double) f1;
d1 += rand.nextGaussian() * 0.0074999998323619366D * (double) f1;
d2 += rand.nextGaussian() * 0.0074999998323619366D * (double) f1;
d *= f;
d1 *= f;
d2 *= f;
@ -132,43 +127,43 @@ public class RotatingBase extends Entity
motionY = d1;
motionZ = d2;
float f3 = MathHelper.sqrt_double(d * d + d2 * d2);
prevRotationYaw = rotationYaw = (float)((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
prevRotationPitch = rotationPitch = (float)((Math.atan2(d1, f3) * 180D) / 3.1415927410125732D);
prevRotationYaw = rotationYaw = (float) ((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
prevRotationPitch = rotationPitch = (float) ((Math.atan2(d1, f3) * 180D) / 3.1415927410125732D);
ticksInGround = 0;
}
@Override
public void setVelocity(double d, double d1, double d2)
public void setVelocity (double d, double d1, double d2)
{
motionX = d;
motionY = d1;
motionZ = d2;
if(prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(d * d + d2 * d2);
prevRotationYaw = rotationYaw = (float)((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
prevRotationPitch = rotationPitch = (float)((Math.atan2(d1, f) * 180D) / 3.1415927410125732D);
prevRotationYaw = rotationYaw = (float) ((Math.atan2(d, d2) * 180D) / 3.1415927410125732D);
prevRotationPitch = rotationPitch = (float) ((Math.atan2(d1, f) * 180D) / 3.1415927410125732D);
}
}
@Override
public void onUpdate()
public void onUpdate ()
{
super.onUpdate();
if(prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
prevRotationYaw = rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / Math.PI);
prevRotationPitch = rotationPitch = (float)((Math.atan2(motionY, f) * 180D) / Math.PI);
prevRotationYaw = rotationYaw = (float) ((Math.atan2(motionX, motionZ) * 180D) / Math.PI);
prevRotationPitch = rotationPitch = (float) ((Math.atan2(motionY, f) * 180D) / Math.PI);
}
if(arrowShake > 0)
if (arrowShake > 0)
{
arrowShake--;
}
if(inGround)
if (inGround)
{
int i = worldObj.getBlockId(xTile, yTile, zTile);
if(i != inTile)
if (i != inTile)
{
inGround = false;
motionX *= rand.nextFloat() * 0.2F;
@ -176,25 +171,27 @@ public class RotatingBase extends Entity
motionZ *= rand.nextFloat() * 0.2F;
ticksInGround = 0;
ticksInAir = 0;
} else
}
else
{
ticksInGround++;
if(ticksInGround == 1200)
if (ticksInGround == 1200)
{
setDead();
}
if(ticksInGround == maxGroundTicks)
if (ticksInGround == maxGroundTicks)
{
setDead();
}
if(!hasHitGround)
if (!hasHitGround)
{
hasHitGround = true;
damageDagger(1, true);
}
return;
}
} else
}
else
{
ticksInAir++;
}
@ -203,41 +200,41 @@ public class RotatingBase extends Entity
MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3d, vec3d1);
vec3d = Vec3.createVectorHelper(posX, posY, posZ);
vec3d1 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
if(movingobjectposition != null)
if (movingobjectposition != null)
{
vec3d1 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
double d = 0.0D;
for(int j = 0; j < list.size(); j++)
for (int j = 0; j < list.size(); j++)
{
Entity entity1 = (Entity)list.get(j);
if(!entity1.canBeCollidedWith() || entity1 == owner && ticksInAir < 5)
Entity entity1 = (Entity) list.get(j);
if (!entity1.canBeCollidedWith() || entity1 == owner && ticksInAir < 5)
{
continue;
}
float f3 = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f3, f3, f3);
MovingObjectPosition movingobjectposition2 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
if(movingobjectposition2 == null)
if (movingobjectposition2 == null)
{
continue;
}
double d1 = vec3d.distanceTo(movingobjectposition2.hitVec);
if(d1 < d || d == 0.0D)
if (d1 < d || d == 0.0D)
{
entity = entity1;
d = d1;
}
}
if(entity != null)
if (entity != null)
{
MovingObjectPosition movingobjectposition1 = new MovingObjectPosition(entity);
onHit(movingobjectposition1);
}
if(movingobjectposition != null)
if (movingobjectposition != null)
{
onHit(movingobjectposition);
}
@ -245,21 +242,29 @@ public class RotatingBase extends Entity
posY += motionY;
posZ += motionZ;
float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / 3.1415927410125732D);
for(rotationPitch = (float)((Math.atan2(motionY, f1) * 180D) / 3.1415927410125732D); rotationPitch - prevRotationPitch < -180F; prevRotationPitch -= 360F) { }
for(; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F) { }
for(; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F) { }
for(; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F) { }
rotationYaw = (float) ((Math.atan2(motionX, motionZ) * 180D) / 3.1415927410125732D);
for (rotationPitch = (float) ((Math.atan2(motionY, f1) * 180D) / 3.1415927410125732D); rotationPitch - prevRotationPitch < -180F; prevRotationPitch -= 360F)
{
}
for (; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F)
{
}
for (; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F)
{
}
for (; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F)
{
}
rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F;
rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F;
float f2 = 0.99F;
float f4 = 0.03F;
if(isInWater())
if (isInWater())
{
for(int k = 0; k < 4; k++)
for (int k = 0; k < 4; k++)
{
float f5 = 0.25F;
worldObj.spawnParticle("bubble", posX - motionX * (double)f5, posY - motionY * (double)f5, posZ - motionZ * (double)f5, motionX, motionY, motionZ);
worldObj.spawnParticle("bubble", posX - motionX * (double) f5, posY - motionY * (double) f5, posZ - motionZ * (double) f5, motionX, motionY, motionZ);
}
f2 = 0.8F;
@ -269,24 +274,26 @@ public class RotatingBase extends Entity
motionZ *= f2;
motionY -= f4;
setPosition(posX, posY, posZ);
if(!inGround)
if (!inGround)
{
prevBoomerangRotation = boomerangRotation;
for(boomerangRotation += 36F; boomerangRotation > 360F; boomerangRotation -= 360F) { }
for (boomerangRotation += 36F; boomerangRotation > 360F; boomerangRotation -= 360F)
{
}
}
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
public void writeEntityToNBT (NBTTagCompound nbttagcompound)
{
nbttagcompound.setShort("xTile", (short)xTile);
nbttagcompound.setShort("yTile", (short)yTile);
nbttagcompound.setShort("zTile", (short)zTile);
nbttagcompound.setByte("inTile", (byte)inTile);
nbttagcompound.setByte("shake", (byte)arrowShake);
nbttagcompound.setByte("inGround", (byte)(inGround ? 1 : 0));
nbttagcompound.setShort("xTile", (short) xTile);
nbttagcompound.setShort("yTile", (short) yTile);
nbttagcompound.setShort("zTile", (short) zTile);
nbttagcompound.setByte("inTile", (byte) inTile);
nbttagcompound.setByte("shake", (byte) arrowShake);
nbttagcompound.setByte("inGround", (byte) (inGround ? 1 : 0));
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
public void readEntityFromNBT (NBTTagCompound nbttagcompound)
{
xTile = nbttagcompound.getShort("xTile");
yTile = nbttagcompound.getShort("yTile");
@ -296,20 +303,20 @@ public class RotatingBase extends Entity
inGround = nbttagcompound.getByte("inGround") == 1;
}
public void onCollideWithPlayer(EntityPlayer entityplayer)
public void onCollideWithPlayer (EntityPlayer entityplayer)
{
onCollideWithPlayer(entityplayer, true);
}
public void onCollideWithPlayer(EntityPlayer entityplayer, boolean flag)
public void onCollideWithPlayer (EntityPlayer entityplayer, boolean flag)
{
if(returnStack == null || returnStack.stackSize == 0 || worldObj.isRemote)
if (returnStack == null || returnStack.stackSize == 0 || worldObj.isRemote)
{
return;
}
if(!flag || inGround && arrowShake <= 0)
if (!flag || inGround && arrowShake <= 0)
{
if(!flag || returnsTo != null && !returnsTo.isDead && returnsTo != entityplayer)
if (!flag || returnsTo != null && !returnsTo.isDead && returnsTo != entityplayer)
{
return;
}
@ -320,7 +327,7 @@ public class RotatingBase extends Entity
}
}
public float getShadowSize()
public float getShadowSize ()
{
return 0.0F;
}

View File

@ -4,7 +4,7 @@ import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.common.NaturaContent;
import mods.natura.common.NContent;
import mods.tinker.tconstruct.TContent;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;

View File

@ -4,7 +4,7 @@ import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.natura.common.NaturaContent;
import mods.natura.common.NContent;
import mods.tinker.tconstruct.TContent;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;

View File

@ -0,0 +1,41 @@
package mods.tinker.tconstruct.items.blocks;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class SpeedBlockItem extends ItemBlock
{
public static final String blockType[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
"brownstone.smooth.chiseled" };
public SpeedBlockItem(int id)
{
super(id);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.").append(blockType[pos]).toString();
}
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
int metadata = stack.getItemDamage();
if (metadata == 1 || metadata == 4)
list.add("You run pretty fast on it");
else
list.add("You run a bit faster on it");
}
}

View File

@ -32,6 +32,12 @@ public class CastingBasinLogic extends InventoryLogic
{
super(2);
}
@Override
public int getInventoryStackLimit ()
{
return 1;
}
@Override
public String getInvName () //Not a gui block

View File

@ -32,6 +32,12 @@ public class CastingTableLogic extends InventoryLogic
{
super(2);
}
@Override
public int getInventoryStackLimit ()
{
return 1;
}
@Override
public String getInvName () //Not a gui block

View File

@ -324,6 +324,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
if (moltenMetal.size() == 0)
{
moltenMetal.add(liquid);
currentLiquid += liquid.amount;
return true;
}
else
@ -332,8 +333,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
return false;
currentLiquid += liquid.amount;
System.out.println("Current liquid: "+currentLiquid);
boolean added = false;
//for (LiquidStack l : moltenMetal)
for (int i = 0; i < moltenMetal.size(); i++)
{
LiquidStack l = moltenMetal.get(i);
@ -725,7 +726,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
//liquid = null;
moltenMetal.remove(liquid);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
currentLiquid -= liq.amount;
currentLiquid = 0;
}
return liq;
}
@ -735,7 +736,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
liquid.amount -= maxDrain;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
currentLiquid = 0;
currentLiquid -= maxDrain;
}
return new LiquidStack(liquid.itemID, maxDrain, liquid.itemMeta);
}

View File

@ -1,7 +1,14 @@
package mods.tinker.tconstruct.tools;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
import mods.tinker.tconstruct.library.Weapon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class Dagger extends Weapon
{
@ -10,38 +17,76 @@ public class Dagger extends Weapon
super(id, 1);
}
public ItemStack onItemRightClick (ItemStack itemstack, World world, EntityPlayer entityplayer)
{
ItemStack is = itemstack.copy();
is.stackSize--;
if (!world.isRemote)
{
DaggerEntity dagger = new DaggerEntity(itemstack, world, entityplayer);
world.spawnEntityInWorld(dagger);
}
return is;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderPasses (int metadata)
{
return 8;
}
@Override
public int getPartAmount()
{
return 2;
}
@Override
public void registerPartPaths (int index, String[] location)
{
headStrings.put(index, location[0]);
brokenHeadStrings.put(index, location[1]);
handleStrings.put(index, location[2]);
}
@Override
public String getIconSuffix (int partType)
{
// TODO Auto-generated method stub
return null;
switch (partType)
{
case 0:
return "_dagger_blade";
case 1:
return "_dagger_blade_broken";
case 2:
return "_dagger_handle";
default:
return "";
}
}
@Override
public String getEffectSuffix ()
{
// TODO Auto-generated method stub
return null;
return "_dagger_effect";
}
@Override
public String getDefaultFolder ()
{
// TODO Auto-generated method stub
return null;
return "dagger";
}
@Override
protected Item getHeadItem ()
{
// TODO Auto-generated method stub
return null;
return TContent.swordBlade;
}
@Override
protected Item getAccessoryItem ()
{
// TODO Auto-generated method stub
return null;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Some files were not shown because too many files have changed in this diff Show More