mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 20:22:36 +00:00
Pre 1.1.11
This commit is contained in:
1 parent
361a5bf603
commit
b913622dda
67 files changed
+1332
-1014
No files matched your search
@@ -48,9 +48,11 @@ public class PHConstruct {
|
||||
craftedSoil = config.getBlock("Special Soil", 1476).getInt(1476);
|
||||
searedTable = config.getBlock("Seared Table", 1477).getInt(1477);
|
||||
metalBlock = config.getBlock("Metal Storage", 1478).getInt(1478);
|
||||
metalFlowing = config.getBlock("Liquid Metal Flowing", 1479).getInt(1479);
|
||||
metalStill = config.getBlock("Liquid Metal Still", 1480).getInt(1480);
|
||||
//landmine = config.getBlock("Landmine", 1481).getInt(1481);
|
||||
|
||||
ironFlowing = config.getBlock("Liquid Iron Flowing", 1504).getInt(1504);
|
||||
/*ironFlowing = config.getBlock("Liquid Iron Flowing", 1504).getInt(1504);
|
||||
ironStill = config.getBlock("Liquid Iron Still", 1505).getInt(1505);
|
||||
goldFlowing = config.getBlock("Liquid Gold Flowing", 1480).getInt(1480);
|
||||
goldStill = config.getBlock("Liquid Gold Still", 1481).getInt(1481);
|
||||
@@ -75,7 +77,7 @@ public class PHConstruct {
|
||||
obsidianFlowing = config.getBlock("Liquid Obsidian Flowing", 1500).getInt(1500);
|
||||
obsidianStill = config.getBlock("Liquid Obsidian Still", 1501).getInt(1501);
|
||||
steelFlowing = config.getBlock("Liquid Steel Flowing", 1502).getInt(1502);
|
||||
steelStill = config.getBlock("Liquid Steel Still", 1503).getInt(1503);
|
||||
steelStill = config.getBlock("Liquid Steel Still", 1503).getInt(1503);*/
|
||||
|
||||
manual = config.getItem("Patterns and Misc", "Tinker's Manual", 14018).getInt(14018);
|
||||
blankPattern = config.getItem("Patterns and Misc", "Blank Patterns", 14019).getInt(14019);
|
||||
@@ -169,8 +171,10 @@ public class PHConstruct {
|
||||
//Traps
|
||||
//public static int landmine;
|
||||
|
||||
//Liquids TODO: Redux
|
||||
public static int ironFlowing;
|
||||
//Liquids
|
||||
public static int metalFlowing;
|
||||
public static int metalStill;
|
||||
/*public static int ironFlowing;
|
||||
public static int ironStill;
|
||||
public static int goldFlowing;
|
||||
public static int goldStill;
|
||||
@@ -197,7 +201,7 @@ public class PHConstruct {
|
||||
public static int obsidianFlowing;
|
||||
public static int obsidianStill;
|
||||
public static int steelFlowing;
|
||||
public static int steelStill;
|
||||
public static int steelStill;*/
|
||||
|
||||
//Patterns and misc
|
||||
public static int blankPattern;
|
||||
|
||||
+76
-142
@@ -3,7 +3,9 @@ package tinker.tconstruct;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
@@ -90,34 +92,9 @@ public class TContent implements IFuelHandler
|
||||
public static Block landmine;
|
||||
|
||||
//Liquids
|
||||
public static Block ironFlowing;
|
||||
public static Block ironStill;
|
||||
public static Block goldFlowing;
|
||||
public static Block goldStill;
|
||||
public static Block copperFlowing;
|
||||
public static Block copperStill;
|
||||
public static Block tinFlowing;
|
||||
public static Block tinStill;
|
||||
public static Block aluminumFlowing;
|
||||
public static Block aluminumStill;
|
||||
public static Block cobaltFlowing;
|
||||
public static Block cobaltStill;
|
||||
public static Block arditeFlowing;
|
||||
public static Block arditeStill;
|
||||
|
||||
public static Block bronzeFlowing;
|
||||
public static Block bronzeStill;
|
||||
public static Block alBrassFlowing;
|
||||
public static Block alBrassStill;
|
||||
public static Block manyullynFlowing;
|
||||
public static Block manyullynStill;
|
||||
public static Block alumiteFlowing;
|
||||
public static Block alumiteStill;
|
||||
|
||||
public static Block obsidianFlowing;
|
||||
public static Block obsidianStill;
|
||||
public static Block steelFlowing;
|
||||
public static Block steelStill;
|
||||
public static Block liquidMetalFlowing;
|
||||
public static Block liquidMetalStill;
|
||||
public static Material liquidMetal;
|
||||
|
||||
//public static Block axle;
|
||||
|
||||
@@ -199,58 +176,12 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.registerBlock(landmine, "landmine");*/
|
||||
|
||||
//Liquids
|
||||
ironFlowing = new IronFlowing(PHConstruct.ironFlowing).setBlockName("liquid.ironFlow");
|
||||
GameRegistry.registerBlock(ironFlowing, "Liquid Iron Flowing");
|
||||
ironStill = new IronStill(PHConstruct.ironStill).setBlockName("liquid.ironStill");
|
||||
GameRegistry.registerBlock(ironStill, "Liquid Iron Still");
|
||||
goldFlowing = new GoldFlowing(PHConstruct.goldFlowing).setBlockName("liquid.goldFlow");
|
||||
GameRegistry.registerBlock(goldFlowing, "Liquid Gold Flowing");
|
||||
goldStill = new GoldStill(PHConstruct.goldStill).setBlockName("liquid.goldStill");
|
||||
GameRegistry.registerBlock(goldStill, "Liquid Gold Still");
|
||||
copperFlowing = new CopperFlowing(PHConstruct.copperFlowing).setBlockName("liquid.copperFlow");
|
||||
GameRegistry.registerBlock(copperFlowing, "Liquid copper Flowing");
|
||||
copperStill = new CopperStill(PHConstruct.copperStill).setBlockName("liquid.copperStill");
|
||||
GameRegistry.registerBlock(copperStill, "Liquid copper Still");
|
||||
tinFlowing = new TinFlowing(PHConstruct.tinFlowing).setBlockName("liquid.tinFlow");
|
||||
GameRegistry.registerBlock(tinFlowing, "Liquid tin Flowing");
|
||||
tinStill = new TinStill(PHConstruct.tinStill).setBlockName("liquid.tinStill");
|
||||
GameRegistry.registerBlock(tinStill, "Liquid tin Still");
|
||||
aluminumFlowing = new AluminumFlowing(PHConstruct.aluminumFlowing).setBlockName("liquid.aluminumFlow");
|
||||
GameRegistry.registerBlock(aluminumFlowing, "Liquid aluminum Flowing");
|
||||
aluminumStill = new AluminumStill(PHConstruct.aluminumStill).setBlockName("liquid.aluminumStill");
|
||||
GameRegistry.registerBlock(aluminumStill, "Liquid aluminum Still");
|
||||
cobaltFlowing = new CobaltFlowing(PHConstruct.cobaltFlowing).setBlockName("liquid.cobaltFlow");
|
||||
GameRegistry.registerBlock(cobaltFlowing, "Liquid cobalt Flowing");
|
||||
cobaltStill = new CobaltStill(PHConstruct.cobaltStill).setBlockName("liquid.cobaltStill");
|
||||
GameRegistry.registerBlock(cobaltStill, "Liquid cobalt Still");
|
||||
arditeFlowing = new ArditeFlowing(PHConstruct.arditeFlowing).setBlockName("liquid.arditeFlow");
|
||||
GameRegistry.registerBlock(arditeFlowing, "Liquid ardite Flowing");
|
||||
arditeStill = new ArditeStill(PHConstruct.arditeStill).setBlockName("liquid.arditeStill");
|
||||
GameRegistry.registerBlock(arditeStill, "Liquid ardite Still");
|
||||
bronzeFlowing = new BronzeFlowing(PHConstruct.bronzeFlowing).setBlockName("liquid.bronzeFlow");
|
||||
GameRegistry.registerBlock(bronzeFlowing, "Liquid bronze Flowing");
|
||||
bronzeStill = new BronzeStill(PHConstruct.bronzeStill).setBlockName("liquid.bronzeStill");
|
||||
GameRegistry.registerBlock(bronzeStill, "Liquid bronze Still");
|
||||
alBrassFlowing = new AlBrassFlowing(PHConstruct.brassFlowing).setBlockName("liquid.brassFlow");
|
||||
GameRegistry.registerBlock(alBrassFlowing, "Liquid albrass Flowing");
|
||||
alBrassStill = new AlBrassStill(PHConstruct.brassStill).setBlockName("liquid.brassStill");
|
||||
GameRegistry.registerBlock(alBrassStill, "Liquid albrass Still");
|
||||
manyullynFlowing = new ManyullynFlowing(PHConstruct.manyullynFlowing).setBlockName("liquid.manyullynFlow");
|
||||
GameRegistry.registerBlock(manyullynFlowing, "Liquid manyullyn Flowing");
|
||||
manyullynStill = new ManyullynStill(PHConstruct.manyullynStill).setBlockName("liquid.manyullynStill");
|
||||
GameRegistry.registerBlock(manyullynStill, "Liquid manyullun Still");
|
||||
alumiteFlowing = new AlumiteFlowing(PHConstruct.alumiteFlowing).setBlockName("liquid.alumiteFlow");
|
||||
GameRegistry.registerBlock(alumiteFlowing, "Liquid alumite Flowing");
|
||||
alumiteStill = new AlumiteStill(PHConstruct.alumiteStill).setBlockName("liquid.alumiteStill");
|
||||
GameRegistry.registerBlock(alumiteStill, "Liquid alumite Still");
|
||||
obsidianFlowing = new ObsidianFlowing(PHConstruct.obsidianFlowing).setBlockName("liquid.obsidianFlow");
|
||||
GameRegistry.registerBlock(obsidianFlowing, "Liquid obsidian Flowing");
|
||||
obsidianStill = new ObsidianStill(PHConstruct.obsidianStill).setBlockName("liquid.obsidianStill");
|
||||
GameRegistry.registerBlock(obsidianStill, "Liquid obsidian Still");
|
||||
steelFlowing = new SteelFlowing(PHConstruct.steelFlowing).setBlockName("liquid.steelFlow");
|
||||
GameRegistry.registerBlock(steelFlowing, "Liquid steel Flowing");
|
||||
steelStill = new SteelStill(PHConstruct.steelStill).setBlockName("liquid.steelStill");
|
||||
GameRegistry.registerBlock(steelStill, "Liquid steel Still");
|
||||
liquidMetal = new MaterialLiquid(MapColor.tntColor);
|
||||
liquidMetalFlowing = new LiquidMetalFlowing(PHConstruct.metalFlowing).setBlockName("liquid.metalFlow");
|
||||
liquidMetalStill = new LiquidMetalStill(PHConstruct.metalStill).setBlockName("liquid.metalStill");
|
||||
GameRegistry.registerBlock(liquidMetalFlowing, LiquidItemBlock.class, "metalFlow");
|
||||
GameRegistry.registerBlock(liquidMetalStill, LiquidItemBlock.class, "metalStill");
|
||||
GameRegistry.registerTileEntity(LiquidTextureLogic.class, "LiquidTexture");
|
||||
}
|
||||
|
||||
void registerItems ()
|
||||
@@ -430,31 +361,34 @@ public class TContent implements IFuelHandler
|
||||
|
||||
LiquidCasting lc = LiquidCasting.instance;
|
||||
//Blank
|
||||
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(alBrassStill.blockID, 1, 0), 50);
|
||||
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, 1, 10), 50);
|
||||
|
||||
//Ingots
|
||||
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(ironStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(goldStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(copperStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(tinStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(aluminumStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(cobaltStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(arditeStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(manyullynStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(bronzeStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(alBrassStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(alumiteStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(steelStill.blockID, 1, 0), ingotcast, 50);
|
||||
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, 1, 0), ingotcast, 50); //Iron
|
||||
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, 1, 1), ingotcast, 50); //gold
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 2), ingotcast, 50); //copper
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 3), ingotcast, 50); //tin
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, 1, 4), ingotcast, 50); //aluminum
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, 1, 5), ingotcast, 50); //cobalt
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, 1, 6), ingotcast, 50); //ardite
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 7), ingotcast, 50); //bronze
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, 1, 8), ingotcast, 50); //albrass
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, 1, 9), ingotcast, 50); //manyullyn
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, 1, 10), ingotcast, 50); //alumite
|
||||
// obsidian
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, 1, 12), ingotcast, 50); //steel
|
||||
|
||||
|
||||
|
||||
liquids = new LiquidStack[] {
|
||||
new LiquidStack(ironStill, 1),
|
||||
new LiquidStack(copperStill, 1),
|
||||
new LiquidStack(cobaltStill, 1),
|
||||
new LiquidStack(arditeStill, 1),
|
||||
new LiquidStack(manyullynStill, 1),
|
||||
new LiquidStack(bronzeStill, 1),
|
||||
new LiquidStack(alumiteStill, 1),
|
||||
new LiquidStack(steelStill, 1)
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 0),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 2),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 5),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 6),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 9),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 7),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 10),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 12)
|
||||
};
|
||||
int[] liquidDamage = new int[] {
|
||||
2, 13, 10, 11, 12, 14, 15, 16
|
||||
@@ -473,21 +407,21 @@ public class TContent implements IFuelHandler
|
||||
void addSmelteryRecipes()
|
||||
{
|
||||
//Ore
|
||||
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(ironStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(goldStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, 250, 1));
|
||||
|
||||
//Ingots
|
||||
Smeltery.addMelting(new ItemStack(Item.ingotIron, 8), Block.blockSteel.blockID, 0, 500, new LiquidStack(ironStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(new ItemStack(Item.ingotGold, 8), Block.blockGold.blockID, 0, 450, new LiquidStack(goldStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(new ItemStack(Item.ingotIron, 8), Block.blockSteel.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(new ItemStack(Item.ingotGold, 8), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, 250, 1));
|
||||
|
||||
//Blocks
|
||||
Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(ironStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(goldStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(obsidianStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(liquidMetalStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, 2250, 1));
|
||||
Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, 250, 11));
|
||||
|
||||
//Alloys
|
||||
Smeltery.addAlloyMixing(new LiquidStack(bronzeStill.blockID, 4, 0), new LiquidStack(copperStill.blockID, 3, 0), new LiquidStack(tinStill.blockID, 1, 0));
|
||||
Smeltery.addAlloyMixing(new LiquidStack(alBrassStill.blockID, 4, 0), new LiquidStack(aluminumStill.blockID, 3, 0), new LiquidStack(copperStill.blockID, 1, 0));
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3));
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 8), new LiquidStack(liquidMetalStill.blockID, 3, 4), new LiquidStack(liquidMetalStill.blockID, 1, 2));
|
||||
}
|
||||
|
||||
void addCraftingRecipes ()
|
||||
@@ -652,14 +586,14 @@ public class TContent implements IFuelHandler
|
||||
public void modIntegration ()
|
||||
{
|
||||
/* Liquids */
|
||||
Block[] liquids = new Block[] { ironStill, goldStill, copperStill, tinStill, aluminumStill, cobaltStill,
|
||||
arditeStill, bronzeStill, alBrassStill, manyullynStill, alumiteStill, obsidianStill, steelStill };
|
||||
//Block[] liquids = new Block[] { ironStill, goldStill, copperStill, tinStill, aluminumStill, cobaltStill,
|
||||
//arditeStill, bronzeStill, alBrassStill, manyullynStill, alumiteStill, obsidianStill, steelStill };
|
||||
String[] liquidNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "Brass", "Manyullyn", "Alumite", "Obsidian", "Steel" };
|
||||
for (int i = 0; i < liquids.length; i++)
|
||||
for (int iter = 0; iter < liquidNames.length; iter++)
|
||||
{
|
||||
LiquidStack liquidstack = new LiquidStack(liquids[i].blockID, LiquidContainerRegistry.BUCKET_VOLUME, i);
|
||||
LiquidDictionary.getOrCreateLiquid("Liquid"+liquidNames[i], liquidstack);
|
||||
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(liquidstack, new ItemStack(buckets, 1, i), new ItemStack(Item.bucketEmpty)));
|
||||
LiquidStack liquidstack = new LiquidStack(liquidMetalStill.blockID, LiquidContainerRegistry.BUCKET_VOLUME, iter);
|
||||
LiquidDictionary.getOrCreateLiquid("Liquid"+liquidNames[iter], liquidstack);
|
||||
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(liquidstack, new ItemStack(buckets, 1, iter), new ItemStack(Item.bucketEmpty)));
|
||||
}
|
||||
|
||||
/* Ore Dictionary */
|
||||
@@ -667,135 +601,135 @@ public class TContent implements IFuelHandler
|
||||
for (ItemStack copper : copperIngots)
|
||||
{
|
||||
PatternBuilder.instance.registerMaterial(copper, 2, "Copper");
|
||||
Smeltery.addMelting(copper, metalBlock.blockID, 3, 450, new LiquidStack(copperStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(copper, metalBlock.blockID, 3, 450, new LiquidStack(liquidMetalStill.blockID, 250, 2));
|
||||
}
|
||||
ArrayList<ItemStack> tinIngots = OreDictionary.getOres("ingotTin");
|
||||
for (ItemStack tin : tinIngots)
|
||||
{
|
||||
Smeltery.addMelting(tin, metalBlock.blockID, 5, 175, new LiquidStack(tinStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(tin, metalBlock.blockID, 5, 175, new LiquidStack(liquidMetalStill.blockID, 250, 3));
|
||||
}
|
||||
ArrayList<ItemStack> bronzeIngots = OreDictionary.getOres("ingotBronze");
|
||||
for (ItemStack bronze : bronzeIngots)
|
||||
{
|
||||
PatternBuilder.instance.registerMaterial(bronze, 2, "Bronze");
|
||||
Smeltery.addMelting(bronze, metalBlock.blockID, 4, 500, new LiquidStack(bronzeStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(bronze, metalBlock.blockID, 4, 500, new LiquidStack(liquidMetalStill.blockID, 250, 7));
|
||||
}
|
||||
ArrayList<ItemStack> cobaltIngots = OreDictionary.getOres("ingotCobalt");
|
||||
for (ItemStack cobalt : cobaltIngots)
|
||||
{
|
||||
Smeltery.addMelting(cobalt, metalBlock.blockID, 0, 650, new LiquidStack(cobaltStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(cobalt, metalBlock.blockID, 0, 650, new LiquidStack(liquidMetalStill.blockID, 250, 5));
|
||||
}
|
||||
ArrayList<ItemStack> arditeIngots = OreDictionary.getOres("ingotArdite");
|
||||
for (ItemStack ardite : arditeIngots)
|
||||
{
|
||||
Smeltery.addMelting(ardite, metalBlock.blockID, 1, 650, new LiquidStack(arditeStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(ardite, metalBlock.blockID, 1, 650, new LiquidStack(liquidMetalStill.blockID, 250, 6));
|
||||
}
|
||||
ArrayList<ItemStack> aluminumIngots = OreDictionary.getOres("ingotAluminum");
|
||||
for (ItemStack aluminum : aluminumIngots)
|
||||
{
|
||||
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(aluminumStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(liquidMetalStill.blockID, 250, 4));
|
||||
}
|
||||
ArrayList<ItemStack> aluminumRaw = OreDictionary.getOres("naturalAluminum");
|
||||
for (ItemStack aluminum : aluminumRaw)
|
||||
{
|
||||
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(aluminumStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(liquidMetalStill.blockID, 250, 4));
|
||||
}
|
||||
ArrayList<ItemStack> manyullynIngots = OreDictionary.getOres("ingotManyullyn");
|
||||
for (ItemStack manyullyn : manyullynIngots)
|
||||
{
|
||||
Smeltery.addMelting(manyullyn, metalBlock.blockID, 2, 750, new LiquidStack(manyullynStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(manyullyn, metalBlock.blockID, 2, 750, new LiquidStack(liquidMetalStill.blockID, 250, 9));
|
||||
}
|
||||
ArrayList<ItemStack> alBrassIngots = OreDictionary.getOres("ingotAluminumBrass");
|
||||
for (ItemStack alBrass : alBrassIngots)
|
||||
{
|
||||
Smeltery.addMelting(alBrass, metalBlock.blockID, 7, 350, new LiquidStack(alBrassStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(alBrass, metalBlock.blockID, 7, 350, new LiquidStack(liquidMetalStill.blockID, 250, 8));
|
||||
}
|
||||
ArrayList<ItemStack> alumiteIngots = OreDictionary.getOres("ingotAlumite");
|
||||
for (ItemStack alumite : alumiteIngots)
|
||||
{
|
||||
Smeltery.addMelting(alumite, metalBlock.blockID, 8, 500, new LiquidStack(alumiteStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(alumite, metalBlock.blockID, 8, 500, new LiquidStack(liquidMetalStill.blockID, 250, 10));
|
||||
}
|
||||
ArrayList<ItemStack> steelIngots = OreDictionary.getOres("ingotSteel");
|
||||
for (ItemStack steel : steelIngots)
|
||||
{
|
||||
Smeltery.addMelting(steel, metalBlock.blockID, 9, 500, new LiquidStack(steelStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(steel, metalBlock.blockID, 9, 500, new LiquidStack(liquidMetalStill.blockID, 250, 12));
|
||||
}
|
||||
|
||||
ArrayList<ItemStack> cobaltOres = OreDictionary.getOres("oreCobalt");
|
||||
for (ItemStack cobalt : cobaltOres)
|
||||
{
|
||||
Smeltery.addMelting(cobalt, 750, new LiquidStack(cobaltStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(cobalt, 750, new LiquidStack(liquidMetalStill.blockID, 500, 5));
|
||||
}
|
||||
ArrayList<ItemStack> arditeOres = OreDictionary.getOres("oreArdite");
|
||||
for (ItemStack ardite : arditeOres)
|
||||
{
|
||||
Smeltery.addMelting(ardite, 750, new LiquidStack(arditeStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(ardite, 750, new LiquidStack(liquidMetalStill.blockID, 500, 6));
|
||||
}
|
||||
ArrayList<ItemStack> copperOres = OreDictionary.getOres("oreCopper");
|
||||
for (ItemStack copper : copperOres)
|
||||
{
|
||||
Smeltery.addMelting(copper, 750, new LiquidStack(copperStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(copper, 750, new LiquidStack(liquidMetalStill.blockID, 500, 2));
|
||||
}
|
||||
ArrayList<ItemStack> tinOres = OreDictionary.getOres("oreTin");
|
||||
for (ItemStack tin : tinOres)
|
||||
{
|
||||
Smeltery.addMelting(tin, 750, new LiquidStack(tinStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(tin, 750, new LiquidStack(liquidMetalStill.blockID, 500, 3));
|
||||
}
|
||||
ArrayList<ItemStack> aluminumOres = OreDictionary.getOres("oreAluminum");
|
||||
for (ItemStack aluminum : aluminumOres)
|
||||
{
|
||||
Smeltery.addMelting(aluminum, 750, new LiquidStack(aluminumStill.blockID, 250, 0));
|
||||
Smeltery.addMelting(aluminum, 750, new LiquidStack(liquidMetalStill.blockID, 500, 4));
|
||||
}
|
||||
|
||||
ArrayList<ItemStack> copperblocks = OreDictionary.getOres("blockCopper");
|
||||
for (ItemStack copper : copperblocks)
|
||||
{
|
||||
Smeltery.addMelting(copper, 450, new LiquidStack(copperStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(copper, 450, new LiquidStack(liquidMetalStill.blockID, 2250, 2));
|
||||
}
|
||||
ArrayList<ItemStack> tinblocks = OreDictionary.getOres("blockTin");
|
||||
for (ItemStack tin : tinblocks)
|
||||
{
|
||||
Smeltery.addMelting(tin, 175, new LiquidStack(tinStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(tin, 175, new LiquidStack(liquidMetalStill.blockID, 2250, 3));
|
||||
}
|
||||
ArrayList<ItemStack> bronzeblocks = OreDictionary.getOres("blockBronze");
|
||||
for (ItemStack bronze : bronzeblocks)
|
||||
{
|
||||
Smeltery.addMelting(bronze, 500, new LiquidStack(bronzeStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(bronze, 500, new LiquidStack(liquidMetalStill.blockID, 2250, 7));
|
||||
}
|
||||
ArrayList<ItemStack> cobaltblocks = OreDictionary.getOres("blockCobalt");
|
||||
for (ItemStack cobalt : cobaltblocks)
|
||||
{
|
||||
Smeltery.addMelting(cobalt, 650, new LiquidStack(cobaltStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(cobalt, 650, new LiquidStack(liquidMetalStill.blockID, 2250, 5));
|
||||
}
|
||||
ArrayList<ItemStack> arditeblocks = OreDictionary.getOres("blockArdite");
|
||||
for (ItemStack ardite : arditeblocks)
|
||||
{
|
||||
Smeltery.addMelting(ardite, 650, new LiquidStack(arditeStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(ardite, 650, new LiquidStack(liquidMetalStill.blockID, 2250, 6));
|
||||
}
|
||||
ArrayList<ItemStack> aluminumblocks = OreDictionary.getOres("blockAluminum");
|
||||
for (ItemStack aluminum : aluminumblocks)
|
||||
{
|
||||
Smeltery.addMelting(aluminum, 250, new LiquidStack(aluminumStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(aluminum, 250, new LiquidStack(liquidMetalStill.blockID, 2250, 4));
|
||||
}
|
||||
ArrayList<ItemStack> manyullynblocks = OreDictionary.getOres("blockManyullyn");
|
||||
for (ItemStack manyullyn : manyullynblocks)
|
||||
{
|
||||
Smeltery.addMelting(manyullyn, 750, new LiquidStack(manyullynStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(manyullyn, 750, new LiquidStack(liquidMetalStill.blockID, 2250, 9));
|
||||
}
|
||||
ArrayList<ItemStack> alBrassblocks = OreDictionary.getOres("blockAluminumBrass");
|
||||
for (ItemStack alBrass : alBrassblocks)
|
||||
{
|
||||
Smeltery.addMelting(alBrass, 350, new LiquidStack(alBrassStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(alBrass, 350, new LiquidStack(liquidMetalStill.blockID, 2250, 8));
|
||||
}
|
||||
ArrayList<ItemStack> alumiteblocks = OreDictionary.getOres("blockAlumite");
|
||||
for (ItemStack alumite : alumiteblocks)
|
||||
{
|
||||
Smeltery.addMelting(alumite, 500, new LiquidStack(alumiteStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(alumite, 500, new LiquidStack(liquidMetalStill.blockID, 2250, 10));
|
||||
}
|
||||
ArrayList<ItemStack> steelblocks = OreDictionary.getOres("blockSteel");
|
||||
for (ItemStack steel : steelblocks)
|
||||
{
|
||||
Smeltery.addMelting(steel, 500, new LiquidStack(steelStill.blockID, 2250, 0));
|
||||
Smeltery.addMelting(steel, 500, new LiquidStack(liquidMetalStill.blockID, 2250, 12));
|
||||
}
|
||||
|
||||
/* IC2 */
|
||||
|
||||
@@ -3,11 +3,11 @@ package tinker.tconstruct;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
import tinker.tconstruct.crafting.PatternBuilder;
|
||||
import tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
|
||||
public class TEventHandler
|
||||
{
|
||||
@@ -51,8 +51,14 @@ public class TEventHandler
|
||||
int bID = evt.world.getBlockId(hitX, hitY, hitZ);
|
||||
int meta = -1;
|
||||
|
||||
if (bID == TContent.liquidMetalStill.blockID)
|
||||
{
|
||||
LiquidTextureLogic logic = (LiquidTextureLogic) evt.world.getBlockTileEntity(hitX, hitY, hitZ);
|
||||
meta = logic.getLiquidType();
|
||||
}
|
||||
|
||||
//Want switch, can't do it!
|
||||
if (bID == TContent.ironStill.blockID)
|
||||
/*if (bID == TContent.ironStill.blockID)
|
||||
meta = 0;
|
||||
|
||||
else if (bID == TContent.goldStill.blockID)
|
||||
@@ -89,7 +95,7 @@ public class TEventHandler
|
||||
meta = 11;
|
||||
|
||||
else if (bID == TContent.steelStill.blockID)
|
||||
meta = 12;
|
||||
meta = 12;*/
|
||||
|
||||
if (meta != -1)
|
||||
{
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AlBrassFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public AlBrassFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 41;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.alBrassStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AlBrassStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public AlBrassStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 41;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.alBrassFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AluminumFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public AluminumFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.aluminumStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AluminumStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public AluminumStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.aluminumFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AlumiteFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public AlumiteFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.alumiteStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class AlumiteStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public AlumiteStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.alumiteFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ArditeFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public ArditeFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 35;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.arditeStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ArditeStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public ArditeStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 35;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.arditeFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class BronzeFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public BronzeFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 38;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.bronzeStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class BronzeStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public BronzeStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 38;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.bronzeFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class CobaltFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public CobaltFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.cobaltStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class CobaltStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public CobaltStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.cobaltFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class CopperFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public CopperFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.copperStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class CopperStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public CopperStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.copperFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class GoldFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public GoldFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.goldStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class GoldStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public GoldStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.goldFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class IronFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public IronFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.ironStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class IronStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public IronStill(int id)
|
||||
{
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.ironFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,647 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tinker.tconstruct.TContent;
|
||||
import tinker.tconstruct.client.FluidRender;
|
||||
import tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class LiquidMetalBase extends Block
|
||||
{
|
||||
|
||||
protected LiquidMetalBase(int par1, Material par2Material)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
TileEntity logic = world.getBlockTileEntity(x, y, z);
|
||||
if (logic != null && logic instanceof LiquidTextureLogic)
|
||||
return ((LiquidTextureLogic) logic).getTexturePos();
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return getBlockTextureFromSideAndMetadata(side, meta);
|
||||
}
|
||||
|
||||
public int getBlockTextureFromSideAndMetadata(int side, int meta)
|
||||
{
|
||||
int tex = (meta % 5) * 3;
|
||||
tex += (meta / 5) * 32;
|
||||
|
||||
if (side == 0 || side == 1)
|
||||
return tex;
|
||||
else
|
||||
return tex+1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return FluidRender.fluidModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile ()
|
||||
{
|
||||
return TContent.liquidTexture;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material)
|
||||
{
|
||||
Vec3 var5 = ((LiquidMetalBase) TContent.liquidMetalFlowing).getFlowVector(par0IBlockAccess, par1, par2, par3);
|
||||
|
||||
/*if (par4Material == Material.water)
|
||||
{
|
||||
var5 = ((BlockFluid)Block.waterMoving).getFlowVector(par0IBlockAccess, par1, par2, par3);
|
||||
}
|
||||
|
||||
if (par4Material == Material.lava)
|
||||
{
|
||||
var5 = ((BlockFluid)Block.lavaMoving).getFlowVector(par0IBlockAccess, par1, par2, par3);
|
||||
}*/
|
||||
|
||||
return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D);
|
||||
}
|
||||
|
||||
private Vec3 getFlowVector(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
Vec3 var5 = par1IBlockAccess.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D);
|
||||
int var6 = this.getEffectiveFlowDecay(par1IBlockAccess, par2, par3, par4);
|
||||
|
||||
for (int var7 = 0; var7 < 4; ++var7)
|
||||
{
|
||||
int var8 = par2;
|
||||
int var10 = par4;
|
||||
|
||||
if (var7 == 0)
|
||||
{
|
||||
var8 = par2 - 1;
|
||||
}
|
||||
|
||||
if (var7 == 1)
|
||||
{
|
||||
var10 = par4 - 1;
|
||||
}
|
||||
|
||||
if (var7 == 2)
|
||||
{
|
||||
++var8;
|
||||
}
|
||||
|
||||
if (var7 == 3)
|
||||
{
|
||||
++var10;
|
||||
}
|
||||
|
||||
int var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3, var10);
|
||||
int var12;
|
||||
|
||||
if (var11 < 0)
|
||||
{
|
||||
if (!par1IBlockAccess.getBlockMaterial(var8, par3, var10).blocksMovement())
|
||||
{
|
||||
var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3 - 1, var10);
|
||||
|
||||
if (var11 >= 0)
|
||||
{
|
||||
var12 = var11 - (var6 - 8);
|
||||
var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (var11 >= 0)
|
||||
{
|
||||
var12 = var11 - var6;
|
||||
var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12));
|
||||
}
|
||||
}
|
||||
|
||||
if (par1IBlockAccess.getBlockMetadata(par2, par3, par4) >= 8)
|
||||
{
|
||||
boolean var13 = false;
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 - 1, 2))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 + 1, 3))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3, par4, 4))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3, par4, 5))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 - 1, 2))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 + 1, 3))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3 + 1, par4, 4))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3 + 1, par4, 5))
|
||||
{
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
if (var13)
|
||||
{
|
||||
var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
var5 = var5.normalize();
|
||||
return var5;
|
||||
}
|
||||
|
||||
public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
return this.blockMaterial != Material.lava;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor()
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
||||
* when first determining what to render.
|
||||
*/
|
||||
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
if (this.blockMaterial != Material.water)
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
else
|
||||
{
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
int var7 = 0;
|
||||
|
||||
for (int var8 = -1; var8 <= 1; ++var8)
|
||||
{
|
||||
for (int var9 = -1; var9 <= 1; ++var9)
|
||||
{
|
||||
int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getWaterColorMultiplier();
|
||||
var5 += (var10 & 16711680) >> 16;
|
||||
var6 += (var10 & 65280) >> 8;
|
||||
var7 += var10 & 255;
|
||||
}
|
||||
}
|
||||
|
||||
return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the percentage of the fluid block that is air, based on the given flow decay of the fluid.
|
||||
*/
|
||||
public static float getFluidHeightPercent(int par0)
|
||||
{
|
||||
if (par0 >= 8)
|
||||
{
|
||||
par0 = 0;
|
||||
}
|
||||
|
||||
return (float)(par0 + 1) / 9.0F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the block texture based on the side being looked at. Args: side
|
||||
*/
|
||||
public int getBlockTextureFromSide(int par1)
|
||||
{
|
||||
return par1 != 0 && par1 != 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same
|
||||
* material as the fluid.
|
||||
*/
|
||||
protected int getFlowDecay(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.getBlockMaterial(par2, par3, par4) == this.blockMaterial ? par1World.getBlockMetadata(par2, par3, par4) : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the flow decay but converts values indicating falling liquid (values >=8) to their effective source block
|
||||
* value of zero.
|
||||
*/
|
||||
protected int getEffectiveFlowDecay(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
if (par1IBlockAccess.getBlockMaterial(par2, par3, par4) != this.blockMaterial)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
if (var5 >= 8)
|
||||
{
|
||||
var5 = 0;
|
||||
}
|
||||
|
||||
return var5;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
||||
*/
|
||||
public boolean canCollideCheck(int par1, boolean par2)
|
||||
{
|
||||
return par2 && par1 == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
|
||||
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
|
||||
*/
|
||||
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
|
||||
return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5)));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
||||
* coordinates. Args: blockAccess, x, y, z, side
|
||||
*/
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
|
||||
return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||
* cleared to be reused)
|
||||
*/
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d
|
||||
*/
|
||||
public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3)
|
||||
{
|
||||
Vec3 var7 = this.getFlowVector(par1World, par2, par3, par4);
|
||||
par6Vec3.xCoord += var7.xCoord;
|
||||
par6Vec3.yCoord += var7.yCoord;
|
||||
par6Vec3.zCoord += var7.zCoord;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many world ticks before ticking
|
||||
*/
|
||||
public int tickRate()
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids
|
||||
*/
|
||||
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
int var5 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, 0);
|
||||
int var6 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3 + 1, par4, 0);
|
||||
int var7 = var5 & 255;
|
||||
int var8 = var6 & 255;
|
||||
int var9 = var5 >> 16 & 255;
|
||||
int var10 = var6 >> 16 & 255;
|
||||
return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z
|
||||
*/
|
||||
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
float var5 = par1IBlockAccess.getLightBrightness(par2, par3, par4);
|
||||
float var6 = par1IBlockAccess.getLightBrightness(par2, par3 + 1, par4);
|
||||
return var5 > var6 ? var5 : var6;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
||||
*/
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return this.blockMaterial == Material.water ? 1 : 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* A randomly called display update to be able to add particles or other items for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
int var6;
|
||||
|
||||
if (this.blockMaterial == Material.water)
|
||||
{
|
||||
if (par5Random.nextInt(10) == 0)
|
||||
{
|
||||
var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
if (var6 <= 0 || var6 >= 8)
|
||||
{
|
||||
par1World.spawnParticle("suspended", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + par5Random.nextFloat()), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
for (var6 = 0; var6 < 0; ++var6)
|
||||
{
|
||||
int var7 = par5Random.nextInt(4);
|
||||
int var8 = par2;
|
||||
int var9 = par4;
|
||||
|
||||
if (var7 == 0)
|
||||
{
|
||||
var8 = par2 - 1;
|
||||
}
|
||||
|
||||
if (var7 == 1)
|
||||
{
|
||||
++var8;
|
||||
}
|
||||
|
||||
if (var7 == 2)
|
||||
{
|
||||
var9 = par4 - 1;
|
||||
}
|
||||
|
||||
if (var7 == 3)
|
||||
{
|
||||
++var9;
|
||||
}
|
||||
|
||||
if (par1World.getBlockMaterial(var8, par3, var9) == Material.air && (par1World.getBlockMaterial(var8, par3 - 1, var9).blocksMovement() || par1World.getBlockMaterial(var8, par3 - 1, var9).isLiquid()))
|
||||
{
|
||||
float var10 = 0.0625F;
|
||||
double var11 = (double)((float)par2 + par5Random.nextFloat());
|
||||
double var13 = (double)((float)par3 + par5Random.nextFloat());
|
||||
double var15 = (double)((float)par4 + par5Random.nextFloat());
|
||||
|
||||
if (var7 == 0)
|
||||
{
|
||||
var11 = (double)((float)par2 - var10);
|
||||
}
|
||||
|
||||
if (var7 == 1)
|
||||
{
|
||||
var11 = (double)((float)(par2 + 1) + var10);
|
||||
}
|
||||
|
||||
if (var7 == 2)
|
||||
{
|
||||
var15 = (double)((float)par4 - var10);
|
||||
}
|
||||
|
||||
if (var7 == 3)
|
||||
{
|
||||
var15 = (double)((float)(par4 + 1) + var10);
|
||||
}
|
||||
|
||||
double var17 = 0.0D;
|
||||
double var19 = 0.0D;
|
||||
|
||||
if (var7 == 0)
|
||||
{
|
||||
var17 = (double)(-var10);
|
||||
}
|
||||
|
||||
if (var7 == 1)
|
||||
{
|
||||
var17 = (double)var10;
|
||||
}
|
||||
|
||||
if (var7 == 2)
|
||||
{
|
||||
var19 = (double)(-var10);
|
||||
}
|
||||
|
||||
if (var7 == 3)
|
||||
{
|
||||
var19 = (double)var10;
|
||||
}
|
||||
|
||||
par1World.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.blockMaterial == Material.water && par5Random.nextInt(64) == 0)
|
||||
{
|
||||
var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
if (var6 > 0 && var6 < 8)
|
||||
{
|
||||
par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "liquid.water", par5Random.nextFloat() * 0.25F + 0.75F, par5Random.nextFloat() * 1.0F + 0.5F, false);
|
||||
}
|
||||
}
|
||||
|
||||
double var21;
|
||||
double var23;
|
||||
double var22;
|
||||
|
||||
if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4))
|
||||
{
|
||||
if (par5Random.nextInt(100) == 0)
|
||||
{
|
||||
var21 = (double)((float)par2 + par5Random.nextFloat());
|
||||
var22 = (double)par3 + this.maxY;
|
||||
var23 = (double)((float)par4 + par5Random.nextFloat());
|
||||
par1World.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
||||
par1World.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||
}
|
||||
|
||||
if (par5Random.nextInt(200) == 0)
|
||||
{
|
||||
par1World.playSound((double)par2, (double)par3, (double)par4, "liquid.lava", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (par5Random.nextInt(10) == 0 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !par1World.getBlockMaterial(par2, par3 - 2, par4).blocksMovement())
|
||||
{
|
||||
var21 = (double)((float)par2 + par5Random.nextFloat());
|
||||
var22 = (double)par3 - 1.05D;
|
||||
var23 = (double)((float)par4 + par5Random.nextFloat());
|
||||
|
||||
if (this.blockMaterial == Material.water)
|
||||
{
|
||||
par1World.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else
|
||||
{
|
||||
par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
||||
*/
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
this.checkForHarden(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor blockID
|
||||
*/
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
this.checkForHarden(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces lava to check to see if it is colliding with water, and then decide what it should harden to.
|
||||
*/
|
||||
private void checkForHarden(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
||||
{
|
||||
if (this.blockMaterial == Material.lava)
|
||||
{
|
||||
boolean var5 = false;
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5)
|
||||
{
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
if (var6 == 0)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
|
||||
}
|
||||
else if (var6 <= 4)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
|
||||
}
|
||||
|
||||
this.triggerLavaMixEffects(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates fizzing sound and smoke. Used when lava flows over block or mixes with water.
|
||||
*/
|
||||
protected void triggerLavaMixEffects(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
|
||||
for (int var5 = 0; var5 < 8; ++var5)
|
||||
{
|
||||
par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,50 +2,49 @@ package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
import tinker.tconstruct.client.liquidrender.RenderLiquidMetal;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFluid;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.liquids.ILiquid;
|
||||
import tinker.tconstruct.TContent;
|
||||
import tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
|
||||
public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
|
||||
public class LiquidMetalFlowing extends LiquidMetalBase
|
||||
implements ILiquid
|
||||
{
|
||||
boolean isOptimalFlowDirection[] = new boolean[4];
|
||||
int flowCost[] = new int[4];
|
||||
|
||||
public LiquidMetalFlowing(int id)
|
||||
{
|
||||
super(id, Material.lava);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return RenderLiquidMetal.liquidModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile ()
|
||||
{
|
||||
return TContent.liquidTexture;
|
||||
super(id, TContent.liquidMetal);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(x, y, z);
|
||||
return logic.getTexturePos() + 1;
|
||||
}*/
|
||||
|
||||
private void updateFlow (World world, int x, int y, int z)
|
||||
{
|
||||
//System.out.println("x: "+x+", y: "+y+", z: "+z);
|
||||
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
world.setBlockAndMetadata(x, y, z, stillLiquidId(), meta);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick (World world, int x, int y, int z, Random random)
|
||||
{
|
||||
//System.out.println("x: "+x+", y: "+y+", z: "+z);
|
||||
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
|
||||
int l = getFlowDecay(world, x, y, z);
|
||||
byte byte0 = 1;
|
||||
boolean flag = true;
|
||||
@@ -106,6 +105,7 @@ public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
|
||||
{
|
||||
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, l + 8);
|
||||
}
|
||||
((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setTexturePos(tex);
|
||||
}
|
||||
else if (l >= 0 && (l == 0 || blockBlocksFlow(world, x, y - 1, z)))
|
||||
{
|
||||
@@ -119,24 +119,24 @@ public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
|
||||
return;
|
||||
if (aflag[0])
|
||||
{
|
||||
flowIntoBlock(world, x - 1, y, z, k1);
|
||||
flowIntoBlock(world, x - 1, y, z, k1, tex);
|
||||
}
|
||||
if (aflag[1])
|
||||
{
|
||||
flowIntoBlock(world, x + 1, y, z, k1);
|
||||
flowIntoBlock(world, x + 1, y, z, k1, tex);
|
||||
}
|
||||
if (aflag[2])
|
||||
{
|
||||
flowIntoBlock(world, x, y, z - 1, k1);
|
||||
flowIntoBlock(world, x, y, z - 1, k1, tex);
|
||||
}
|
||||
if (aflag[3])
|
||||
{
|
||||
flowIntoBlock(world, x, y, z + 1, k1);
|
||||
flowIntoBlock(world, x, y, z + 1, k1, tex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void flowIntoBlock (World world, int x, int y, int z, int meta)
|
||||
private void flowIntoBlock (World world, int x, int y, int z, int meta, int tex)
|
||||
{
|
||||
if (liquidCanDisplaceBlock(world, x, y, z))
|
||||
{
|
||||
@@ -146,6 +146,8 @@ public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
|
||||
Block.blocksList[bID].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
}
|
||||
world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta);
|
||||
|
||||
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,4 +308,22 @@ public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.liquidMetalStill.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata)
|
||||
{
|
||||
return new LiquidTextureLogic();
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,35 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStationary;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.liquids.ILiquid;
|
||||
import tinker.tconstruct.TConstruct;
|
||||
import tinker.tconstruct.TContent;
|
||||
import tinker.tconstruct.client.liquidrender.RenderLiquidMetal;
|
||||
import tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
|
||||
public abstract class LiquidMetalStill extends BlockStationary implements ILiquid
|
||||
public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
|
||||
{
|
||||
public LiquidMetalStill(int id)
|
||||
{
|
||||
super(id, Material.lava);
|
||||
super(id, TContent.liquidMetal);
|
||||
//this.setCreativeTab(TConstruct.blockTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return RenderLiquidMetal.liquidModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureFile()
|
||||
{
|
||||
return TContent.liquidTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
public abstract int flowingLiquidID();
|
||||
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.liquidMetalFlowing.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetaSensitive ()
|
||||
@@ -49,102 +43,168 @@ public abstract class LiquidMetalStill extends BlockStationary implements ILiqui
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
int var6 = par5Random.nextInt(3);
|
||||
int var7;
|
||||
int var8;
|
||||
|
||||
for (var7 = 0; var7 < var6; ++var7)
|
||||
{
|
||||
par2 += par5Random.nextInt(3) - 1;
|
||||
++par3;
|
||||
par4 += par5Random.nextInt(3) - 1;
|
||||
var8 = par1World.getBlockId(par2, par3, par4);
|
||||
|
||||
if (var8 == 0)
|
||||
{
|
||||
if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4))
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.fire.blockID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (Block.blocksList[var8].blockMaterial.blocksMovement())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (var6 == 0)
|
||||
{
|
||||
var7 = par2;
|
||||
var8 = par4;
|
||||
|
||||
for (int var9 = 0; var9 < 3; ++var9)
|
||||
{
|
||||
par2 = var7 + par5Random.nextInt(3) - 1;
|
||||
par4 = var8 + par5Random.nextInt(3) - 1;
|
||||
|
||||
if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4))
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3 + 1, par4, Block.fire.blockID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockReplaceable (World world, int i, int j, int k)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
this.tryToHarden(par1World, par2, par3, par4);
|
||||
|
||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
||||
{
|
||||
this.unsetStationary(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
private void tryToHarden(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
||||
{
|
||||
if (this.blockMaterial == Material.lava)
|
||||
{
|
||||
boolean var5 = false;
|
||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
||||
{
|
||||
this.unsetStationary(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
private void tryToHarden (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
||||
{
|
||||
if (this.blockMaterial == Material.lava)
|
||||
{
|
||||
boolean var5 = false;
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var5)
|
||||
{
|
||||
/*int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water)
|
||||
{
|
||||
var5 = true;
|
||||
}
|
||||
|
||||
if (var6 == 0)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
|
||||
}
|
||||
else if (var6 <= 4)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
|
||||
}*/
|
||||
if (var5)
|
||||
{
|
||||
/*int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
|
||||
this.triggerLavaMixEffects(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (var6 == 0)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
|
||||
}
|
||||
else if (var6 <= 4)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Creates fizzing sound and smoke. Used when lava flows over block or mixes with water.
|
||||
*/
|
||||
protected void triggerLavaMixEffects(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
this.triggerLavaMixEffects(par1World, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int var5 = 0; var5 < 8; ++var5)
|
||||
{
|
||||
par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
private void unsetStationary(World world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
world.editingBlocks = true;
|
||||
world.setBlockAndMetadata(x, y, z, flowingLiquidID(), meta);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate());
|
||||
world.editingBlocks = false;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public int tickRate()
|
||||
{
|
||||
return 18;
|
||||
}*/
|
||||
/**
|
||||
* Creates fizzing sound and smoke. Used when lava flows over block or mixes with water.
|
||||
*/
|
||||
protected void triggerLavaMixEffects (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
par1World.playSoundEffect((double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
|
||||
for (int var5 = 0; var5 < 8; ++var5)
|
||||
{
|
||||
par1World.spawnParticle("largesmoke", (double) par2 + Math.random(), (double) par3 + 1.2D, (double) par4 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
private void unsetStationary (World world, int x, int y, int z)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
|
||||
world.editingBlocks = true;
|
||||
world.setBlockAndMetadata(x, y, z, flowingLiquidID(), meta);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate());
|
||||
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
|
||||
world.editingBlocks = false;
|
||||
}
|
||||
|
||||
public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
return this.blockMaterial != Material.lava;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the block is flammable.
|
||||
*/
|
||||
private boolean isFlammable (World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.getBlockMaterial(par2, par3, par4).getCanBurn();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity (int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
return new LiquidTextureLogic();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ManyullynFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public ManyullynFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 44;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.manyullynStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ManyullynStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public ManyullynStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 44;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.manyullynFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ObsidianFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public ObsidianFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 67;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.obsidianStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class ObsidianStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public ObsidianStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 67;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.obsidianFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class SteelFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public SteelFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 70;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.steelStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class SteelStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public SteelStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 70;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.steelFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class TinFlowing extends LiquidMetalFlowing
|
||||
{
|
||||
|
||||
public TinFlowing(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 9;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int stillLiquidId ()
|
||||
{
|
||||
return TContent.tinStill.blockID;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tinker.tconstruct.blocks.liquids;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class TinStill extends LiquidMetalStill
|
||||
{
|
||||
|
||||
public TinStill(int id)
|
||||
{
|
||||
super(id);
|
||||
blockIndexInTexture = 9;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int flowingLiquidID ()
|
||||
{
|
||||
return TContent.tinFlowing.blockID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
package tinker.tconstruct.client;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tinker.tconstruct.blocks.liquids.LiquidMetalBase;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class FluidRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public static int fluidModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
//Inventory should be an item. renderer is not here!
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
return renderBlockFluids(renderer, world, block, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
return fluidModel;
|
||||
}
|
||||
|
||||
public boolean renderBlockFluids(RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int blockColor = block.colorMultiplier(world, x, y, z);
|
||||
float var7 = (float)(blockColor >> 16 & 255) / 255.0F;
|
||||
float var8 = (float)(blockColor >> 8 & 255) / 255.0F;
|
||||
float var9 = (float)(blockColor & 255) / 255.0F;
|
||||
boolean renderTop = block.shouldSideBeRendered(world, x, y + 1, z, 1);
|
||||
boolean renderBottom = block.shouldSideBeRendered(world, x, y - 1, z, 0);
|
||||
boolean[] var12 = new boolean[] {block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), block.shouldSideBeRendered(world, x + 1, y, z, 5)};
|
||||
|
||||
if (!renderTop && !renderBottom && !var12[0] && !var12[1] && !var12[2] && !var12[3])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean var13 = false;
|
||||
float var14 = 0.5F;
|
||||
float var15 = 1.0F;
|
||||
float var16 = 0.8F;
|
||||
float var17 = 0.6F;
|
||||
double var18 = 0.0D;
|
||||
double var20 = 1.0D;
|
||||
Material var22 = block.blockMaterial;
|
||||
//int var23 = world.getBlockMetadata(x, y, z);
|
||||
double var24 = (double)renderer.getFluidHeight(x, y, z, var22);
|
||||
double var26 = (double)renderer.getFluidHeight(x, y, z + 1, var22);
|
||||
double var28 = (double)renderer.getFluidHeight(x + 1, y, z + 1, var22);
|
||||
double var30 = (double)renderer.getFluidHeight(x + 1, y, z, var22);
|
||||
double var32 = 0.0010000000474974513D;
|
||||
int texturePos;
|
||||
int textureBase = block.getBlockTexture(world, x, y, z, 0);
|
||||
int var37;
|
||||
|
||||
if (renderer.renderAllFaces || renderTop)
|
||||
{
|
||||
var13 = true;
|
||||
texturePos = block.getBlockTextureFromSide(1) + textureBase;
|
||||
float var35 = (float)LiquidMetalBase.getFlowDirection(world, x, y, z, var22);
|
||||
|
||||
if (var35 > -999.0F)
|
||||
{
|
||||
texturePos = block.getBlockTextureFromSide(2) + textureBase;
|
||||
}
|
||||
|
||||
var24 -= var32;
|
||||
var26 -= var32;
|
||||
var28 -= var32;
|
||||
var30 -= var32;
|
||||
int var36 = (texturePos & 15) << 4;
|
||||
var37 = texturePos & 240;
|
||||
double var38 = ((double)var36 + 8.0D) / 256.0D;
|
||||
double var40 = ((double)var37 + 8.0D) / 256.0D;
|
||||
|
||||
if (var35 < -999.0F)
|
||||
{
|
||||
var35 = 0.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
var38 = (double)((float)(var36 + 16) / 256.0F);
|
||||
var40 = (double)((float)(var37 + 16) / 256.0F);
|
||||
}
|
||||
|
||||
double var42 = (double)(MathHelper.sin(var35) * 8.0F) / 256.0D;
|
||||
double var44 = (double)(MathHelper.cos(var35) * 8.0F) / 256.0D;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
float var46 = 1.0F;
|
||||
tessellator.setColorOpaque_F(var15 * var46 * var7, var15 * var46 * var8, var15 * var46 * var9);
|
||||
tessellator.addVertexWithUV((double)(x + 0), (double)y + var24, (double)(z + 0), var38 - var44 - var42, var40 - var44 + var42);
|
||||
tessellator.addVertexWithUV((double)(x + 0), (double)y + var26, (double)(z + 1), var38 - var44 + var42, var40 + var44 + var42);
|
||||
tessellator.addVertexWithUV((double)(x + 1), (double)y + var28, (double)(z + 1), var38 + var44 + var42, var40 + var44 - var42);
|
||||
tessellator.addVertexWithUV((double)(x + 1), (double)y + var30, (double)(z + 0), var38 + var44 - var42, var40 - var44 - var42);
|
||||
}
|
||||
|
||||
if (renderer.renderAllFaces || renderBottom)
|
||||
{
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z));
|
||||
float var65 = 1.0F;
|
||||
tessellator.setColorOpaque_F(var14 * var65, var14 * var65, var14 * var65);
|
||||
renderer.renderBottomFace(block, (double)x, (double)y + var32, (double)z, block.getBlockTextureFromSide(0));
|
||||
var13 = true;
|
||||
}
|
||||
|
||||
for (texturePos = 0; texturePos < 4; ++texturePos)
|
||||
{
|
||||
int var64 = x;
|
||||
var37 = z;
|
||||
|
||||
if (texturePos == 0)
|
||||
{
|
||||
var37 = z - 1;
|
||||
}
|
||||
|
||||
if (texturePos == 1)
|
||||
{
|
||||
++var37;
|
||||
}
|
||||
|
||||
if (texturePos == 2)
|
||||
{
|
||||
var64 = x - 1;
|
||||
}
|
||||
|
||||
if (texturePos == 3)
|
||||
{
|
||||
++var64;
|
||||
}
|
||||
|
||||
int var66 = block.getBlockTextureFromSide(texturePos + 2) + textureBase;
|
||||
int var39 = (var66 & 15) << 4;
|
||||
int var67 = var66 & 240;
|
||||
|
||||
if (renderer.renderAllFaces || var12[texturePos])
|
||||
{
|
||||
double var43;
|
||||
double var41;
|
||||
double var47;
|
||||
double var45;
|
||||
double var51;
|
||||
double var49;
|
||||
|
||||
if (texturePos == 0)
|
||||
{
|
||||
var41 = var24;
|
||||
var43 = var30;
|
||||
var45 = (double)x;
|
||||
var49 = (double)(x + 1);
|
||||
var47 = (double)z + var32;
|
||||
var51 = (double)z + var32;
|
||||
}
|
||||
else if (texturePos == 1)
|
||||
{
|
||||
var41 = var28;
|
||||
var43 = var26;
|
||||
var45 = (double)(x + 1);
|
||||
var49 = (double)x;
|
||||
var47 = (double)(z + 1) - var32;
|
||||
var51 = (double)(z + 1) - var32;
|
||||
}
|
||||
else if (texturePos == 2)
|
||||
{
|
||||
var41 = var26;
|
||||
var43 = var24;
|
||||
var45 = (double)x + var32;
|
||||
var49 = (double)x + var32;
|
||||
var47 = (double)(z + 1);
|
||||
var51 = (double)z;
|
||||
}
|
||||
else
|
||||
{
|
||||
var41 = var30;
|
||||
var43 = var28;
|
||||
var45 = (double)(x + 1) - var32;
|
||||
var49 = (double)(x + 1) - var32;
|
||||
var47 = (double)z;
|
||||
var51 = (double)(z + 1);
|
||||
}
|
||||
|
||||
var13 = true;
|
||||
double var53 = (double)((float)(var39 + 0) / 256.0F);
|
||||
double var55 = ((double)(var39 + 16) - 0.01D) / 256.0D;
|
||||
double var57 = ((double)var67 + (1.0D - var41) * 16.0D) / 256.0D;
|
||||
double var59 = ((double)var67 + (1.0D - var43) * 16.0D) / 256.0D;
|
||||
double var61 = ((double)(var67 + 16) - 0.01D) / 256.0D;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, var64, y, var37));
|
||||
float var63 = 1.0F;
|
||||
|
||||
if (texturePos < 2)
|
||||
{
|
||||
var63 *= var16;
|
||||
}
|
||||
else
|
||||
{
|
||||
var63 *= var17;
|
||||
}
|
||||
|
||||
tessellator.setColorOpaque_F(var15 * var63 * var7, var15 * var63 * var8, var15 * var63 * var9);
|
||||
tessellator.addVertexWithUV(var45, (double)y + var41, var47, var53, var57);
|
||||
tessellator.addVertexWithUV(var49, (double)y + var43, var51, var55, var59);
|
||||
tessellator.addVertexWithUV(var49, (double)(y + 0), var51, var55, var61);
|
||||
tessellator.addVertexWithUV(var45, (double)(y + 0), var47, var53, var61);
|
||||
}
|
||||
}
|
||||
|
||||
renderer.renderMinY = var18;
|
||||
renderer.renderMaxY = var20;
|
||||
return var13;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class TProxyClient extends TProxyCommon
|
||||
RenderingRegistry.registerBlockHandler(new SmelteryRender());
|
||||
RenderingRegistry.registerBlockHandler(new TankRender());
|
||||
RenderingRegistry.registerBlockHandler(new SearedRender());
|
||||
RenderingRegistry.registerBlockHandler(new RenderLiquidMetal());
|
||||
RenderingRegistry.registerBlockHandler(new FluidRender());
|
||||
//RenderingRegistry.registerBlockHandler(new AxleRender());
|
||||
|
||||
RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
|
||||
@@ -191,7 +191,7 @@ public class TProxyClient extends TProxyCommon
|
||||
LanguageRegistry.addName(TContent.mattock, "Mattock");
|
||||
//LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe");
|
||||
|
||||
LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
|
||||
/*LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
|
||||
LanguageRegistry.addName(TContent.ironStill, "Liquid Iron");
|
||||
LanguageRegistry.addName(TContent.goldFlowing, "Liquid Gold");
|
||||
LanguageRegistry.addName(TContent.goldStill, "Liquid Gold");
|
||||
@@ -217,7 +217,7 @@ public class TProxyClient extends TProxyCommon
|
||||
LanguageRegistry.addName(TContent.obsidianFlowing, "Liquid Obsidian");
|
||||
LanguageRegistry.addName(TContent.obsidianStill, "Liquid Obsidian");
|
||||
LanguageRegistry.addName(TContent.steelFlowing, "Liquid Steel");
|
||||
LanguageRegistry.addName(TContent.steelStill, "Liquid Steel");
|
||||
LanguageRegistry.addName(TContent.steelStill, "Liquid Steel");*/
|
||||
}
|
||||
|
||||
public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk" };
|
||||
|
||||
@@ -3,11 +3,14 @@ package tinker.tconstruct.client;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tinker.common.BlockSkinRenderHelper;
|
||||
import tinker.tconstruct.logic.LavaTankLogic;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@@ -46,12 +49,27 @@ public class TankRender implements ISimpleBlockRenderingHandler
|
||||
LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z);
|
||||
if (logic.getLiquidAmount() > 0)
|
||||
{
|
||||
Block liquidBlock = Block.blocksList[logic.liquid.itemID];
|
||||
LiquidStack liquid = logic.liquid;
|
||||
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount() / 4020f, 0.97);
|
||||
/*Block liquidBlock = Block.blocksList[logic.liquid.itemID];
|
||||
if (liquidBlock != null)
|
||||
{
|
||||
ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
|
||||
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount() / 4020f, 0.97);
|
||||
renderer.renderStandardBlock(liquidBlock, x, y, z);
|
||||
}*/
|
||||
if (liquid.itemID < 4096) //Block
|
||||
{
|
||||
Block liquidBlock = Block.blocksList[liquid.itemID];
|
||||
ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
|
||||
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, liquid.itemMeta, x, y, z, renderer, world);
|
||||
}
|
||||
else
|
||||
//Item
|
||||
{
|
||||
Item liquidItem = Item.itemsList[liquid.itemID];
|
||||
ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
|
||||
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(liquid.itemMeta), liquid.itemMeta, x, y, z, renderer, world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
package tinker.tconstruct.client.entityrender;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.common.IArmorModelProvider;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class PlayerArmorRender extends RenderPlayer
|
||||
{
|
||||
private ModelBiped modelBipedMain;
|
||||
private ModelBiped modelArmorChestplate;
|
||||
private ModelBiped modelArmor;
|
||||
public static String[] armorFilenamePrefix = new String[] {"cloth", "chain", "iron", "diamond", "gold"};
|
||||
public static float NAME_TAG_RANGE = 64.0f;
|
||||
public static float NAME_TAG_RANGE_SNEAK = 32.0f;
|
||||
|
||||
public PlayerArmorRender()
|
||||
{
|
||||
super();
|
||||
this.modelBipedMain = (ModelBiped)this.mainModel;
|
||||
this.modelArmorChestplate = new ModelBiped(1.0F);
|
||||
this.modelArmor = new ModelBiped(0.5F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the specified armor model as the player model. Args: player, armorSlot, partialTick
|
||||
*/
|
||||
protected int setArmorModel(EntityPlayer par1EntityPlayer, int slot, float par3)
|
||||
{
|
||||
ItemStack stack = par1EntityPlayer.inventory.armorItemInSlot(3 - slot);
|
||||
|
||||
if (stack != null)
|
||||
{
|
||||
Item armoritem = stack.getItem();
|
||||
|
||||
if (armoritem instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)armoritem;
|
||||
this.loadTexture(ForgeHooksClient.getArmorTexture(stack, "/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (slot == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped var7;
|
||||
if (armoritem instanceof IArmorModelProvider)
|
||||
{
|
||||
var7 = ((IArmorModelProvider) armoritem).provideArmorModel(slot);
|
||||
}
|
||||
else
|
||||
{
|
||||
var7 = slot == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
var7.bipedHead.showModel = slot == 0;
|
||||
var7.bipedHeadwear.showModel = slot == 0;
|
||||
var7.bipedBody.showModel = slot == 1 || slot == 2;
|
||||
var7.bipedRightArm.showModel = slot == 1;
|
||||
var7.bipedLeftArm.showModel = slot == 1;
|
||||
var7.bipedRightLeg.showModel = slot == 2 || slot == 3;
|
||||
var7.bipedLeftLeg.showModel = slot == 2 || slot == 3;
|
||||
}
|
||||
this.setRenderPassModel(var7);
|
||||
|
||||
if (var7 != null)
|
||||
{
|
||||
var7.onGround = this.mainModel.onGround;
|
||||
}
|
||||
|
||||
if (var7 != null)
|
||||
{
|
||||
var7.isRiding = this.mainModel.isRiding;
|
||||
}
|
||||
|
||||
if (var7 != null)
|
||||
{
|
||||
var7.isChild = this.mainModel.isChild;
|
||||
}
|
||||
|
||||
float var8 = 1.0F;
|
||||
|
||||
if (var6.getArmorMaterial() == EnumArmorMaterial.CLOTH)
|
||||
{
|
||||
int var9 = var6.getColor(stack);
|
||||
float var10 = (float)(var9 >> 16 & 255) / 255.0F;
|
||||
float var11 = (float)(var9 >> 8 & 255) / 255.0F;
|
||||
float var12 = (float)(var9 & 255) / 255.0F;
|
||||
GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12);
|
||||
|
||||
if (stack.isItemEnchanted())
|
||||
{
|
||||
return 31;
|
||||
}
|
||||
|
||||
return 16;
|
||||
}
|
||||
|
||||
GL11.glColor3f(var8, var8, var8);
|
||||
|
||||
if (stack.isItemEnchanted())
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAlBrassFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidAlBrassFX()
|
||||
{
|
||||
super(200, 255, 165, 255, 20, 100, TContent.alBrassStill.blockIndexInTexture, TContent.alBrassStill.getTextureFile());
|
||||
super(200, 255, 165, 255, 20, 100, 41, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAlBrassFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidAlBrassFlowFX()
|
||||
{
|
||||
super(200, 255, 165, 255, 20, 100, TContent.alBrassFlowing.blockIndexInTexture+1, TContent.alBrassFlowing.getTextureFile());
|
||||
super(200, 255, 165, 255, 20, 100, 41+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAluminumFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidAluminumFX()
|
||||
{
|
||||
super(50, 255, 0, 150, 0, 120, TContent.aluminumStill.blockIndexInTexture, TContent.aluminumStill.getTextureFile());
|
||||
super(50, 255, 0, 150, 0, 120, 12, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAluminumFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidAluminumFlowFX()
|
||||
{
|
||||
super(50, 255, 0, 150, 0, 120, TContent.aluminumFlowing.blockIndexInTexture+1, TContent.aluminumFlowing.getTextureFile());
|
||||
super(50, 255, 0, 150, 0, 120, 12+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAlumiteFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidAlumiteFX()
|
||||
{
|
||||
super(0, 255, 0, 200, 0, 255, TContent.alumiteStill.blockIndexInTexture, TContent.alumiteStill.getTextureFile());
|
||||
super(0, 255, 0, 200, 0, 255, 64, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidAlumiteFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidAlumiteFlowFX()
|
||||
{
|
||||
super(0, 255, 0, 200, 0, 255, TContent.alumiteFlowing.blockIndexInTexture+1, TContent.alumiteFlowing.getTextureFile());
|
||||
super(0, 255, 0, 200, 0, 255, 64+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidArditeFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidArditeFX()
|
||||
{
|
||||
super(10, 250, 10, 150, 10, 50, TContent.arditeStill.blockIndexInTexture, TContent.arditeStill.getTextureFile());
|
||||
super(10, 250, 10, 150, 10, 50, 35, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidArditeFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidArditeFlowFX()
|
||||
{
|
||||
super(10, 250, 10, 150, 10, 50, TContent.arditeFlowing.blockIndexInTexture+1, TContent.arditeFlowing.getTextureFile());
|
||||
super(10, 250, 10, 150, 10, 50, 35+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidBronzeFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidBronzeFX()
|
||||
{
|
||||
super(0, 180, 0, 140, 0, 50, TContent.bronzeStill.blockIndexInTexture, TContent.arditeStill.getTextureFile());
|
||||
super(0, 180, 0, 140, 0, 50, 38, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidBronzeFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidBronzeFlowFX()
|
||||
{
|
||||
super(0, 180, 0, 140, 0, 50, TContent.bronzeFlowing.blockIndexInTexture+1, TContent.arditeFlowing.getTextureFile());
|
||||
super(0, 180, 0, 140, 0, 50, 38+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidCobaltFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidCobaltFX()
|
||||
{
|
||||
super(0, 30, 30, 100, 100, 250, TContent.cobaltStill.blockIndexInTexture, TContent.cobaltStill.getTextureFile());
|
||||
super(0, 30, 30, 100, 100, 250, 32, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidCobaltFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidCobaltFlowFX()
|
||||
{
|
||||
super(0, 30, 30, 100, 100, 250, TContent.cobaltFlowing.blockIndexInTexture+1, TContent.cobaltFlowing.getTextureFile());
|
||||
super(0, 30, 30, 100, 100, 250, 32+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidCopperFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidCopperFX()
|
||||
{
|
||||
super(220, 255, 130, 220, 0, 120, TContent.copperStill.blockIndexInTexture, TContent.copperStill.getTextureFile());
|
||||
super(220, 255, 130, 220, 0, 120, 6, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidCopperFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidCopperFlowFX()
|
||||
{
|
||||
super(220, 255, 130, 220, 0, 120, TContent.copperFlowing.blockIndexInTexture+1, TContent.copperFlowing.getTextureFile());
|
||||
super(220, 255, 130, 220, 0, 120, 6+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidGoldFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidGoldFX()
|
||||
{
|
||||
super(180, 255, 180, 255, 10, 40, TContent.goldStill.blockIndexInTexture, TContent.goldStill.getTextureFile());
|
||||
super(180, 255, 180, 255, 10, 40, 3, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidGoldFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidGoldFlowFX()
|
||||
{
|
||||
super(180, 255, 180, 255, 10, 40, TContent.goldFlowing.blockIndexInTexture+1, TContent.goldFlowing.getTextureFile());
|
||||
super(180, 255, 180, 255, 10, 40, 3+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidIronFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidIronFX()
|
||||
{
|
||||
super(10, 250, 10, 100, 10, 50, TContent.ironStill.blockIndexInTexture, TContent.ironStill.getTextureFile());
|
||||
super(10, 250, 10, 100, 10, 50, 0, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidIronFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidIronFlowFX()
|
||||
{
|
||||
super(10, 250, 10, 100, 10, 50, TContent.ironFlowing.blockIndexInTexture+1, TContent.ironFlowing.getTextureFile());
|
||||
super(10, 250, 10, 100, 10, 50, 0+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidManyullynFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidManyullynFX()
|
||||
{
|
||||
super(50, 200, 0, 40, 50, 200, TContent.manyullynStill.blockIndexInTexture, TContent.manyullynStill.getTextureFile());
|
||||
super(50, 200, 0, 40, 50, 200, 44, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidManyullynFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidManyullynFlowFX()
|
||||
{
|
||||
super(50, 200, 0, 40, 50, 200, TContent.manyullynFlowing.blockIndexInTexture+1, TContent.manyullynFlowing.getTextureFile());
|
||||
super(50, 200, 0, 40, 50, 200, 44+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidObsidianFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidObsidianFX()
|
||||
{
|
||||
super(0, 120, 0, 40, 0, 120, TContent.obsidianStill.blockIndexInTexture, TContent.obsidianStill.getTextureFile());
|
||||
super(0, 120, 0, 40, 0, 120, 67, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidObsidianFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidObsidianFlowFX()
|
||||
{
|
||||
super(0, 120, 0, 40, 0, 120, TContent.obsidianFlowing.blockIndexInTexture+1, TContent.obsidianFlowing.getTextureFile());
|
||||
super(0, 120, 0, 40, 0, 120, 67+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidSteelFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidSteelFX()
|
||||
{
|
||||
super(30, 150, 30, 150, 30, 150, TContent.steelStill.blockIndexInTexture, TContent.steelStill.getTextureFile());
|
||||
super(30, 150, 30, 150, 30, 150, 70, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidSteelFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidSteelFlowFX()
|
||||
{
|
||||
super(30, 150, 30, 150, 30, 150, TContent.steelFlowing.blockIndexInTexture+1, TContent.steelFlowing.getTextureFile());
|
||||
super(30, 150, 30, 150, 30, 150, 70+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidTinFX extends TextureLiquidStillFX
|
||||
{
|
||||
public LiquidTinFX()
|
||||
{
|
||||
super(150, 250, 150, 250, 150, 250, TContent.tinStill.blockIndexInTexture, TContent.tinStill.getTextureFile());
|
||||
super(150, 250, 150, 250, 150, 250, 9, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ public class LiquidTinFlowFX extends TextureLiquidFlowingFX
|
||||
{
|
||||
public LiquidTinFlowFX()
|
||||
{
|
||||
super(150, 250, 150, 250, 150, 250, TContent.tinFlowing.blockIndexInTexture+1, TContent.tinFlowing.getTextureFile());
|
||||
super(150, 250, 150, 250, 150, 250, 9+1, TContent.liquidTexture);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package tinker.tconstruct.client.liquidrender;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFluid;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class RenderLiquidMetal implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public static int liquidModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
//You shouldn't have this
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
renderer.renderBlockFluids(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
return liquidModel;
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,7 @@ package tinker.tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import tinker.tconstruct.TContent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
@@ -17,9 +10,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import tinker.tconstruct.TContent;
|
||||
import tinker.tconstruct.logic.LiquidTextureLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FilledBucket extends ItemBucket
|
||||
{
|
||||
@@ -136,7 +130,9 @@ public class FilledBucket extends ItemBucket
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockAndMetadataWithNotify(clickX, clickY, clickZ, getSourceBlock(meta), 0);
|
||||
world.setBlockWithNotify(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID);
|
||||
LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(clickX, clickY, clickZ);
|
||||
logic.setTexturePos(meta);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -146,7 +142,7 @@ public class FilledBucket extends ItemBucket
|
||||
{
|
||||
switch(meta)
|
||||
{
|
||||
case 0: return TContent.ironStill.blockID;
|
||||
/*case 0: return TContent.ironStill.blockID;
|
||||
case 1: return TContent.goldStill.blockID;
|
||||
case 2: return TContent.copperStill.blockID;
|
||||
case 3: return TContent.tinStill.blockID;
|
||||
@@ -158,7 +154,7 @@ public class FilledBucket extends ItemBucket
|
||||
case 9: return TContent.manyullynStill.blockID;
|
||||
case 10: return TContent.alumiteStill.blockID;
|
||||
case 11: return TContent.obsidianStill.blockID;
|
||||
case 12: return TContent.steelStill.blockID;
|
||||
case 12: return TContent.steelStill.blockID;*/
|
||||
//case 13: return TContent.ironStill.blockID;
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package tinker.tconstruct.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LiquidItemBlock extends ItemBlock
|
||||
{
|
||||
public static final String blockType[] =
|
||||
{ "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "Brass", "Manyullyn", "Alumite", "Obsidian", "Steel" };
|
||||
|
||||
public LiquidItemBlock(int id)
|
||||
{
|
||||
super(id);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public int getMetadata(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
public String getItemNameIS(ItemStack itemstack)
|
||||
{
|
||||
return (new StringBuilder()).append("LiquidMetal.").append(blockType[itemstack.getItemDamage()]).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package tinker.tconstruct.items;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.item.EnumArmorMaterial;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.IArmorModelProvider;
|
||||
import net.minecraftforge.common.IArmorTextureProvider;
|
||||
|
||||
public class TArmor extends ItemArmor
|
||||
implements IArmorTextureProvider, IArmorModelProvider
|
||||
{
|
||||
private ModelBiped modelArmorChestplate;
|
||||
public TArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
|
||||
{
|
||||
super(par1, par2EnumArmorMaterial, par3, par4);
|
||||
this.modelArmorChestplate = new ModelBiped(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTextureFile (ItemStack itemstack)
|
||||
{
|
||||
return "/tinkertextures/armor/wood_1.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelBiped provideArmorModel (int armorSlot)
|
||||
{
|
||||
/*modelArmorChestplate.bipedHead.showModel = armorSlot == 0;
|
||||
modelArmorChestplate.bipedHeadwear.showModel = armorSlot == 0;
|
||||
modelArmorChestplate.bipedBody.showModel = armorSlot == 1 || armorSlot == 2;
|
||||
modelArmorChestplate.bipedRightArm.showModel = armorSlot == 1;
|
||||
modelArmorChestplate.bipedLeftArm.showModel = armorSlot == 1;
|
||||
modelArmorChestplate.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
|
||||
modelArmorChestplate.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;*/
|
||||
return modelArmorChestplate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package tinker.tconstruct.logic;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import tinker.tconstruct.TContent;
|
||||
|
||||
public class LiquidTextureLogic extends TileEntity
|
||||
{
|
||||
int texturePos;
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setTexturePos (int tex)
|
||||
{
|
||||
texturePos = tex;
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public int getTexturePos ()
|
||||
{
|
||||
int tex = (texturePos % 5) * 3;
|
||||
tex += (texturePos / 5) * 32;
|
||||
return tex;
|
||||
}
|
||||
|
||||
public int getLiquidType ()
|
||||
{
|
||||
return texturePos;
|
||||
}
|
||||
|
||||
public void readFromNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.readFromNBT(tags);
|
||||
texturePos = tags.getInteger("Texture");
|
||||
}
|
||||
|
||||
public void writeToNBT (NBTTagCompound tags)
|
||||
{
|
||||
super.writeToNBT(tags);
|
||||
tags.setInteger("Texture", texturePos);
|
||||
}
|
||||
|
||||
/*public boolean shouldRefresh (int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z)
|
||||
{
|
||||
if (newID == TContent.metalFlowing.blockID || newID == TContent.metalStill.blockID)
|
||||
{
|
||||
System.out.println("Not refreshing");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket ()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
readFromNBT(packet.customParam1);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user