[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 18:04:28 -08:00
1 parent 83698cb73c
commit 84c2239244
561 files changed
+8872 -9300

No files matched your search

@@ -1,6 +1,7 @@
package tconstruct.world;
import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
@@ -11,6 +12,7 @@ import net.minecraft.util.*;
import net.minecraft.world.*;
public class MiningExplosion extends Explosion {
World world;
private final Random random = new Random();
private final int field_77289_h = 16;
@@ -35,8 +37,7 @@ public class MiningExplosion extends Explosion {
for (i = 0; i < this.field_77289_h; ++i) {
for (j = 0; j < this.field_77289_h; ++j) {
for (k = 0; k < this.field_77289_h; ++k) {
if (i == 0
|| i == this.field_77289_h - 1
if (i == 0 || i == this.field_77289_h - 1
|| j == 0
|| j == this.field_77289_h - 1
|| k == 0
@@ -63,13 +64,19 @@ public class MiningExplosion extends Explosion {
float f3 = this.exploder != null
? this.exploder.func_145772_a(this, this.world, l, i1, j1, k1)
: k1.getExplosionResistance(
this.exploder, world, l, i1, j1, explosionX, explosionY, explosionZ);
this.exploder,
world,
l,
i1,
j1,
explosionX,
explosionY,
explosionZ);
f1 -= (f3 + 0.8F) * f2 * 0.25f;
}
if (f1 > 0.0F
&& (this.exploder == null
|| this.exploder.func_145774_a(this, this.world, l, i1, j1, k1, f1))) {
if (f1 > 0.0F && (this.exploder == null
|| this.exploder.func_145774_a(this, this.world, l, i1, j1, k1, f1))) {
hashset.add(new ChunkPosition(l, i1, j1));
}
@@ -90,13 +97,13 @@ public class MiningExplosion extends Explosion {
int l1 = MathHelper.floor_double(this.explosionY + (double) this.explosionSize + 1.0D);
int i2 = MathHelper.floor_double(this.explosionZ - (double) this.explosionSize - 1.0D);
int j2 = MathHelper.floor_double(this.explosionZ + (double) this.explosionSize + 1.0D);
List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(
this.exploder, AxisAlignedBB.getBoundingBox(i, k, i2, j, l1, j2));
List<Entity> list = this.world
.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox(i, k, i2, j, l1, j2));
Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ);
for (Entity entity : list) {
double d7 =
entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double) this.explosionSize;
double d7 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ)
/ (double) this.explosionSize;
if (d7 <= 1.0D) {
d0 = entity.posX - this.explosionX;
@@ -110,9 +117,9 @@ public class MiningExplosion extends Explosion {
d2 /= d8;
double d9 = this.world.getBlockDensity(vec3, entity.boundingBox);
double d10 = (1.0D - d7) * d9;
if (!(entity instanceof EntityItem))
entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float)
((int) ((d10 * d10 + d10) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
if (!(entity instanceof EntityItem)) entity.attackEntityFrom(
DamageSource.setExplosionSource(this),
(float) ((int) ((d10 * d10 + d10) / 2.0D * 8.0D * (double) this.explosionSize + 1.0D)));
double d11 = EnchantmentProtection.func_92092_a(entity, d10);
entity.motionX += d0 * d11;
entity.motionY += d1 * d11;
@@ -140,10 +147,16 @@ public class MiningExplosion extends Explosion {
if (this.explosionSize >= 2.0F && this.isSmoking) {
this.world.spawnParticle(
"hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
"hugeexplosion",
this.explosionX,
this.explosionY,
this.explosionZ,
1.0D,
0.0D,
0.0D);
} else {
this.world.spawnParticle(
"largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
this.world
.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D);
}
Iterator<ChunkPosition> iterator;
@@ -5,12 +5,13 @@ import net.minecraft.dispenser.*;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import tconstruct.tools.items.TitleIcon;
public class TDispenserBehaviorSpawnEgg extends BehaviorDefaultDispenseItem {
/**
* Dispense the specified stack, play the dispense sound and spawn
* particles.
* Dispense the specified stack, play the dispense sound and spawn particles.
*/
@Override
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
+269 -241
View File
@@ -1,12 +1,8 @@
package tconstruct.world;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
import mantle.pulsar.pulse.*;
import mantle.utils.RecipeRemover;
import net.minecraft.block.*;
import net.minecraft.block.Block.SoundType;
import net.minecraft.block.material.Material;
@@ -20,6 +16,7 @@ import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.*;
import net.minecraftforge.fluids.*;
import net.minecraftforge.oredict.*;
import tconstruct.TConstruct;
import tconstruct.armor.TinkerArmor;
import tconstruct.blocks.SlabBase;
@@ -41,10 +38,16 @@ import tconstruct.world.entity.*;
import tconstruct.world.gen.*;
import tconstruct.world.itemblocks.*;
import tconstruct.world.items.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(TConstruct.modID)
@Pulse(id = "Tinkers' World", description = "Ores, slime islands, essence berries, and the like.", forced = true)
public class TinkerWorld {
@Instance("TinkerWorld")
public static TinkerWorld instance;
@@ -109,9 +112,7 @@ public class TinkerWorld {
TinkerWorld.barricadeSpruce = new BarricadeBlock(Blocks.log, 1).setBlockName("trap.barricade.spruce");
TinkerWorld.barricadeBirch = new BarricadeBlock(Blocks.log, 2).setBlockName("trap.barricade.birch");
TinkerWorld.barricadeJungle = new BarricadeBlock(Blocks.log, 3).setBlockName("trap.barricade.jungle");
TinkerWorld.slimeExplosive = new SlimeExplosive()
.setHardness(0.0F)
.setStepSound(Block.soundTypeGrass)
TinkerWorld.slimeExplosive = new SlimeExplosive().setHardness(0.0F).setStepSound(Block.soundTypeGrass)
.setBlockName("explosive.slime");
// Slime
@@ -121,41 +122,28 @@ public class TinkerWorld {
if (!FluidRegistry.registerFluid(TinkerWorld.blueSlimeFluid))
TinkerWorld.blueSlimeFluid = FluidRegistry.getFluid("slime.blue");
TinkerWorld.slimePool = new SlimeFluid(TinkerWorld.blueSlimeFluid, Material.water)
.setCreativeTab(TConstructRegistry.blockTab)
.setStepSound(TinkerWorld.slimeStep)
.setCreativeTab(TConstructRegistry.blockTab).setStepSound(TinkerWorld.slimeStep)
.setBlockName("liquid.slime");
GameRegistry.registerBlock(TinkerWorld.slimePool, "liquid.slime");
TinkerWorld.blueSlimeFluid.setBlock(TinkerWorld.slimePool);
// Slime Islands
TinkerWorld.slimeGel = new SlimeGel()
.setStepSound(TinkerWorld.slimeStep)
.setLightOpacity(0)
TinkerWorld.slimeGel = new SlimeGel().setStepSound(TinkerWorld.slimeStep).setLightOpacity(0)
.setBlockName("slime.gel");
TinkerWorld.slimeGel.setHarvestLevel("axe", 0, 1);
TinkerWorld.slimeGrass = new SlimeGrass()
.setStepSound(Block.soundTypeGrass)
.setLightOpacity(0)
TinkerWorld.slimeGrass = new SlimeGrass().setStepSound(Block.soundTypeGrass).setLightOpacity(0)
.setBlockName("slime.grass");
TinkerWorld.slimeTallGrass =
new SlimeTallGrass().setStepSound(Block.soundTypeGrass).setBlockName("slime.grass.tall");
TinkerWorld.slimeLeaves = (SlimeLeaves) new SlimeLeaves()
.setStepSound(TinkerWorld.slimeStep)
.setLightOpacity(0)
TinkerWorld.slimeTallGrass = new SlimeTallGrass().setStepSound(Block.soundTypeGrass)
.setBlockName("slime.grass.tall");
TinkerWorld.slimeLeaves = (SlimeLeaves) new SlimeLeaves().setStepSound(TinkerWorld.slimeStep).setLightOpacity(0)
.setBlockName("slime.leaves");
TinkerWorld.slimeSapling = (SlimeSapling)
new SlimeSapling().setStepSound(TinkerWorld.slimeStep).setBlockName("slime.sapling");
TinkerWorld.slimeChannel = new ConveyorBase(Material.water, "greencurrent")
.setHardness(0.3f)
.setStepSound(TinkerWorld.slimeStep)
.setBlockName("slime.channel");
TinkerWorld.bloodChannel = new ConveyorBase(Material.water, "liquid_cow")
.setHardness(0.3f)
.setStepSound(TinkerWorld.slimeStep)
.setBlockName("blood.channel");
TinkerWorld.slimePad = new SlimePad(Material.cloth)
.setStepSound(TinkerWorld.slimeStep)
.setHardness(0.3f)
TinkerWorld.slimeSapling = (SlimeSapling) new SlimeSapling().setStepSound(TinkerWorld.slimeStep)
.setBlockName("slime.sapling");
TinkerWorld.slimeChannel = new ConveyorBase(Material.water, "greencurrent").setHardness(0.3f)
.setStepSound(TinkerWorld.slimeStep).setBlockName("slime.channel");
TinkerWorld.bloodChannel = new ConveyorBase(Material.water, "liquid_cow").setHardness(0.3f)
.setStepSound(TinkerWorld.slimeStep).setBlockName("blood.channel");
TinkerWorld.slimePad = new SlimePad(Material.cloth).setStepSound(TinkerWorld.slimeStep).setHardness(0.3f)
.setBlockName("slime.pad");
// Decoration
@@ -166,29 +154,23 @@ public class TinkerWorld {
TinkerTools.multiBrickMetal = new MultiBrickMetal().setBlockName("Decoration.BrickMetal");
// Ores
String[] berryOres = new String[] {
"berry_iron",
"berry_gold",
"berry_copper",
"berry_tin",
"berry_iron_ripe",
"berry_gold_ripe",
"berry_copper_ripe",
"berry_tin_ripe"
};
TinkerWorld.oreBerry = (OreberryBush)
new OreberryBush(berryOres, 0, 4, new String[] {"oreIron", "oreGold", "oreCopper", "oreTin"})
.setBlockName("ore.berries.one");
String[] berryOresTwo = new String[] {
"berry_aluminum", "berry_essence", "", "", "berry_aluminum_ripe", "berry_essence_ripe", "", ""
};
TinkerWorld.oreBerrySecond =
(OreberryBush) new OreberryBushEssence(berryOresTwo, 4, 2, new String[] {"oreAluminum", "oreSilver"})
.setBlockName("ore.berries.two");
String[] berryOres = new String[] { "berry_iron", "berry_gold", "berry_copper", "berry_tin", "berry_iron_ripe",
"berry_gold_ripe", "berry_copper_ripe", "berry_tin_ripe" };
TinkerWorld.oreBerry = (OreberryBush) new OreberryBush(
berryOres,
0,
4,
new String[] { "oreIron", "oreGold", "oreCopper", "oreTin" }).setBlockName("ore.berries.one");
String[] berryOresTwo = new String[] { "berry_aluminum", "berry_essence", "", "", "berry_aluminum_ripe",
"berry_essence_ripe", "", "" };
TinkerWorld.oreBerrySecond = (OreberryBush) new OreberryBushEssence(
berryOresTwo,
4,
2,
new String[] { "oreAluminum", "oreSilver" }).setBlockName("ore.berries.two");
String[] oreTypes = new String[] {
"nether_slag", "nether_cobalt", "nether_ardite", "ore_copper", "ore_tin", "ore_aluminum", "ore_slag"
};
String[] oreTypes = new String[] { "nether_slag", "nether_cobalt", "nether_ardite", "ore_copper", "ore_tin",
"ore_aluminum", "ore_slag" };
TinkerWorld.oreSlag = new MetalOre(Material.rock, 10.0F, oreTypes).setBlockName("tconstruct.stoneore");
TinkerWorld.oreSlag.setHarvestLevel("pickaxe", 4, 1);
TinkerWorld.oreSlag.setHarvestLevel("pickaxe", 4, 2);
@@ -204,10 +186,8 @@ public class TinkerWorld {
TinkerWorld.oreGravel.setHarvestLevel("shovel", 1, 4);
TinkerWorld.oreGravel.setHarvestLevel("shovel", 4, 5);
// Rail
TinkerWorld.woodenRail = new WoodRail()
.setStepSound(Block.soundTypeWood)
.setCreativeTab(TConstructRegistry.blockTab)
.setBlockName("rail.wood");
TinkerWorld.woodenRail = new WoodRail().setStepSound(Block.soundTypeWood)
.setCreativeTab(TConstructRegistry.blockTab).setBlockName("rail.wood");
GameRegistry.registerBlock(TinkerWorld.meatBlock, HamboneItemBlock.class, "MeatBlock");
OreDictionary.registerOre("hambone", new ItemStack(TinkerWorld.meatBlock));
@@ -243,10 +223,10 @@ public class TinkerWorld {
GameRegistry.registerBlock(TinkerWorld.stoneTorch, "decoration.stonetorch");
GameRegistry.registerBlock(TinkerWorld.stoneLadder, "decoration.stoneladder");
GameRegistry.registerBlock(TinkerTools.multiBrick, MultiBrickItem.class, "decoration.multibrick");
GameRegistry.registerBlock(
TinkerTools.multiBrickFancy, MultiBrickFancyItem.class, "decoration.multibrickfancy");
GameRegistry.registerBlock(
TinkerTools.multiBrickMetal, MultiBrickMetalItem.class, "decoration.multibrickmetal");
GameRegistry
.registerBlock(TinkerTools.multiBrickFancy, MultiBrickFancyItem.class, "decoration.multibrickfancy");
GameRegistry
.registerBlock(TinkerTools.multiBrickMetal, MultiBrickMetalItem.class, "decoration.multibrickmetal");
// Ores
GameRegistry.registerBlock(TinkerWorld.oreBerry, OreberryBushItem.class, "ore.berries.one");
@@ -258,9 +238,7 @@ public class TinkerWorld {
GameRegistry.registerBlock(TinkerWorld.woodenRail, "rail.wood");
// Items
goldHead = new GoldenHead(4, 1.2F, false)
.setAlwaysEdible()
.setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F)
goldHead = new GoldenHead(4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F)
.setUnlocalizedName("goldenhead");
GameRegistry.registerItem(goldHead, "goldHead");
@@ -268,11 +246,11 @@ public class TinkerWorld {
TinkerWorld.oreBerries = new OreBerries().setUnlocalizedName("oreberry");
GameRegistry.registerItem(TinkerWorld.strangeFood, "strangeFood");
GameRegistry.registerItem(TinkerWorld.oreBerries, "oreBerries");
String[] oreberries = {"Iron", "Gold", "Copper", "Tin", "Aluminum", "Essence"};
String[] oreberries = { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Essence" };
for (int i = 0; i < oreberries.length; i++) {
TConstructRegistry.addItemStackToDirectory(
"oreberry" + oreberries[i], new ItemStack(TinkerWorld.oreBerries, 1, i));
TConstructRegistry
.addItemStackToDirectory("oreberry" + oreberries[i], new ItemStack(TinkerWorld.oreBerries, 1, i));
}
TConstructRegistry.addItemStackToDirectory("blueSlimeFood", new ItemStack(TinkerWorld.strangeFood, 1, 0));
@@ -378,8 +356,8 @@ public class TinkerWorld {
}
private void craftingTableRecipes() {
String[] patBlock = {"###", "###", "###"};
String[] patSurround = {"###", "#m#", "###"};
String[] patBlock = { "###", "###", "###" };
String[] patSurround = { "###", "#m#", "###" };
// Metal conversion Recipes
GameRegistry.addRecipe(
@@ -492,8 +470,8 @@ public class TinkerWorld {
'm',
new ItemStack(TinkerWorld.metalBlock, 1, 9)); // Steel
GameRegistry.addRecipe(
new ItemStack(Items.iron_ingot), patBlock, '#', new ItemStack(TinkerTools.materials, 1, 19)); // Iron
GameRegistry
.addRecipe(new ItemStack(Items.iron_ingot), patBlock, '#', new ItemStack(TinkerTools.materials, 1, 19)); // Iron
GameRegistry.addRecipe(
new ItemStack(TinkerTools.materials, 1, 9),
patBlock,
@@ -550,8 +528,7 @@ public class TinkerWorld {
'#',
new ItemStack(TinkerTools.materials, 1, 33)); // Steel
GameRegistry.addRecipe(
new ItemStack(TinkerTools.materials, 9, 19), "m", 'm', new ItemStack(Items.iron_ingot)); // Iron
GameRegistry.addRecipe(new ItemStack(TinkerTools.materials, 9, 19), "m", 'm', new ItemStack(Items.iron_ingot)); // Iron
GameRegistry.addRecipe(
new ItemStack(TinkerTools.materials, 9, 20),
"m",
@@ -610,34 +587,20 @@ public class TinkerWorld {
'm',
new ItemStack(TinkerTools.materials, 1, 16)); // Steel
String[] dyeTypes = {
"dyeBlack",
"dyeRed",
"dyeGreen",
"dyeBrown",
"dyeBlue",
"dyePurple",
"dyeCyan",
"dyeLightGray",
"dyeGray",
"dyePink",
"dyeLime",
"dyeYellow",
"dyeLightBlue",
"dyeMagenta",
"dyeOrange",
"dyeWhite"
};
String[] dyeTypes = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan",
"dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange",
"dyeWhite" };
String color;
for (int i = 0; i < 16; i++) {
color = dyeTypes[15 - i];
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(Blocks.wool, 8, i),
patSurround,
'm',
color,
'#',
new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(Blocks.wool, 8, i),
patSurround,
'm',
color,
'#',
new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)));
}
// Jack o'Latern Recipe - Stone Torch
@@ -650,43 +613,72 @@ public class TinkerWorld {
's',
new ItemStack(TinkerWorld.stoneTorch));
// Stone Torch Recipe
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(TinkerWorld.stoneTorch, 4),
"p",
"w",
'p',
new ItemStack(Items.coal, 1, Short.MAX_VALUE),
'w',
"rodStone"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerWorld.stoneTorch, 4),
"p",
"w",
'p',
new ItemStack(Items.coal, 1, Short.MAX_VALUE),
'w',
"rodStone"));
// Stone Ladder Recipe
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(TinkerWorld.stoneLadder, 3), "w w", "www", "w w", 'w', "rodStone"));
// Wooden Rail Recipe
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(TinkerWorld.woodenRail, 4, 0), "b b", "bxb", "b b", 'b', "plankWood", 'x', "stickWood"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerWorld.woodenRail, 4, 0),
"b b",
"bxb",
"b b",
'b',
"plankWood",
'x',
"stickWood"));
// Stonesticks Recipes
GameRegistry.addRecipe(new ItemStack(TinkerTools.toolRod, 4, 1), "c", "c", 'c', new ItemStack(Blocks.stone));
GameRegistry.addRecipe(
new ItemStack(TinkerTools.toolRod, 2, 1), "c", "c", 'c', new ItemStack(Blocks.cobblestone));
GameRegistry
.addRecipe(new ItemStack(TinkerTools.toolRod, 2, 1), "c", "c", 'c', new ItemStack(Blocks.cobblestone));
//
ItemStack aluBrass = new ItemStack(TinkerTools.materials, 1, 14);
// Clock Recipe - Vanilla alternative
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(Items.clock), " i ", "iri", " i ", 'i', aluBrass, 'r', "dustRedstone"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(Items.clock),
" i ",
"iri",
" i ",
'i',
aluBrass,
'r',
"dustRedstone"));
// Gold Pressure Plate - Vanilla alternative
// todo: temporarily disabled due to light weighted pressure plate being smeltable to gold
// GameRegistry.addRecipe(new ItemStack(Blocks.light_weighted_pressure_plate, 0, 1), "ii", 'i', aluBrass);
// Ultra hardcore recipes
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(goldHead), patSurround, '#', "ingotGold", 'm', new ItemStack(Items.skull, 1, 3)));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(goldHead),
patSurround,
'#',
"ingotGold",
'm',
new ItemStack(Items.skull, 1, 3)));
// Wool Slab Recipes
for (int sc = 0; sc <= 7; sc++) {
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.woolSlab1, 6, sc), "www", 'w', new ItemStack(Blocks.wool, 1, sc));
new ItemStack(TinkerWorld.woolSlab1, 6, sc),
"www",
'w',
new ItemStack(Blocks.wool, 1, sc));
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.woolSlab2, 6, sc), "www", 'w', new ItemStack(Blocks.wool, 1, sc + 8));
new ItemStack(TinkerWorld.woolSlab2, 6, sc),
"www",
'w',
new ItemStack(Blocks.wool, 1, sc + 8));
GameRegistry.addShapelessRecipe(
new ItemStack(Blocks.wool, 1, sc),
@@ -700,50 +692,78 @@ public class TinkerWorld {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.wool, 1, 0), "slabCloth", "slabCloth"));
// Trap Recipes
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.punji, 5, 0), "b b", " b ", "b b", 'b', new ItemStack(Items.reeds));
new ItemStack(TinkerWorld.punji, 5, 0),
"b b",
" b ",
"b b",
'b',
new ItemStack(Items.reeds));
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.barricadeSpruce, 1, 0), "b", "b", 'b', new ItemStack(Blocks.log, 1, 1));
new ItemStack(TinkerWorld.barricadeSpruce, 1, 0),
"b",
"b",
'b',
new ItemStack(Blocks.log, 1, 1));
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.barricadeBirch, 1, 0), "b", "b", 'b', new ItemStack(Blocks.log, 1, 2));
new ItemStack(TinkerWorld.barricadeBirch, 1, 0),
"b",
"b",
'b',
new ItemStack(Blocks.log, 1, 2));
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.barricadeJungle, 1, 0), "b", "b", 'b', new ItemStack(Blocks.log, 1, 3));
new ItemStack(TinkerWorld.barricadeJungle, 1, 0),
"b",
"b",
'b',
new ItemStack(Blocks.log, 1, 3));
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(TinkerWorld.barricadeOak, 1, 0), "b", "b", 'b', "logWood"));
// Slime Recipes
GameRegistry.addRecipe(new ItemStack(TinkerWorld.slimeGel, 1, 0), "##", "##", '#', TinkerWorld.strangeFood);
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.strangeFood, 4, 0), "#", '#', new ItemStack(TinkerWorld.slimeGel, 1, 0));
new ItemStack(TinkerWorld.strangeFood, 4, 0),
"#",
'#',
new ItemStack(TinkerWorld.slimeGel, 1, 0));
GameRegistry.addRecipe(new ItemStack(TinkerWorld.slimeGel, 1, 1), "##", "##", '#', Items.slime_ball);
GameRegistry.addRecipe(
new ItemStack(Items.slime_ball, 4, 0), "#", '#', new ItemStack(TinkerWorld.slimeGel, 1, 1));
GameRegistry
.addRecipe(new ItemStack(Items.slime_ball, 4, 0), "#", '#', new ItemStack(TinkerWorld.slimeGel, 1, 1));
// slimeExplosive
GameRegistry.addShapelessRecipe(new ItemStack(TinkerWorld.slimeExplosive, 1, 0), Items.slime_ball, Blocks.tnt);
GameRegistry.addShapelessRecipe(
new ItemStack(TinkerWorld.slimeExplosive, 1, 2), TinkerWorld.strangeFood, Blocks.tnt);
new ItemStack(TinkerWorld.slimeExplosive, 1, 2),
TinkerWorld.strangeFood,
Blocks.tnt);
GameRegistry.addRecipe(
new ShapelessOreRecipe(new ItemStack(TinkerWorld.slimeExplosive, 1, 0), "slimeball", Blocks.tnt));
GameRegistry.addRecipe(new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimeChannel, 1, 0),
new ItemStack(TinkerWorld.slimeGel, 1, Short.MAX_VALUE),
"dustRedstone"));
GameRegistry.addRecipe(new ShapelessOreRecipe(
new ItemStack(TinkerWorld.bloodChannel, 1, 0),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
"dustRedstone"));
GameRegistry.addRecipe(new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimeChannel, 1, 0),
"slimeball",
"slimeball",
"slimeball",
"slimeball",
"dustRedstone"));
GameRegistry.addRecipe(new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimePad, 1, 0), TinkerWorld.slimeChannel, "slimeball"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimeChannel, 1, 0),
new ItemStack(TinkerWorld.slimeGel, 1, Short.MAX_VALUE),
"dustRedstone"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerWorld.bloodChannel, 1, 0),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
new ItemStack(TinkerWorld.strangeFood, 1, 1),
"dustRedstone"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimeChannel, 1, 0),
"slimeball",
"slimeball",
"slimeball",
"slimeball",
"dustRedstone"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerWorld.slimePad, 1, 0),
TinkerWorld.slimeChannel,
"slimeball"));
GameRegistry.addRecipe(
new ItemStack(TinkerWorld.meatBlock),
@@ -757,63 +777,65 @@ public class TinkerWorld {
}
private void addRecipesForFurnace() {
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 3),
new ItemStack(TinkerTools.craftedSoil, 1, 4),
0.2f); // Concecrated
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 3),
new ItemStack(TinkerTools.craftedSoil, 1, 4),
0.2f); // Concecrated
// Soil
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 0),
new ItemStack(TinkerTools.materials, 1, 1),
2f); // Slime
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 1),
new ItemStack(TinkerTools.materials, 1, 2),
2f); // Seared brick item
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 2),
new ItemStack(TinkerTools.materials, 1, 17),
2f); // Blue Slime
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 6),
new ItemStack(TinkerTools.materials, 1, 37),
2f); // Nether seared
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 0),
new ItemStack(TinkerTools.materials, 1, 1),
2f); // Slime
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 1),
new ItemStack(TinkerTools.materials, 1, 2),
2f); // Seared brick item
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 2),
new ItemStack(TinkerTools.materials, 1, 17),
2f); // Blue Slime
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.craftedSoil, 1, 6),
new ItemStack(TinkerTools.materials, 1, 37),
2f); // Nether seared
// brick
// FurnaceRecipes.smelting().func_151394_a(new ItemStack(TRepo.oreSlag,
// 1, new ItemStack(TRepo.materials, 1, 3), 3f);
// FurnaceRecipes.smelting().func_151394_a(new ItemStack(TRepo.oreSlag,
// 2, new ItemStack(TRepo.materials, 1, 4), 3f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 3), new ItemStack(TinkerTools.materials, 1, 9), 0.5f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 4), new ItemStack(TinkerTools.materials, 1, 10), 0.5f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 5), new ItemStack(TinkerTools.materials, 1, 11), 0.5f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 3),
new ItemStack(TinkerTools.materials, 1, 9),
0.5f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 4),
new ItemStack(TinkerTools.materials, 1, 10),
0.5f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreSlag, 1, 5),
new ItemStack(TinkerTools.materials, 1, 11),
0.5f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 0), new ItemStack(TinkerTools.materials, 1, 19), 0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 0),
new ItemStack(TinkerTools.materials, 1, 19),
0.2f);
FurnaceRecipes.smelting()
.func_151394_a(new ItemStack(TinkerWorld.oreBerries, 1, 1), new ItemStack(Items.gold_nugget), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 2), new ItemStack(TinkerTools.materials, 1, 20), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 3), new ItemStack(TinkerTools.materials, 1, 21), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 4), new ItemStack(TinkerTools.materials, 1, 22), 0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 2),
new ItemStack(TinkerTools.materials, 1, 20),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 3),
new ItemStack(TinkerTools.materials, 1, 21),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreBerries, 1, 4),
new ItemStack(TinkerTools.materials, 1, 22),
0.2f);
// FurnaceRecipes.smelting().func_151394_a(new
// ItemStack(TRepo.oreBerries, 5, new ItemStack(TRepo.materials, 1, 23),
// 0.2f);
@@ -822,31 +844,39 @@ public class TinkerWorld {
.func_151394_a(new ItemStack(TinkerWorld.oreGravel, 1, 0), new ItemStack(Items.iron_ingot), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(new ItemStack(TinkerWorld.oreGravel, 1, 1), new ItemStack(Items.gold_ingot), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 2), new ItemStack(TinkerTools.materials, 1, 9), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 3), new ItemStack(TinkerTools.materials, 1, 10), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 4), new ItemStack(TinkerTools.materials, 1, 11), 0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 2),
new ItemStack(TinkerTools.materials, 1, 9),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 3),
new ItemStack(TinkerTools.materials, 1, 10),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerWorld.oreGravel, 1, 4),
new ItemStack(TinkerTools.materials, 1, 11),
0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.materials, 1, 38), new ItemStack(TinkerTools.materials, 1, 4), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.materials, 1, 39), new ItemStack(TinkerTools.materials, 1, 3), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.materials, 1, 40), new ItemStack(TinkerTools.materials, 1, 11), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.materials, 1, 41), new ItemStack(TinkerTools.materials, 1, 5), 0.2f);
FurnaceRecipes.smelting()
.func_151394_a(
new ItemStack(TinkerTools.materials, 1, 42), new ItemStack(TinkerTools.materials, 1, 14), 0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.materials, 1, 38),
new ItemStack(TinkerTools.materials, 1, 4),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.materials, 1, 39),
new ItemStack(TinkerTools.materials, 1, 3),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.materials, 1, 40),
new ItemStack(TinkerTools.materials, 1, 11),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.materials, 1, 41),
new ItemStack(TinkerTools.materials, 1, 5),
0.2f);
FurnaceRecipes.smelting().func_151394_a(
new ItemStack(TinkerTools.materials, 1, 42),
new ItemStack(TinkerTools.materials, 1, 14),
0.2f);
}
public void oreRegistry() {
@@ -924,10 +954,18 @@ public class TinkerWorld {
RecipeRemover.removeShapedRecipe(new ItemStack(Items.magma_cream));
RecipeRemover.removeShapedRecipe(new ItemStack(Items.lead));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Blocks.sticky_piston), "slimeball", Blocks.piston));
GameRegistry
.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.magma_cream), "slimeball", Items.blaze_powder));
GameRegistry.addRecipe(
new ShapelessOreRecipe(new ItemStack(Items.magma_cream), "slimeball", Items.blaze_powder));
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(Items.lead, 2), "ss ", "sS ", " s", 's', Items.string, 'S', "slimeball"));
new ShapedOreRecipe(
new ItemStack(Items.lead, 2),
"ss ",
"sS ",
" s",
's',
Items.string,
'S',
"slimeball"));
}
public static void ensureOreIsRegistered(String oreName, ItemStack is) {
@@ -947,28 +985,18 @@ public class TinkerWorld {
.addItem(new WeightedRandomChestContent(new ItemStack(TinkerArmor.heartCanister, 1, 1), 1, 1, 10));
TinkerWorld.tinkerHouseChest = new ChestGenHooks("TinkerHouse", new WeightedRandomChestContent[0], 3, 27);
TinkerWorld.tinkerHouseChest.addItem(
new WeightedRandomChestContent(new ItemStack(TinkerArmor.heartCanister, 1, 1), 1, 1, 1));
int[] validTypes = {0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 17};
Item[] partTypes = {
TinkerTools.pickaxeHead,
TinkerTools.shovelHead,
TinkerTools.hatchetHead,
TinkerTools.binding,
TinkerTools.swordBlade,
TinkerTools.wideGuard,
TinkerTools.handGuard,
TinkerTools.crossbar,
TinkerTools.knifeBlade,
TinkerTools.frypanHead,
TinkerTools.signHead,
TinkerTools.chiselHead
};
TinkerWorld.tinkerHouseChest
.addItem(new WeightedRandomChestContent(new ItemStack(TinkerArmor.heartCanister, 1, 1), 1, 1, 1));
int[] validTypes = { 0, 1, 2, 3, 4, 5, 6, 8, 9, 13, 14, 17 };
Item[] partTypes = { TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead,
TinkerTools.binding, TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard,
TinkerTools.crossbar, TinkerTools.knifeBlade, TinkerTools.frypanHead, TinkerTools.signHead,
TinkerTools.chiselHead };
for (Item partType : partTypes) {
for (int validType : validTypes) {
TinkerWorld.tinkerHouseChest.addItem(
new WeightedRandomChestContent(new ItemStack(partType, 1, validType), 1, 1, 15));
TinkerWorld.tinkerHouseChest
.addItem(new WeightedRandomChestContent(new ItemStack(partType, 1, validType), 1, 1, 15));
}
}
@@ -977,7 +1005,7 @@ public class TinkerWorld {
TinkerWorld.tinkerHousePatterns.addItem(
new WeightedRandomChestContent(new ItemStack(TinkerTools.woodPattern, 1, i + 1), 1, 3, 20));
}
TinkerWorld.tinkerHousePatterns.addItem(
new WeightedRandomChestContent(new ItemStack(TinkerTools.woodPattern, 1, 22), 1, 3, 40));
TinkerWorld.tinkerHousePatterns
.addItem(new WeightedRandomChestContent(new ItemStack(TinkerTools.woodPattern, 1, 22), 1, 3, 40));
}
}
@@ -1,6 +1,5 @@
package tconstruct.world;
import cpw.mods.fml.common.eventhandler.*;
import net.minecraft.entity.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
@@ -11,12 +10,15 @@ import net.minecraft.potion.*;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.player.BonemealEvent;
import tconstruct.TConstruct;
import tconstruct.tools.TinkerTools;
import tconstruct.util.ItemHelper;
import tconstruct.util.config.PHConstruct;
import cpw.mods.fml.common.eventhandler.*;
public class TinkerWorldEvents {
@SubscribeEvent
public void onLivingSpawn(LivingSpawnEvent.SpecialSpawn event) {
EntityLivingBase living = event.entityLiving;
@@ -27,7 +29,11 @@ public class TinkerWorldEvents {
else creeper.mountEntity(living);
EntityXPOrb orb = new EntityXPOrb(
living.worldObj, living.posX, living.posY, living.posZ, TConstruct.random.nextInt(20) + 20);
living.worldObj,
living.posX,
living.posY,
living.posZ,
TConstruct.random.nextInt(20) + 20);
orb.mountEntity(creeper);
}
}
@@ -45,8 +51,8 @@ public class TinkerWorldEvents {
public void bonemealEvent(BonemealEvent event) {
if (!event.world.isRemote) {
if (event.block == TinkerWorld.slimeSapling) {
if (TinkerWorld.slimeSapling.boneFertilize(
event.world, event.x, event.y, event.z, event.world.rand, event.entityPlayer))
if (TinkerWorld.slimeSapling
.boneFertilize(event.world, event.x, event.y, event.z, event.world.rand, event.entityPlayer))
event.setResult(Event.Result.ALLOW);
}
}
@@ -1,8 +1,7 @@
package tconstruct.world;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import mantle.lib.client.MantleClientRegistry;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelSlime;
@@ -10,12 +9,16 @@ import net.minecraft.client.particle.*;
import net.minecraft.init.*;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import tconstruct.mechworks.model.CartRender;
import tconstruct.tools.TinkerTools;
import tconstruct.world.entity.*;
import tconstruct.world.model.*;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
@Override
public void initialize() {
registerRenderer();
@@ -78,21 +81,31 @@ public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
// Traps
ItemStack reed = new ItemStack(Items.reeds);
MantleClientRegistry.registerManualLargeRecipe(
"punji", new ItemStack(TinkerWorld.punji, 5), reed, null, reed, null, reed, null, reed, null, reed);
MantleClientRegistry.registerManualSmallRecipe(
"barricade", new ItemStack(TinkerWorld.barricadeOak), null, log, null, log);
"punji",
new ItemStack(TinkerWorld.punji, 5),
reed,
null,
reed,
null,
reed,
null,
reed,
null,
reed);
MantleClientRegistry
.registerManualSmallRecipe("barricade", new ItemStack(TinkerWorld.barricadeOak), null, log, null, log);
}
Minecraft mc = Minecraft.getMinecraft();
@Override
public void spawnParticle(
String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) {
public void spawnParticle(String particle, double xPos, double yPos, double zPos, double velX, double velY,
double velZ) {
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
}
public EntityFX doSpawnParticle(
String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) {
public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10,
double par12) {
if (this.mc == null) this.mc = Minecraft.getMinecraft();
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) {
@@ -115,12 +128,26 @@ public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
case "largeexplode":
this.mc.effectRenderer.addEffect(
entityfx = new EntityLargeExplodeFX(
mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
mc.renderEngine,
mc.theWorld,
par2,
par4,
par6,
par8,
par10,
par12));
break;
case "fireworksSpark":
this.mc.effectRenderer.addEffect(
entityfx = new EntityFireworkSparkFX(
mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
mc.theWorld,
par2,
par4,
par6,
par8,
par10,
par12,
this.mc.effectRenderer));
break;
}
@@ -181,7 +208,13 @@ public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
break;
case "enchantmenttable":
entityfx = new EntityEnchantmentTableParticleFX(
mc.theWorld, par2, par4, par6, par8, par10, par12);
mc.theWorld,
par2,
par4,
par6,
par8,
par10,
par12);
break;
case "explode":
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
@@ -206,7 +239,13 @@ public class TinkerWorldProxyClient extends TinkerWorldProxyCommon {
break;
case "reddust":
entityfx = new EntityReddustFX(
mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12);
mc.theWorld,
par2,
par4,
par6,
(float) par8,
(float) par10,
(float) par12);
break;
case "snowballpoof":
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Items.snowball);
@@ -2,8 +2,8 @@ package tconstruct.world;
public class TinkerWorldProxyCommon {
public void spawnParticle(
String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) {}
public void spawnParticle(String particle, double xPos, double yPos, double zPos, double velX, double velY,
double velZ) {}
public void initialize() {}
}
@@ -1,7 +1,7 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import mantle.blocks.MantleBlock;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.*;
@@ -9,10 +9,13 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.world.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.world.model.SlimeChannelRender;
import cpw.mods.fml.relauncher.*;
public class ConveyorBase extends MantleBlock {
String texturename;
public ConveyorBase(Material material, String name) {
@@ -82,8 +85,7 @@ public class ConveyorBase extends MantleBlock {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
int face = MathHelper.floor_double((double) (entity.rotationYaw * 8.0F / 360.0F) + 0.5D)
+ (entity.isSneaking() ? 4 : 0)
& 7;
+ (entity.isSneaking() ? 4 : 0) & 7;
int meta = world.getBlockMetadata(x, y, z) & 8;
world.setBlockMetadataWithNotify(x, y, z, face | meta, 2);
}
@@ -119,7 +121,7 @@ public class ConveyorBase extends MantleBlock {
@Override
public void registerBlockIcons(IIconRegister iconRegister) {
String[] textureNames = new String[] {texturename, texturename + "_flow"};
String[] textureNames = new String[] { texturename, texturename + "_flow" };
this.icons = new IIcon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i) {
@@ -1,7 +1,7 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.*;
import net.minecraft.block.BlockSand;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -9,11 +9,14 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import tconstruct.library.TConstructRegistry;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.relauncher.*;
public class GravelOre extends BlockSand {
public String[] textureNames = new String[] {"iron", "gold", "copper", "tin", "aluminum", "cobalt"};
public String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
public IIcon[] icons;
public GravelOre() {
@@ -46,15 +49,17 @@ public class GravelOre extends BlockSand {
@Override
public int damageDropped(int meta) {
/*if (meta == 1)
return 0;*/
/*
* if (meta == 1) return 0;
*/
return meta;
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
/*if (par1 == 1)
return Item.goldNugget.itemID;*/
/*
* if (par1 == 1) return Item.goldNugget.itemID;
*/
return Item.getItemFromBlock(TinkerWorld.oreGravel);
}
@@ -1,18 +1,21 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.*;
import net.minecraft.block.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.*;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.*;
public class MeatBlock extends BlockWood {
public IIcon[] icons;
public String[] textureNames = new String[] {"ham_skin", "ham_bone"};
public String[] textureNames = new String[] { "ham_skin", "ham_bone" };
public MeatBlock() {
this.setHardness(1.0F);
@@ -60,8 +63,7 @@ public class MeatBlock extends BlockWood {
}
/**
* ejects contained items into the world, and notifies neighbours of an
* update, as appropriate
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
*/
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
byte b0 = 4;
@@ -83,12 +85,11 @@ public class MeatBlock extends BlockWood {
}
/**
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
* side, hitX, hitY, hitZ, block metadata
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
*/
@Override
public int onBlockPlaced(
World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) {
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7,
float par8, int par9) {
int j1 = par9 & 3;
byte b0 = 0;
@@ -110,8 +111,7 @@ public class MeatBlock extends BlockWood {
}
/**
* Determines the damage on the item the block drops. Used in cloth and
* wood.
* Determines the damage on the item the block drops. Used in cloth and wood.
*/
@Override
public int damageDropped(int par1) {
@@ -135,9 +135,8 @@ public class MeatBlock extends BlockWood {
}
/*
* public void onBlockHarvested (World world, int x, int y, int z, int meta,
* EntityPlayer player) { if (meta % 4 == 1) { if (world.difficultySetting >
* 2) world.createExplosion(null, x, y, z, 1.75f, false); else
* public void onBlockHarvested (World world, int x, int y, int z, int meta, EntityPlayer player) { if (meta % 4 ==
* 1) { if (world.difficultySetting > 2) world.createExplosion(null, x, y, z, 1.75f, false); else
* world.createExplosion(null, x, y, z, 2f, false); } }
*/
@@ -1,7 +1,7 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.*;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
@@ -15,12 +15,15 @@ import net.minecraft.util.*;
import net.minecraft.world.*;
import net.minecraftforge.common.*;
import net.minecraftforge.common.util.ForgeDirection;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.world.TinkerWorld;
import tconstruct.world.model.OreberryRender;
import cpw.mods.fml.relauncher.*;
public class OreberryBush extends BlockLeavesBase implements IPlantable {
Random random;
public IIcon[] fastIcons;
public IIcon[] fancyIcons;
@@ -104,7 +107,12 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable {
(double) z + 0.875D);
} else {
return AxisAlignedBB.getBoundingBox(
x + 0.0625, y, z + 0.0625, (double) x + 0.9375D, (double) y + 0.9375D, (double) z + 0.9375D);
x + 0.0625,
y,
z + 0.0625,
(double) x + 0.9375D,
(double) y + 0.9375D,
(double) z + 0.9375D);
}
}
@@ -167,8 +175,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable {
/* Right-click harvests berries */
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
return harvest(world, x, y, z, player);
}
@@ -179,7 +187,8 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable {
world.setBlock(x, y, z, this, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(
player, new ItemStack(TinkerWorld.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
player,
new ItemStack(TinkerWorld.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
}
return false;
@@ -231,10 +240,9 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable {
world.setBlock(x, y, z, this, meta + 4, 3);
}
}
/*else if (meta < 8)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
}*/
/*
* else if (meta < 8) { world.setBlock(x, y, z, blockID, meta + 4, 3); }
*/
}
}
@@ -1,10 +1,12 @@
package tconstruct.world.blocks;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public class OreberryBushEssence extends OreberryBush implements IPlantable {
public OreberryBushEssence(String[] textureNames, int meta, int sub, String[] oreTypes) {
super(textureNames, meta, sub, oreTypes);
}
@@ -27,8 +29,7 @@ public class OreberryBushEssence extends OreberryBush implements IPlantable {
}
}
/*
* else if (meta < 8) { world.setBlock(x, y, z, blockID, meta + 4,
* 3); }
* else if (meta < 8) { world.setBlock(x, y, z, blockID, meta + 4, 3); }
*/
}
}
@@ -37,8 +38,7 @@ public class OreberryBushEssence extends OreberryBush implements IPlantable {
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
return true;
/*
* if (world.getFullBlockLightValue(x, y, z) < 13) return
* super.canPlaceBlockAt(world, x, y, z); return false;
* if (world.getFullBlockLightValue(x, y, z) < 13) return super.canPlaceBlockAt(world, x, y, z); return false;
*/
}
}
@@ -1,8 +1,9 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -13,8 +14,10 @@ import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.*;
import tconstruct.blocks.TConstructBlock;
import tconstruct.mechworks.entity.item.ExplosivePrimed;
import cpw.mods.fml.relauncher.*;
public class SlimeExplosive extends TConstructBlock {
@@ -24,7 +27,7 @@ public class SlimeExplosive extends TConstructBlock {
static String[] getTextureNames() {
String[] names = new String[6];
String[] types = new String[] {"green", "blue"};
String[] types = new String[] { "green", "blue" };
for (int i = 0; i < 2; i++) {
names[i * 3 + 0] = "sdx_bottom_" + types[i];
names[i * 3 + 1] = "sdx_side_" + types[i];
@@ -83,12 +86,16 @@ public class SlimeExplosive extends TConstructBlock {
this.primeTnt(par1World, par2, par3, par4, par5, null);
}
public void primeTnt(
World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase) {
public void primeTnt(World par1World, int par2, int par3, int par4, int par5,
EntityLivingBase par6EntityLivingBase) {
if (!par1World.isRemote) {
if ((par5 % 2) == 1) {
ExplosivePrimed entitytntprimed = new ExplosivePrimed(
par1World, (float) par2 + 0.5F, (float) par3 + 0.5F, (float) par4 + 0.5F, par6EntityLivingBase);
par1World,
(float) par2 + 0.5F,
(float) par3 + 0.5F,
(float) par4 + 0.5F,
par6EntityLivingBase);
par1World.spawnEntityInWorld(entitytntprimed);
par1World.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
}
@@ -96,16 +103,8 @@ public class SlimeExplosive extends TConstructBlock {
}
@Override
public boolean onBlockActivated(
World par1World,
int par2,
int par3,
int par4,
EntityPlayer par5EntityPlayer,
int par6,
float par7,
float par8,
float par9) {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer,
int par6, float par7, float par8, float par9) {
if (par5EntityPlayer.getCurrentEquippedItem() != null
&& par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel) {
this.primeTnt(par1World, par2, par3, par4, 1, par5EntityPlayer);
@@ -1,7 +1,7 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import mantle.blocks.MantleBlock;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.*;
@@ -9,9 +9,11 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.world.World;
import tconstruct.library.TConstructRegistry;
import tconstruct.world.TinkerWorld;
import tconstruct.world.model.SlimePadRender;
import cpw.mods.fml.relauncher.*;
public class SlimePad extends MantleBlock {
@@ -88,8 +90,7 @@ public class SlimePad extends MantleBlock {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
int face = MathHelper.floor_double((double) (entity.rotationYaw * 8.0F / 360.0F) + 0.5D)
+ (entity.isSneaking() ? 4 : 0)
& 7;
+ (entity.isSneaking() ? 4 : 0) & 7;
int meta = world.getBlockMetadata(x, y, z) & 8;
world.setBlockMetadataWithNotify(x, y, z, face | meta, 2);
}
@@ -6,12 +6,13 @@ import net.minecraft.init.Blocks;
import net.minecraft.potion.*;
import net.minecraft.util.*;
import net.minecraft.world.World;
import tconstruct.blocks.TConstructBlock;
public class SoilBlock extends TConstructBlock {
static String[] soilTypes = new String[] {
"slimesand", "grout", "slimesandblue", "graveyardsoil", "consecratedsoil", "slimedirt_blue", "nether_grout"
};
static String[] soilTypes = new String[] { "slimesand", "grout", "slimesandblue", "graveyardsoil",
"consecratedsoil", "slimedirt_blue", "nether_grout" };
public SoilBlock() {
super(Material.ground, 3.0F, soilTypes);
@@ -52,9 +53,8 @@ public class SoilBlock extends TConstructBlock {
}
/*
* public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y,
* int z) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); if
* (world.getBlockMetadata(x, y, z) >= 3) { this.setBlockBounds(0.0F, 0.0F,
* 0.0F, 1.0F, 0.875F, 1.0F); } }
* public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { this.setBlockBounds(0.0F, 0.0F,
* 0.0F, 1.0F, 1.0F, 1.0F); if (world.getBlockMetadata(x, y, z) >= 3) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F,
* 0.875F, 1.0F); } }
*/
}
@@ -1,7 +1,7 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -9,11 +9,14 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.*;
import tconstruct.blocks.SlabBase;
import tconstruct.library.TConstructRegistry;
import tconstruct.tools.TinkerTools;
import cpw.mods.fml.relauncher.*;
public class SoilSlab extends SlabBase {
public SoilSlab() {
super(Material.ground);
this.setCreativeTab(TConstructRegistry.blockTab);
@@ -1,12 +1,13 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import net.minecraft.block.BlockLadder;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.*;
public class StoneLadder extends BlockLadder {
// Override ladder material
@@ -2,9 +2,10 @@ package tconstruct.world.blocks;
import static net.minecraftforge.common.util.ForgeDirection.*;
import cpw.mods.fml.relauncher.*;
import java.util.Random;
import mantle.blocks.MantleBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -12,7 +13,10 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.*;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class StoneTorch extends MantleBlock {
public StoneTorch() {
super(Material.circuits);
this.setCreativeTab(CreativeTabs.tabDecorations);
@@ -20,8 +24,8 @@ public class StoneTorch extends MantleBlock {
}
/**
* 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)
* 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)
*/
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
@@ -29,9 +33,8 @@ public class StoneTorch extends MantleBlock {
}
/**
* 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.
* 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.
*/
@Override
public boolean isOpaqueCube() {
@@ -39,8 +42,7 @@ public class StoneTorch extends MantleBlock {
}
/**
* If this block doesn't render as an ordinary block it will return False
* (examples: signs, buttons, stairs, etc)
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
@Override
public boolean renderAsNormalBlock() {
@@ -68,8 +70,7 @@ public class StoneTorch extends MantleBlock {
}
/**
* Checks to see if its valid to put this block at the specified
* coordinates. Args: world, x, y, z
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
@@ -81,12 +82,11 @@ public class StoneTorch extends MantleBlock {
}
/**
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z,
* side, hitX, hitY, hitZ, block metadata
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
*/
@Override
public int onBlockPlaced(
World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) {
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7,
float par8, int par9) {
int j1 = par9;
if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) {
@@ -146,9 +146,8 @@ public class StoneTorch extends MantleBlock {
}
/**
* 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
* 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
*/
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
@@ -193,9 +192,8 @@ public class StoneTorch extends MantleBlock {
}
/**
* Tests if the block can remain at its current location and will drop as an
* item if it is unable to stay. Returns True if it can stay and False if it
* drops. Args: world, x, y, z
* Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns
* True if it can stay and False if it drops. Args: world, x, y, z
*/
protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4) {
if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) {
@@ -212,12 +210,12 @@ public class StoneTorch extends MantleBlock {
}
/**
* Ray traces through the blocks collision from start vector to end vector
* returning a ray trace hit. Args: world, x, y, z, startVec, endVec
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
* x, y, z, startVec, endVec
*/
@Override
public MovingObjectPosition collisionRayTrace(
World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) {
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3,
Vec3 par6Vec3) {
int l = par1World.getBlockMetadata(par2, par3, par4) & 7;
float f = 0.15F;
@@ -3,23 +3,14 @@ package tconstruct.world.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
import tconstruct.blocks.TConstructBlock;
public class TMetalBlock extends TConstructBlock {
static String[] metalTypes = new String[] {
"compressed_cobalt",
"compressed_ardite",
"compressed_manyullyn",
"compressed_copper",
"compressed_bronze",
"compressed_tin",
"compressed_aluminum",
"compressed_alubrass",
"compressed_alumite",
"compressed_steel",
"compressed_ender"
};
static String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn",
"compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum", "compressed_alubrass",
"compressed_alumite", "compressed_steel", "compressed_ender" };
public TMetalBlock(Material material, float hardness) {
super(material, hardness, metalTypes);
@@ -1,6 +1,5 @@
package tconstruct.world.blocks;
import cpw.mods.fml.relauncher.*;
import net.minecraft.block.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityMinecart;
@@ -8,7 +7,10 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class WoodRail extends BlockRailBase {
@SideOnly(Side.CLIENT)
private IIcon theIcon;
@@ -37,8 +39,7 @@ public class WoodRail extends BlockRailBase {
}
protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, Block par7) {
if (par7 != Blocks.air
&& par7.canProvidePower()
if (par7 != Blocks.air && par7.canProvidePower()
&& (new Rail(par1World, par2, par3, par4)).func_150650_a() == 3) {
this.func_150052_a(par1World, par2, par3, par4, false);
}
@@ -2,9 +2,11 @@ package tconstruct.world.entity;
import net.minecraft.item.Item;
import net.minecraft.world.*;
import tconstruct.world.TinkerWorld;
public class BlueSlime extends SlimeBase {
public BlueSlime(World world) {
super(world);
}
@@ -1,9 +1,7 @@
package tconstruct.world.entity;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.*;
import io.netty.buffer.ByteBuf;
import java.util.*;
import net.minecraft.block.*;
import net.minecraft.entity.*;
import net.minecraft.entity.item.EntityItem;
@@ -17,7 +15,12 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.util.*;
import net.minecraft.world.*;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.*;
import io.netty.buffer.ByteBuf;
public class CartEntity extends Entity implements IInventory, IEntityAdditionalSpawnData {
/** Array of item stacks stored in minecart (for storage minecarts). */
protected ItemStack[] cargoItems;
@@ -32,18 +35,10 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
protected boolean field_82345_h;
/** Minecart rotational logic matrix */
protected static final int[][][] matrix = new int[][][] {
{{0, 0, -1}, {0, 0, 1}},
{{-1, 0, 0}, {1, 0, 0}},
{{-1, -1, 0}, {1, 0, 0}},
{{-1, 0, 0}, {1, -1, 0}},
{{0, 0, -1}, {0, -1, 1}},
{{0, -1, -1}, {0, 0, 1}},
{{0, 0, 1}, {1, 0, 0}},
{{0, 0, 1}, {-1, 0, 0}},
{{0, 0, -1}, {-1, 0, 0}},
{{0, 0, -1}, {1, 0, 0}}
};
protected static final int[][][] matrix = new int[][][] { { { 0, 0, -1 }, { 0, 0, 1 } },
{ { -1, 0, 0 }, { 1, 0, 0 } }, { { -1, -1, 0 }, { 1, 0, 0 } }, { { -1, 0, 0 }, { 1, -1, 0 } },
{ { 0, 0, -1 }, { 0, -1, 1 } }, { { 0, -1, -1 }, { 0, 0, 1 } }, { { 0, 0, 1 }, { 1, 0, 0 } },
{ { 0, 0, 1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { 1, 0, 0 } } };
/** appears to be the progress of the turn */
protected int turnProgress;
@@ -120,8 +115,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* returns if this entity triggers Block.onEntityWalking on the blocks they
* walk on. used for spiders and wolves to prevent them from trampling crops
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
* prevent them from trampling crops
*/
@Override
protected boolean canTriggerWalking() {
@@ -137,9 +132,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns a boundingBox used to collide the entity with other entities and
* blocks. This enables the entity to be pushable on contact, like boats or
* minecarts.
* Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be
* pushable on contact, like boats or minecarts.
*/
@Override
public AxisAlignedBB getCollisionBox(Entity par1Entity) {
@@ -155,8 +149,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns true if this entity should push and be pushed by other entities
* when colliding.
* Returns true if this entity should push and be pushed by other entities when colliding.
*/
@Override
public boolean canBePushed() {
@@ -164,8 +157,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns the Y offset from the entity's position for any entity riding
* this one.
* Returns the Y offset from the entity's position for any entity riding this one.
*/
@Override
public double getMountedYOffset() {
@@ -218,8 +210,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns true if other Entities should be prevented from moving through
* this Entity.
* Returns true if other Entities should be prevented from moving through this Entity.
*/
@Override
public boolean canBeCollidedWith() {
@@ -256,8 +247,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
new ItemStack(var2.getItem(), var6, var2.getItemDamage()));
if (var2.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound)
var2.getTagCompound().copy());
entityitem.getEntityItem().setTagCompound((NBTTagCompound) var2.getTagCompound().copy());
}
float var8 = 0.05F;
@@ -274,8 +264,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Teleports the entity to another dimension. Params: Dimension number to
* teleport to
* Teleports the entity to another dimension. Params: Dimension number to teleport to
*/
@Override
public void travelToDimension(int par1) {
@@ -300,8 +289,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
this.kill();
}
if (this.isMinecartPowered()
&& this.rand.nextInt(4) == 0
if (this.isMinecartPowered() && this.rand.nextInt(4) == 0
&& pullcartType == 2
&& getClass() == CartEntity.class) {
this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D);
@@ -315,26 +303,26 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
var2 = this.getMaxInPortalTime();
// if (this.inPortal) {
// if (var1.getAllowNether()) {
// /*
// * if (this.ridingEntity == null && this.timeInPortal++ >=
// * var2) { this.timeInPortal = var2; this.timeUntilPortal =
// * this.getPortalCooldown(); byte var3;
// *
// * if (this.worldObj.provider.dimensionId == -1) { var3 = 0;
// * } else { var3 = -1; }
// *
// * this.travelToDimension(var3); }
// *
// * this.inPortal = false;
// */
// }
// if (var1.getAllowNether()) {
// /*
// * if (this.ridingEntity == null && this.timeInPortal++ >=
// * var2) { this.timeInPortal = var2; this.timeUntilPortal =
// * this.getPortalCooldown(); byte var3;
// *
// * if (this.worldObj.provider.dimensionId == -1) { var3 = 0;
// * } else { var3 = -1; }
// *
// * this.travelToDimension(var3); }
// *
// * this.inPortal = false;
// */
// }
// } else {
// /*
// * if (this.timeInPortal > 0) { this.timeInPortal -= 4; }
// *
// * if (this.timeInPortal < 0) { this.timeInPortal = 0; }
// */
// /*
// * if (this.timeInPortal > 0) { this.timeInPortal -= 4; }
// *
// * if (this.timeInPortal < 0) { this.timeInPortal = 0; }
// */
// }
if (this.timeUntilPortal > 0) {
@@ -428,11 +416,9 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
void moveTowardsEntity(Entity entity) {
// TConstruct.logger.info("Moving towards entity");
/*
* double distX = this.posX - entity.posX; double distZ = this.posZ -
* entity.posZ; //posY = posY + 0.1;
*
* if (entity.posY > this.posY) motionY += 0.1; if (distX > 0.5 && distZ
* > 0.5) { motionX = -distX; motionZ = -distZ; }
* double distX = this.posX - entity.posX; double distZ = this.posZ - entity.posZ; //posY = posY + 0.1; if
* (entity.posY > this.posY) motionY += 0.1; if (distX > 0.5 && distZ > 0.5) { motionX = -distX; motionZ =
* -distZ; }
*/
double var15 = entity.posX;
@@ -482,12 +468,9 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
public double calculateDistance(double pos1, double pos2) {
double distance = Math.abs(pos1 - pos2); // 0.0D;
/*
* double absPos1 = Math.abs(pos1); double absPos2 = Math.abs(pos2);
*
* if ((pos1 <= 0.0D || pos2 <= 0.0D) && (pos1 >= 0.0D || pos2 >= 0.0D))
* { distance = absPos1 + absPos2; } else if (absPos1 > absPos2) {
* distance = absPos1 - absPos2; } else if (absPos2 > absPos1) {
* distance = absPos2 - absPos1; }
* double absPos1 = Math.abs(pos1); double absPos2 = Math.abs(pos2); if ((pos1 <= 0.0D || pos2 <= 0.0D) && (pos1
* >= 0.0D || pos2 >= 0.0D)) { distance = absPos1 + absPos2; } else if (absPos1 > absPos2) { distance = absPos1
* - absPos2; } else if (absPos2 > absPos1) { distance = absPos2 - absPos1; }
*/
return distance;
@@ -637,15 +620,13 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Applies a velocity to each of the entities pushing them away from each
* other. Args: entity
* Applies a velocity to each of the entities pushing them away from each other. Args: entity
*/
@Override
public void applyEntityCollision(Entity par1Entity) {
if (!this.worldObj.isRemote) {
if (par1Entity != this.riddenByEntity) {
if (par1Entity instanceof EntityLiving
&& !(par1Entity instanceof EntityIronGolem)
if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityIronGolem)
&& canBeRidden()
&& this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D
&& this.riddenByEntity == null
@@ -681,10 +662,9 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
double var12 = par1Entity.posZ - this.posZ;
Vec3 var14 = Vec3.createVectorHelper(var10, 0.0D, var12).normalize();
Vec3 var15 = Vec3.createVectorHelper(
MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F),
0.0D,
MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F))
.normalize();
MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F),
0.0D,
MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F)).normalize();
double var16 = Math.abs(var14.dotProduct(var15));
if (var16 < 0.8D) {
@@ -742,8 +722,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Removes from an inventory slot (first arg) up to a specified number
* (second arg) of items and returns them in a new stack.
* Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
* new stack.
*/
@Override
public ItemStack decrStackSize(int par1, int par2) {
@@ -765,9 +745,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* When some containers are closed they call this on each slot, then drop
* whatever it returns as an EntityItem - like when you close a workbench
* GUI.
* When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
* like when you close a workbench GUI.
*/
@Override
public ItemStack getStackInSlotOnClosing(int par1) {
@@ -781,8 +760,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Sets the given item stack to the specified slot in the inventory (can be
* crafting or armor sections).
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
*/
@Override
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
@@ -801,8 +779,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns the maximum stack size for a inventory slot. Seems to always be
* 64, possibly will be extended. *Isn't this more of a set than a get?*
* Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't
* this more of a set than a get?*
*/
@Override
public int getInventoryStackLimit() {
@@ -816,8 +794,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
public void markDirty() {}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow,
* gets into the saddle on a pig.
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer player) {
if (player.isSneaking()) {
@@ -833,8 +810,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
return true;
}
if (canBeRidden()) {
if (this.riddenByEntity != null
&& this.riddenByEntity instanceof EntityPlayer
if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer
&& this.riddenByEntity != player) {
return true;
}
@@ -894,8 +870,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Do not make give this method the name canInteractWith because it clashes
* with Container
* Do not make give this method the name canInteractWith because it clashes with Container
*/
@Override
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
@@ -925,16 +900,16 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
public void closeChest() {}
/**
* Sets the current amount of damage the minecart has taken. Decreases over
* time. The cart breaks when this is over 40.
* Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over
* 40.
*/
public void setDamage(int par1) {
this.dataWatcher.updateObject(19, Integer.valueOf(par1));
}
/**
* Gets the current amount of damage the minecart has taken. Decreases over
* time. The cart breaks when this is over 40.
* Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over
* 40.
*/
public int getDamage() {
return this.dataWatcher.getWatchableObjectInt(19);
@@ -957,8 +932,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Drops the cart as a item. The exact item dropped is defined by
* getItemDropped().
* Drops the cart as a item. The exact item dropped is defined by getItemDropped().
*/
public void dropCartAsItem() {
for (ItemStack item : getItemsDropped()) {
@@ -967,29 +941,24 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Override this to define which items your cart drops when broken. This
* does not include items contained in the inventory, that is handled
* elsewhere.
* Override this to define which items your cart drops when broken. This does not include items contained in the
* inventory, that is handled elsewhere.
*
* @return A list of items dropped.
*/
public List<ItemStack> getItemsDropped() {
/*
* List<ItemStack> items = new ArrayList<ItemStack>(); items.add(new
* ItemStack(Item.minecartEmpty));
*
* switch(cartType) { case 1: items.add(new ItemStack(Block.chest));
* break; case 2: items.add(new ItemStack(Block.stoneOvenIdle)); break;
* } return items;
* List<ItemStack> items = new ArrayList<ItemStack>(); items.add(new ItemStack(Item.minecartEmpty));
* switch(cartType) { case 1: items.add(new ItemStack(Block.chest)); break; case 2: items.add(new
* ItemStack(Block.stoneOvenIdle)); break; } return items;
*/
return new ArrayList<>();
}
/**
* This function returns an ItemStack that represents this cart. This should
* be an ItemStack that can be used by the player to place the cart. This is
* the item that was registered with the cart via the registerMinecart
* function, but is not necessary the item the cart drops when destroyed.
* This function returns an ItemStack that represents this cart. This should be an ItemStack that can be used by the
* player to place the cart. This is the item that was registered with the cart via the registerMinecart function,
* but is not necessary the item the cart drops when destroyed.
*
* @return An ItemStack that can be used to place the cart.
*/
@@ -1008,9 +977,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns true if this cart is a storage cart Some carts may have
* inventories but not be storage carts and some carts without inventories
* may be storage carts.
* Returns true if this cart is a storage cart Some carts may have inventories but not be storage carts and some
* carts without inventories may be storage carts.
*
* @return True if this cart should be classified as a storage cart.
*/
@@ -1028,8 +996,8 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Returns true if this cart can currently use rails. This function is
* mainly used to gracefully detach a minecart from a rail.
* Returns true if this cart can currently use rails. This function is mainly used to gracefully detach a minecart
* from a rail.
*
* @return True if the minecart can use rails.
*/
@@ -1038,19 +1006,16 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Set whether the minecart can use rails. This function is mainly used to
* gracefully detach a minecart from a rail.
* Set whether the minecart can use rails. This function is mainly used to gracefully detach a minecart from a rail.
*
* @param use
* Whether the minecart can currently use rails.
* @param use Whether the minecart can currently use rails.
*/
public void setCanUseRail(boolean use) {
canUseRail = use;
}
/**
* Return false if this cart should not call IRail.onMinecartPass() and
* should ignore Powered Rails.
* Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails.
*
* @return True if this cart should call IRail.onMinecartPass().
*/
@@ -1123,8 +1088,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
}
/**
* Moved to allow overrides. This code handles minecart movement and speed
* capping when not on a rail.
* Moved to allow overrides. This code handles minecart movement and speed capping when not on a rail.
*/
protected void moveMinecartOffRail(int i, int j, int k) {
double d2 = getMaxSpeedGround();
@@ -1168,8 +1132,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
/**
* Moved to allow overrides, This code handle slopes affecting velocity.
*
* @param metadata
* The blocks position metadata
* @param metadata The blocks position metadata
*/
protected void adjustSlopeVelocities(int metadata) {
double acceleration = 0.0078125D;
@@ -1189,10 +1152,9 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS
*/
/**
* Returns the carts max speed. Carts going faster than 1.1 cause issues
* with chunk loading. Carts cant traverse slopes or corners at greater than
* 0.5 - 0.6. This value is compared with the rails max speed to determine
* the carts current max speed. A normal rails max speed is 0.4.
* Returns the carts max speed. Carts going faster than 1.1 cause issues with chunk loading. Carts cant traverse
* slopes or corners at greater than 0.5 - 0.6. This value is compared with the rails max speed to determine the
* carts current max speed. A normal rails max speed is 0.4.
*
* @return Carts max speed.
*/
@@ -5,12 +5,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.armor.TinkerArmor;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.tools.ToolCore;
public class KingBlueSlime extends SlimeBase implements IBossDisplayData {
public KingBlueSlime(World world) {
super(world);
@@ -59,7 +61,11 @@ public class KingBlueSlime extends SlimeBase implements IBossDisplayData {
double x = Math.cos(r);
double z = Math.sin(r);
entityslime.setLocationAndAngles(
this.posX - 1d + x, this.posY + 0.5D, this.posZ - 1d + z, this.rand.nextFloat() * 360.0F, 0.0F);
this.posX - 1d + x,
this.posY + 0.5D,
this.posZ - 1d + z,
this.rand.nextFloat() * 360.0F,
0.0F);
entityslime.motionX = x;
entityslime.motionY = -0.5d - rand.nextDouble();
entityslime.motionZ = z;
@@ -78,12 +84,12 @@ public class KingBlueSlime extends SlimeBase implements IBossDisplayData {
final ItemStack headStack = new ItemStack(tool.getHeadItem(), 1, 17);
final ItemStack handleStack = new ItemStack(tool.getHandleItem(), 1, 17);
final ItemStack accessoryStack =
tool.getAccessoryItem() != null ? new ItemStack(tool.getAccessoryItem(), 1, 17) : null;
final ItemStack accessoryStack = tool.getAccessoryItem() != null ? new ItemStack(tool.getAccessoryItem(), 1, 17)
: null;
final ItemStack extraStack = tool.getExtraItem() != null ? new ItemStack(tool.getExtraItem(), 1, 17) : null;
String loc = "tool." + tool.getToolName().toLowerCase()
+ ".kingslime"; // special localization the same way as materials
String loc = "tool." + tool.getToolName().toLowerCase() + ".kingslime"; // special localization the same way as
// materials
String name;
if (StatCollector.canTranslate(loc)) name = StatCollector.translateToLocal(loc);
else name = StatCollector.translateToLocal("tool.kingslimeprefix") + " " + tool.getLocalizedToolName();
@@ -107,8 +113,9 @@ public class KingBlueSlime extends SlimeBase implements IBossDisplayData {
ToolCore getValidTool() {
ToolCore tool = TConstructRegistry.tools.get(rand.nextInt(TConstructRegistry.tools.size()));
/*if (tool.getExtraItem() != null)
tool = getValidTool();*/
/*
* if (tool.getExtraItem() != null) tool = getValidTool();
*/
return tool;
}
}
@@ -35,14 +35,9 @@ public class MetalSlime extends BlueSlime {
}
/*
* protected void dropFewItems (boolean par1, int par2) { int j =
* this.getDropItemId();
*
* if (j > 0) { int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize());
*
* if (par2 > 0) { k += this.rand.nextInt(par2 + 1); }
*
* for (int l = 0; l < k; ++l) { this.dropItem(j, 1); } } }
* protected void dropFewItems (boolean par1, int par2) { int j = this.getDropItemId(); if (j > 0) { int k =
* rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); if (par2 > 0) { k += this.rand.nextInt(par2 + 1); } for (int
* l = 0; l < k; ++l) { this.dropItem(j, 1); } } }
*/
@Override
@@ -15,9 +15,11 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import tconstruct.world.TinkerWorld;
public abstract class SlimeBase extends EntityLiving implements IMob {
public float sizeOffset;
public float sizeFactor;
public float sizeHeight;
@@ -78,16 +80,14 @@ public abstract class SlimeBase extends EntityLiving implements IMob {
}
/**
* Indicates weather the slime is able to damage the player (based upon the
* slime's size)
* Indicates weather the slime is able to damage the player (based upon the slime's size)
*/
protected boolean canDamagePlayer() {
return this.getSlimeSize() > 1;
}
/**
* Gets the amount of damage dealt to the player when "attacked" by the
* slime.
* Gets the amount of damage dealt to the player when "attacked" by the slime.
*/
protected int getAttackStrength() {
return this.getSlimeSize();
@@ -129,8 +129,7 @@ public abstract class SlimeBase extends EntityLiving implements IMob {
this.motionZ += MathHelper.cos(f) * 0.2F;
}
if (!(this instanceof IBossDisplayData)
&& this.getBrightness(1.0F) > 0.9F
if (!(this instanceof IBossDisplayData) && this.getBrightness(1.0F) > 0.9F
&& rand.nextInt(5) == 0
&& this.worldObj.canBlockSeeTheSky(
MathHelper.floor_double(this.posX),
@@ -150,8 +149,7 @@ public abstract class SlimeBase extends EntityLiving implements IMob {
*/
@Override
public void onUpdate() {
if (!this.worldObj.isRemote
&& this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL
&& this.getSlimeSize() > 0) {
this.isDead = true;
}
@@ -309,10 +307,9 @@ public abstract class SlimeBase extends EntityLiving implements IMob {
public boolean getCanSpawnHere() {
// needs free space
if (!this.worldObj.checkNoEntityCollision(this.boundingBox)
|| !this.worldObj
.getCollidingBoundingBoxes(this, this.boundingBox)
.isEmpty()
|| this.worldObj.isAnyLiquid(this.boundingBox)) return false;
|| !this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()
|| this.worldObj.isAnyLiquid(this.boundingBox))
return false;
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.boundingBox.minY);
@@ -1,12 +1,14 @@
package tconstruct.world.gen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class OreberryBushGen extends WorldGenerator {
private Block blockB;
private final int metadata;
int chance;
@@ -46,9 +48,8 @@ public class OreberryBushGen extends WorldGenerator {
public void generateMediumNode(World world, Random random, int x, int y, int z) {
for (int xPos = -1; xPos <= 1; xPos++)
for (int yPos = -1; yPos <= 1; yPos++)
for (int zPos = -1; zPos <= 1; zPos++)
if (random.nextInt(4) == 0) generateBerryBlock(world, x + xPos, y + yPos, z + zPos, random);
for (int yPos = -1; yPos <= 1; yPos++) for (int zPos = -1; zPos <= 1; zPos++)
if (random.nextInt(4) == 0) generateBerryBlock(world, x + xPos, y + yPos, z + zPos, random);
generateSmallNode(world, random, x, y, z);
}
@@ -75,13 +76,12 @@ public class OreberryBushGen extends WorldGenerator {
void generateBerryBlock(World world, int x, int y, int z, Random random) {
/*
* if (!Block.opaqueCubeLookup[world.getBlockId(x, y, z)]) {
* setBlockAndMetadata(world, x, y, z, blockID, metadata); }
* if (!Block.opaqueCubeLookup[world.getBlockId(x, y, z)]) { setBlockAndMetadata(world, x, y, z, blockID,
* metadata); }
*/
Block block = world.getBlock(x, y, z);
if (block == null
|| (block != Blocks.end_portal_frame && !world.getBlock(x, y, z).func_149730_j()))
if (block == null || (block != Blocks.end_portal_frame && !world.getBlock(x, y, z).func_149730_j()))
world.setBlock(x, y, z, this.blockB, metadata, 2);
else {
for (Block replaceBlock : replaceBlocks) {
@@ -34,17 +34,9 @@ public class OverworldProvider extends WorldProvider {
}
/*
* public float calculateCelestialAngle(long worldtime, float par3) { int
* timeOfDay = (int)(worldtime % 43200L); float f1 = ((float)timeOfDay +
* par3) / 43200.0F - 0.25F;
*
* if (f1 < 0.0F) { ++f1; }
*
* if (f1 > 1.0F) { --f1; }
*
* float f2 = f1; f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) +
* 1.0D) / 2.0D); f1 = f2 + (f1 - f2) / 3.0F; return f1; }
*
* public int getMoonPhase(long par1) { return (int)(par1 / 43200L) % 8; }
* public float calculateCelestialAngle(long worldtime, float par3) { int timeOfDay = (int)(worldtime % 43200L);
* float f1 = ((float)timeOfDay + par3) / 43200.0F - 0.25F; if (f1 < 0.0F) { ++f1; } if (f1 > 1.0F) { --f1; } float
* f2 = f1; f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D); f1 = f2 + (f1 - f2) / 3.0F; return
* f1; } public int getMoonPhase(long par1) { return (int)(par1 / 43200L) % 8; }
*/
}
@@ -1,12 +1,14 @@
package tconstruct.world.gen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class PlantGen extends WorldGenerator {
/** The ID of the plant block used in this plant generator. */
public final Block plant;
@@ -39,8 +41,7 @@ public class PlantGen extends WorldGenerator {
int posY = clumped ? y + random.nextInt(ySize) - random.nextInt(ySize) : y + random.nextInt(ySize);
int posZ = clumped ? z + random.nextInt(zSize) - random.nextInt(zSize) : z + random.nextInt(zSize);
if (world.getBlock(posX, posY, posZ) == Blocks.air
&& (!world.provider.hasNoSky || posY < 127)
if (world.getBlock(posX, posY, posZ) == Blocks.air && (!world.provider.hasNoSky || posY < 127)
&& this.plant.canBlockStay(world, posX, posY, posZ)) {
world.setBlock(posX, posY, posZ, this.plant, this.metadata, 2);
}
@@ -1,8 +1,8 @@
package tconstruct.world.gen;
import cpw.mods.fml.common.IWorldGenerator;
import java.awt.geom.Ellipse2D;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
@@ -10,11 +10,14 @@ import net.minecraft.world.*;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderFlat;
import net.minecraft.world.gen.feature.WorldGenerator;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.*;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.common.IWorldGenerator;
public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
private final Block liquidBlock;
private final int gelMeta;
int randomness = 2;
@@ -29,15 +32,10 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
}
@Override
public void generate(
Random random,
int chunkX,
int chunkZ,
World world,
IChunkProvider chunkGenerator,
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) // IWorldGenerator
// version
{
// version
{
// dim 0 only?
if ((chunkGenerator instanceof ChunkProviderFlat || world.provider.terrainType == WorldType.FLAT)
&& !PHConstruct.genIslandsFlat) {
@@ -81,8 +79,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
&& world.getBlock(xPos + 1, yPos + 1, zPos) == base
&& world.getBlock(xPos, yPos + 1, zPos - 1) == base
&& world.getBlock(xPos - 1, yPos + 1, zPos + 1) == base
&& random.nextInt(100) > randomness) {
} else {
&& random.nextInt(100) > randomness) {} else {
world.setBlock(xPos, yPos, zPos, Blocks.air, 0, 2);
}
}
@@ -100,8 +97,7 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
if (world.getBlock(xPos - 1, yPos - 1, zPos) == base
&& world.getBlock(xPos + 1, yPos - 1, zPos) == base
&& world.getBlock(xPos, yPos - 1, zPos - 1) == base
&& world.getBlock(xPos - 1, yPos - 1, zPos + 1) == base) {
} else {
&& world.getBlock(xPos - 1, yPos - 1, zPos + 1) == base) {} else {
world.setBlock(xPos, yPos, zPos, Blocks.air, 0, 2);
}
}
@@ -145,14 +141,12 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
@Override
public boolean generate(World world, Random rand, int x, int y, int z) // WorldGenerator
// version
{
// version
{
x -= 8;
z -= 8;
/*
* for (z -= 8; y > 5 && world.isAirBlock(x, y, z); --y) { ; }
*
* if (y <= 4) { return false; } else {
* for (z -= 8; y > 5 && world.isAirBlock(x, y, z); --y) { ; } if (y <= 4) { return false; } else {
*/
y -= 4;
boolean[] validLocations = new boolean[2048];
@@ -199,15 +193,13 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
|| yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]);
if (var33) {
Material var12 =
world.getBlock(x + xPos, y + yPos, z + zPos).getMaterial();
Material var12 = world.getBlock(x + xPos, y + yPos, z + zPos).getMaterial();
if (yPos >= 4 && var12.isLiquid()) {
return false;
}
if (yPos < 4
&& !var12.isSolid()
if (yPos < 4 && !var12.isSolid()
&& world.getBlock(x + xPos, y + yPos, z + zPos) != this.liquidBlock) {
return false;
}
@@ -251,14 +243,9 @@ public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator {
|| yPos < 7 && validLocations[(xPos * 16 + zPos) * 8 + yPos + 1]
|| yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]);
if (var33
&& (yPos < 4 || rand.nextInt(2) != 0)
&& world.getBlock(x + xPos, y + yPos, z + zPos)
.getMaterial()
.isSolid()
&& world.getBlock(x + xPos, y + yPos + 1, z + zPos)
.getMaterial()
!= Material.water) {
if (var33 && (yPos < 4 || rand.nextInt(2) != 0)
&& world.getBlock(x + xPos, y + yPos, z + zPos).getMaterial().isSolid()
&& world.getBlock(x + xPos, y + yPos + 1, z + zPos).getMaterial() != Material.water) {
world.setBlock(x + xPos, y + yPos, z + zPos, TinkerWorld.slimeGel, gelMeta, 2);
}
}
@@ -1,15 +1,18 @@
package tconstruct.world.gen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.util.ForgeDirection;
import tconstruct.tools.TinkerTools;
import tconstruct.world.TinkerWorld;
public class SlimeTreeGen extends WorldGenerator {
public final int minTreeHeight;
public final int treeHeightRange;
public final int metaWood;
@@ -44,7 +47,7 @@ public class SlimeTreeGen extends WorldGenerator {
if (isSoil) {
// TODO Fix this for 1.7
// if (!checkClear(world, xPos, yPos, zPos, height))
// return false;
// return false;
soil.onPlantGrow(world, xPos, yPos - 1, zPos, xPos, yPos, zPos);
placeCanopy(world, random, xPos, yPos, zPos, height);
@@ -65,9 +68,9 @@ public class SlimeTreeGen extends WorldGenerator {
for (int xPos = range; xPos <= range; xPos++) {
for (int zPos = range; zPos <= range; zPos++) {
Block blockID = world.getBlock(x + xPos, y + yPos, z + zPos);
if (blockID != null
&& blockID != TinkerWorld.slimeSapling
&& !blockID.isLeaves(world, x + xPos, y + yPos, z + zPos)) return false;
if (blockID != null && blockID != TinkerWorld.slimeSapling
&& !blockID.isLeaves(world, x + xPos, y + yPos, z + zPos))
return false;
}
}
}
@@ -109,26 +112,66 @@ public class SlimeTreeGen extends WorldGenerator {
this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos - 3, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos + 3, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(
world, xPos + 2, yPos + height - 4, zPos + 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos + 2,
yPos + height - 4,
zPos + 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos + 2, yPos + height - 4, zPos - 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos + 2,
yPos + height - 4,
zPos - 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos - 2, yPos + height - 4, zPos + 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos - 2,
yPos + height - 4,
zPos + 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos - 2, yPos + height - 4, zPos - 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos - 2,
yPos + height - 4,
zPos - 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(world, xPos + 3, yPos + height - 5, zPos, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(world, xPos - 3, yPos + height - 5, zPos, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos - 3, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos + 3, TinkerWorld.slimeLeaves, this.metaLeaves);
this.setBlockAndMetadata(
world, xPos + 2, yPos + height - 5, zPos + 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos + 2,
yPos + height - 5,
zPos + 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos + 2, yPos + height - 5, zPos - 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos + 2,
yPos + height - 5,
zPos - 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos - 2, yPos + height - 5, zPos + 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos - 2,
yPos + height - 5,
zPos + 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
this.setBlockAndMetadata(
world, xPos - 2, yPos + height - 5, zPos - 2, TinkerWorld.slimeLeaves, this.metaLeaves);
world,
xPos - 2,
yPos + height - 5,
zPos - 2,
TinkerWorld.slimeLeaves,
this.metaLeaves);
}
void placeDiamondLayer(World world, int xPos, int yPos, int zPos, int range) {
@@ -1,14 +1,17 @@
package tconstruct.world.gen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import tconstruct.util.config.PHConstruct;
public class SurfaceOreGen extends WorldGenerator {
/** The block of the ore to be placed using this generator. */
private final Block minableBlock;
@@ -88,10 +91,10 @@ public class SurfaceOreGen extends WorldGenerator {
double d7 = d4 + (d5 - d4) * (double) l / (double) blockNumber;
double d8 = d2 + (d3 - d2) * (double) l / (double) blockNumber;
double d9 = random.nextDouble() * (double) blockNumber / 16.0D;
double d10 =
(double) (MathHelper.sin((float) l * (float) Math.PI / (float) blockNumber) + 1.0F) * d9 + 1.0D;
double d11 =
(double) (MathHelper.sin((float) l * (float) Math.PI / (float) blockNumber) + 1.0F) * d9 + 1.0D;
double d10 = (double) (MathHelper.sin((float) l * (float) Math.PI / (float) blockNumber) + 1.0F) * d9
+ 1.0D;
double d11 = (double) (MathHelper.sin((float) l * (float) Math.PI / (float) blockNumber) + 1.0F) * d9
+ 1.0D;
int i1 = MathHelper.floor_double(d6 - d10 / 2.0D);
int j1 = MathHelper.floor_double(d7 - d11 / 2.0D);
int k1 = MathHelper.floor_double(d8 - d10 / 2.0D);
@@ -112,8 +115,7 @@ public class SurfaceOreGen extends WorldGenerator {
Block block = world.getBlock(k2, l2, i3);
if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D) {
if (block == null
|| !world.getBlock(k2, l2, i3).isOpaqueCube())
if (block == null || !world.getBlock(k2, l2, i3).isOpaqueCube())
world.setBlock(k2, l2, i3, this.minableBlock, minableBlockMeta, 2);
else {
for (Block replaceBlock : replaceBlocks) {
@@ -1,17 +1,20 @@
package tconstruct.world.gen;
import cpw.mods.fml.common.IWorldGenerator;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.*;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import tconstruct.util.config.PHConstruct;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.common.IWorldGenerator;
public class TBaseWorldGenerator implements IWorldGenerator {
public TBaseWorldGenerator() {
copper = new WorldGenMinable(TinkerWorld.oreSlag, 3, 8, Blocks.stone);
tin = new WorldGenMinable(TinkerWorld.oreSlag, 4, 8, Blocks.stone);
@@ -29,12 +32,7 @@ public class TBaseWorldGenerator implements IWorldGenerator {
}
@Override
public void generate(
Random random,
int chunkX,
int chunkZ,
World world,
IChunkProvider chunkGenerator,
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
if (world.provider.isHellWorld) {
generateNether(random, chunkX * 16, chunkZ * 16, world);
@@ -133,7 +131,12 @@ public class TBaseWorldGenerator implements IWorldGenerator {
yPos = (PHConstruct.copperBushMaxY + PHConstruct.copperBushMinY) / 2;
zPos = zChunk + random.nextInt(16);
yPos = findAdequateLocation(
world, xPos, yPos, zPos, PHConstruct.copperBushMaxY, PHConstruct.copperBushMinY);
world,
xPos,
yPos,
zPos,
PHConstruct.copperBushMaxY,
PHConstruct.copperBushMinY);
if (yPos != -1) {
/*
* CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
@@ -171,7 +174,12 @@ public class TBaseWorldGenerator implements IWorldGenerator {
yPos = (PHConstruct.aluminumBushMaxY + PHConstruct.aluminumBushMinY) / 2;
zPos = zChunk + random.nextInt(16);
yPos = findAdequateLocation(
world, xPos, yPos, zPos, PHConstruct.aluminumBushMaxY, PHConstruct.aluminumBushMinY);
world,
xPos,
yPos,
zPos,
PHConstruct.aluminumBushMaxY,
PHConstruct.aluminumBushMinY);
if (yPos != -1) {
/*
* CoordTuple coord = new CoordTuple(xPos, yPos, zPos);
@@ -250,8 +258,8 @@ public class TBaseWorldGenerator implements IWorldGenerator {
void superfunGenerate(Random random, int chunkX, int chunkZ, World world) {
/*
* for (int x = 0; x < 16; x++) for (int z = 0; z < 16; z++)
* world.setBlock(x+chunkX, 192, z+chunkZ, Block.glowStone);
* for (int x = 0; x < 16; x++) for (int z = 0; z < 16; z++) world.setBlock(x+chunkX, 192, z+chunkZ,
* Block.glowStone);
*/
for (int x = 0; x < 16; x++) {
@@ -277,8 +285,7 @@ public class TBaseWorldGenerator implements IWorldGenerator {
void generateChunkBorder(Random random, int chunkX, int chunkZ, World world) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
if (x + chunkX == PHConstruct.worldBorderSize
|| x + chunkX == -PHConstruct.worldBorderSize
if (x + chunkX == PHConstruct.worldBorderSize || x + chunkX == -PHConstruct.worldBorderSize
|| z + chunkZ == PHConstruct.worldBorderSize
|| z + chunkZ == -PHConstruct.worldBorderSize) {
for (int y = 0; y < 256; y++) {
@@ -3,16 +3,20 @@ package tconstruct.world.gen;
import static net.minecraft.world.biome.BiomeGenBase.*;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND;
import com.google.common.collect.*;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
import tconstruct.util.config.PHConstruct;
import tconstruct.world.TinkerWorld;
import com.google.common.collect.*;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class TerrainGenEventHandler {
private final SurfaceOreGen ironSurface = new SurfaceOreGen(TinkerWorld.oreGravel, 0, 12, true);
private final SurfaceOreGen goldSurface = new SurfaceOreGen(TinkerWorld.oreGravel, 1, 20, true);
private final SurfaceOreGen copperSurface = new SurfaceOreGen(TinkerWorld.oreGravel, 2, 12, true);
@@ -20,8 +24,8 @@ public class TerrainGenEventHandler {
private final SurfaceOreGen aluminumSurface = new SurfaceOreGen(TinkerWorld.oreGravel, 4, 12, true);
private final SurfaceOreGen cobaltSurface = new SurfaceOreGen(TinkerWorld.oreGravel, 5, 30, true);
private static final ImmutableCollection<BiomeGenBase> EXTRA_ORE_BIOMES =
ImmutableList.of(extremeHills, extremeHillsEdge);
private static final ImmutableCollection<BiomeGenBase> EXTRA_ORE_BIOMES = ImmutableList
.of(extremeHills, extremeHillsEdge);
@SubscribeEvent
public void onDecorateEvent(Decorate e) {
@@ -1,7 +1,7 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -9,7 +9,10 @@ import net.minecraft.item.*;
import net.minecraft.util.*;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class BarricadeItem extends ItemBlock {
private final Block b;
public BarricadeItem(Block b) {
@@ -24,49 +27,39 @@ public class BarricadeItem extends ItemBlock {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ) {
Block b = world.getBlock(x, y, z);
if (b == Blocks.snow && (world.getBlockMetadata(x, y, z) & 7) < 1) {
side = 1;
} else if (b != Blocks.vine
&& b != Blocks.tallgrass
} else if (b != Blocks.vine && b != Blocks.tallgrass
&& b != Blocks.deadbush
&& (b == null || !b.canPlaceBlockAt(world, x, y, z))) {
if (side == 0) {
--y;
}
if (side == 0) {
--y;
}
if (side == 1) {
++y;
}
if (side == 1) {
++y;
}
if (side == 2) {
--z;
}
if (side == 2) {
--z;
}
if (side == 3) {
++z;
}
if (side == 3) {
++z;
}
if (side == 4) {
--x;
}
if (side == 4) {
--x;
}
if (side == 5) {
++x;
}
}
if (side == 5) {
++x;
}
}
if (stack.stackSize == 0) {
return false;
@@ -1,17 +1,20 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import cpw.mods.fml.relauncher.*;
public class CraftedSoilItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {
"Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil", "blue", "dirt", "Grout"
};
public static final String[] blockTypes = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil",
"blue", "dirt", "Grout" };
public CraftedSoilItemBlock(Block b) {
super(b, "CraftedSoil", blockTypes);
@@ -1,10 +1,12 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
public class GravelOreItem extends MultiItemBlock {
public static final String[] blockTypes = {"iron", "gold", "copper", "tin", "aluminum", "cobalt"};
public static final String[] blockTypes = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
public GravelOreItem(Block b) {
super(b, "block.ore.gravel", blockTypes);
@@ -1,8 +1,7 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
@@ -10,7 +9,11 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.*;
public class HamboneItemBlock extends ItemBlock {
public HamboneItemBlock(Block b) {
super(b);
itemUseDuration = 32;
@@ -43,14 +46,12 @@ public class HamboneItemBlock extends ItemBlock {
private final boolean isWolfsFavoriteMeat;
/**
* If this field is true, the food can be consumed even if the player don't
* need to eat.
* If this field is true, the food can be consumed even if the player don't need to eat.
*/
private boolean alwaysEdible;
/**
* represents the potion effect that will occurr upon eating this food. Set
* by setPotionEffect
* represents the potion effect that will occurr upon eating this food. Set by setPotionEffect
*/
private int potionId;
@@ -64,12 +65,9 @@ public class HamboneItemBlock extends ItemBlock {
private float potionEffectProbability;
/*
* public ItemFood(int par1, int par2, float par3, boolean par4) {
* super(par1); this.itemUseDuration = 32; this.healAmount = par2;
* this.isWolfsFavoriteMeat = par4; this.saturationModifier = par3;
* this.setCreativeTab(CreativeTabs.tabFood); }
*
* public ItemFood(int par1, int par2, boolean par3) { this(par1, par2,
* public ItemFood(int par1, int par2, float par3, boolean par4) { super(par1); this.itemUseDuration = 32;
* this.healAmount = par2; this.isWolfsFavoriteMeat = par4; this.saturationModifier = par3;
* this.setCreativeTab(CreativeTabs.tabFood); } public ItemFood(int par1, int par2, boolean par3) { this(par1, par2,
* 0.6F, par3); }
*/
@@ -84,8 +82,8 @@ public class HamboneItemBlock extends ItemBlock {
protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) {
par3EntityPlayer.addPotionEffect(
new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier));
par3EntityPlayer
.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier));
}
}
@@ -98,8 +96,7 @@ public class HamboneItemBlock extends ItemBlock {
}
/**
* returns the action that specifies what animation to play when the items
* is being used
* returns the action that specifies what animation to play when the items is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
@@ -107,8 +104,7 @@ public class HamboneItemBlock extends ItemBlock {
}
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
@@ -1,14 +1,17 @@
package tconstruct.world.itemblocks;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class MetalOreItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {"NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag"};
public static final String[] blockTypes = { "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" };
public MetalOreItemBlock(Block b) {
super(b, "MetalOre", blockTypes);
@@ -1,23 +1,25 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.relauncher.*;
public class OreberryBushItem extends MultiItemBlock {
public Block blockB;
public static final String[] blockTypes = {
"iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron",
"gold", "copper", "tin"
};
public static final String[] blockTypes = { "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin",
"iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" };
public OreberryBushItem(Block b) {
super(b, "block.oreberry", blockTypes);
@@ -32,23 +34,13 @@ public class OreberryBushItem extends MultiItemBlock {
/* Place bushes on dirt, grass, or other bushes only */
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float par8,
float par9,
float par10) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float par8, float par9, float par10) {
if (side != 1) return false;
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) {
Block block = world.getBlock(x, y, z);
if (block != null
&& block.canSustainPlant(world, x, y, z, ForgeDirection.UP, TinkerWorld.oreBerry)
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, TinkerWorld.oreBerry)
&& WorldHelper.isAirBlock(world, x, y + 1, z)) {
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
if (!player.capabilities.isCreativeMode) stack.stackSize--;
@@ -1,37 +1,25 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.relauncher.*;
public class OreberryBushSecondItem extends MultiItemBlock {
public Block blockB;
public static final String[] blockTypes = {
"aluminum",
"essence",
"",
"",
"aluminum",
"essence",
"",
"",
"aluminum",
"essence",
"",
"",
"aluminum",
"essence",
"",
""
};
public static final String[] blockTypes = { "aluminum", "essence", "", "", "aluminum", "essence", "", "",
"aluminum", "essence", "", "", "aluminum", "essence", "", "" };
public OreberryBushSecondItem(Block b) {
super(b, "block.oreberry", blockTypes);
@@ -46,17 +34,8 @@ public class OreberryBushSecondItem extends MultiItemBlock {
/* Place bushes on dirt, grass, or other bushes only */
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ) {
if (side != 1) return false;
int meta = stack.getItemDamage();
@@ -64,8 +43,7 @@ public class OreberryBushSecondItem extends MultiItemBlock {
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) {
Block block = world.getBlock(x, y, z);
if (block != null
&& block.canSustainPlant(world, x, y, z, ForgeDirection.UP, TinkerWorld.oreBerrySecond)
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, TinkerWorld.oreBerrySecond)
&& WorldHelper.isAirBlock(world, x, y + 1, z)) {
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
if (!player.capabilities.isCreativeMode) stack.stackSize--;
@@ -1,10 +1,12 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
public class SlimeGelItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {"blue", "green", "purple", "magma", "yellow", "red", "metal"};
public static final String[] blockTypes = { "blue", "green", "purple", "magma", "yellow", "red", "metal" };
public SlimeGelItemBlock(Block b) {
super(b, "block.slime.congealed", blockTypes);
@@ -1,10 +1,12 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
public class SlimeGrassItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {"blue", "dirt"};
public static final String[] blockTypes = { "blue", "dirt" };
public SlimeGrassItemBlock(Block b) {
super(b, "block.slime.grass", blockTypes);
@@ -1,10 +1,12 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
public class SlimeLeavesItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {"blue"};
public static final String[] blockTypes = { "blue" };
public SlimeLeavesItemBlock(Block b) {
super(b, "block.slime.leaves", blockTypes);
@@ -1,10 +1,12 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
public class SlimeSaplingItemBlock extends MultiItemBlock {
public static final String[] blockTypes = {"bluegreen"};
public static final String[] blockTypes = { "bluegreen" };
public SlimeSaplingItemBlock(Block b) {
super(b, "block.slime.sapling", blockTypes);
@@ -1,13 +1,16 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.util.*;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.relauncher.*;
public class SlimeTallGrassItem extends MultiItemBlock {
public static final String[] blockTypes = {"tallgrass", "tallgrass.fern"};
public static final String[] blockTypes = { "tallgrass", "tallgrass.fern" };
public SlimeTallGrassItem(Block b) {
super(b, "block.slime", blockTypes);
@@ -1,17 +1,20 @@
package tconstruct.world.itemblocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.*;
public class SoilSlabItem extends MultiItemBlock {
public static final String[] blockTypes = {
"grass", "dirt", "mycelium", "slime", "grout", "blueslime", "graveyardsoil", "consecratedsoil"
};
public static final String[] blockTypes = { "grass", "dirt", "mycelium", "slime", "grout", "blueslime",
"graveyardsoil", "consecratedsoil" };
public SoilSlabItem(Block b) {
super(b, "block.soil.slab", blockTypes);
@@ -1,6 +1,7 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -9,6 +10,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class WoolSlab1Item extends MultiItemBlock {
Block block;
public WoolSlab1Item(Block b) {
@@ -26,17 +28,8 @@ public class WoolSlab1Item extends MultiItemBlock {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ) {
Block b = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
@@ -1,6 +1,7 @@
package tconstruct.world.itemblocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -9,6 +10,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class WoolSlab2Item extends MultiItemBlock {
Block block;
public WoolSlab2Item(Block b) {
@@ -31,17 +33,8 @@ public class WoolSlab2Item extends MultiItemBlock {
}
@Override
public boolean onItemUse(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int trueMeta = meta % 8;
@@ -1,7 +1,7 @@
package tconstruct.world.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -10,7 +10,10 @@ import net.minecraft.potion.*;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class GoldenHead extends ItemFood {
public GoldenHead(int par2, float par3, boolean par4) {
super(par2, par3, par4);
this.setHasSubtypes(true);
@@ -1,21 +1,24 @@
package tconstruct.world.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.*;
public class OreBerries extends CraftingItem {
static String[] names = new String[] {"iron", "gold", "copper", "tin", "aluminum", "essence"};
static String[] tex = new String[] {
"oreberry_iron", "oreberry_gold", "oreberry_copper", "oreberry_tin", "oreberry_aluminum", "oreberry_essence"
};
static String[] names = new String[] { "iron", "gold", "copper", "tin", "aluminum", "essence" };
static String[] tex = new String[] { "oreberry_iron", "oreberry_gold", "oreberry_copper", "oreberry_tin",
"oreberry_aluminum", "oreberry_essence" };
public OreBerries() {
super(names, tex, "oreberries/", "tinker", TConstructRegistry.materialTab);
@@ -49,8 +52,12 @@ public class OreBerries extends CraftingItem {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (stack.getItemDamage() == 5) {
EntityXPOrb entity =
new EntityXPOrb(world, player.posX, player.posY + 1, player.posZ, itemRand.nextInt(14) + 6);
EntityXPOrb entity = new EntityXPOrb(
world,
player.posX,
player.posY + 1,
player.posZ,
itemRand.nextInt(14) + 6);
spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player);
if (!player.capabilities.isCreativeMode) stack.stackSize--;
}
@@ -1,13 +1,16 @@
package tconstruct.world.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.*;
import net.minecraft.util.*;
import cpw.mods.fml.relauncher.*;
public class SpecialFood extends ItemFood {
protected int[] hunger;
protected float[] saturation;
protected String[] unlocalizedNames;
@@ -1,20 +1,23 @@
package tconstruct.world.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.*;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class StrangeFood extends SpecialFood {
public StrangeFood() {
super(
new int[] {2, 2, 4},
new float[] {1f, 1f, 0.6f},
new String[] {"edibleslime", "edibleblood", "bacon"},
new String[] {"food/edibleslime", "food/edibleblood", "food/bacon"});
new int[] { 2, 2, 4 },
new float[] { 1f, 1f, 0.6f },
new String[] { "edibleslime", "edibleblood", "bacon" },
new String[] { "food/edibleslime", "food/edibleblood", "food/bacon" });
this.setHasSubtypes(true);
}
@@ -1,12 +1,14 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import tconstruct.util.ItemHelper;
import cpw.mods.fml.client.registry.*;
public class BarricadeRender implements ISimpleBlockRenderingHandler {
public static int model;
public BarricadeRender() {
@@ -14,8 +16,8 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block barricade, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block barricade, int modelId,
RenderBlocks renderer) {
if (modelId == model) {
int meta = world.getBlockMetadata(x, y, z);
int type = meta % 4;
@@ -4,30 +4,17 @@ import net.minecraft.client.model.ModelBase;
public class CrystalModelSmall extends ModelBase {
/*
* ModelRenderer body; ModelRendererTurbo top; ModelRendererTurbo bottom;
*
* public CrystalModelSmall() { textureWidth = 32; textureHeight = 32;
*
* body = new ModelRenderer(this, 0, 8); body.addBox(-2F, 0F, -2F, 4, 6, 4);
* body.setRotationPoint(0F, 0F, 0F); setRotation(body, 0, 0.7853982F, 0);
* top = new ModelRendererTurbo(this, 0, 0, 32, 32); top.addCone(0, 0, 0,
* 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 8);
* top.setRotationPoint(0F, -4F, 0F); setRotation(top, 0F, 0F, 0F); bottom =
* new ModelRendererTurbo(this, 0, 18, 32, 32); top.addCone(0, 10, 0, 2.8F,
* 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8); bottom.setRotationPoint(0F,
* 6F, 0F); //setRotation(bottom, 0F, 0F, 0F); }
*
* public void render (Entity entity, float f, float f1, float f2, float f3,
* float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5);
* setRotationAngles(f, f1, f2, f3, f4, f5, entity); body.render(f5);
* top.render(f5); bottom.render(f5); }
*
* private void setRotation (ModelRenderer model, float x, float y, float z)
* { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z;
* }
*
* public void setRotationAngles (float f, float f1, float f2, float f3,
* float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2,
* f3, f4, f5, entity); }
* ModelRenderer body; ModelRendererTurbo top; ModelRendererTurbo bottom; public CrystalModelSmall() { textureWidth
* = 32; textureHeight = 32; body = new ModelRenderer(this, 0, 8); body.addBox(-2F, 0F, -2F, 4, 6, 4);
* body.setRotationPoint(0F, 0F, 0F); setRotation(body, 0, 0.7853982F, 0); top = new ModelRendererTurbo(this, 0, 0,
* 32, 32); top.addCone(0, 0, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 8); top.setRotationPoint(0F, -4F,
* 0F); setRotation(top, 0F, 0F, 0F); bottom = new ModelRendererTurbo(this, 0, 18, 32, 32); top.addCone(0, 10, 0,
* 2.8F, 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8); bottom.setRotationPoint(0F, 6F, 0F); //setRotation(bottom, 0F,
* 0F, 0F); } public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
* super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); body.render(f5);
* top.render(f5); bottom.render(f5); } private void setRotation (ModelRenderer model, float x, float y, float z) {
* model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles (float f,
* float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5,
* entity); }
*/
}
@@ -1,14 +1,16 @@
package tconstruct.world.model;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.*;
import net.minecraft.util.ResourceLocation;
import tconstruct.world.entity.Crystal;
import cpw.mods.fml.relauncher.*;
@SideOnly(Side.CLIENT)
public class CrystalRender extends RenderLiving {
/** The creeper model. */
private final ModelBase creeperModel = new CrystalModelSmall();
@@ -29,17 +31,16 @@ public class CrystalRender extends RenderLiving {
}
/**
* Allows the render to do any OpenGL state modifications necessary before
* the model is rendered. Args: entityLiving, partialTickTime
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
/*
* protected void preRenderCallback(EntityLiving par1EntityLiving, float
* par2) { this.updateCreeperScale((Skyla)par1EntityLiving, par2); }
* protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) {
* this.updateCreeperScale((Skyla)par1EntityLiving, par2); }
*/
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness,
* partialTickTime
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
protected int getColorMultiplier(EntityLiving par1EntityLiving, float par2, float par3) {
return super.getColorMultiplier(par1EntityLiving, par2, par3);
@@ -1,17 +1,19 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import tconstruct.util.ItemHelper;
import cpw.mods.fml.client.registry.*;
public class OreberryRender implements ISimpleBlockRenderingHandler {
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
if (modelId == model) {
int md = world.getBlockMetadata(x, y, z);
@@ -1,12 +1,15 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.*;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.*;
public class PunjiRender implements ISimpleBlockRenderingHandler {
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
@@ -18,8 +21,8 @@ public class PunjiRender implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
RenderBlocks renderer) {
if (modelID == model) {
int metadata = world.getBlockMetadata(x, y, z);
renderer.setRenderBounds(0.4375, 0.0, 0.4375, 0.5625, 0.375f, 0.5625);
@@ -41,18 +44,14 @@ public class PunjiRender implements ISimpleBlockRenderingHandler {
renderer.renderStandardBlock(block, x, y, z);
}
/*
* if (metadata == 5) { renderer.setRenderBounds(0.0F, 0.0, 0.0F,
* 1.0F, 0.875F, 1.0F); renderer.renderStandardBlock(block, x, y,
* z); } else { renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F,
* 1.0F, 1.0F); renderer.renderStandardBlock(block, x, y, z);
* renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
* renderer.renderStandardBlock(block, x, y, z);
* renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
* renderer.renderStandardBlock(block, x, y, z);
* renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
* renderer.renderStandardBlock(block, x, y, z);
* renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
* renderer.renderStandardBlock(block, x, y, z); }
* if (metadata == 5) { renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
* renderer.renderStandardBlock(block, x, y, z); } else { renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F,
* 1.0F, 1.0F); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.0F, 0.0F, 0.0F,
* 0.25F, 0.75F, 0.25F); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.75F, 0.0F,
* 0.0F, 1.0F, 0.75F, 0.25F); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.0F,
* 0.0F, 0.75F, 0.25F, 0.75F, 1.0F); renderer.renderStandardBlock(block, x, y, z);
* renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F); renderer.renderStandardBlock(block, x,
* y, z); }
*/
return true;
}
@@ -1,12 +1,14 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import tconstruct.mechworks.landmine.Helper;
import cpw.mods.fml.client.registry.*;
/**
*
@@ -29,8 +31,8 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
if (modelId == getRenderId()) {
renderBasedOnSide(world, x, y, z, block, modelId, renderer);
return true;
@@ -40,8 +42,8 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler {
}
@SuppressWarnings("incomplete-switch")
public void renderBasedOnSide(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public void renderBasedOnSide(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
int l = world.getBlockMetadata(x, y, z);
int i1 = l & 7;
boolean flag = (l & 8) > 0;
@@ -1,13 +1,15 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.*;
import net.minecraft.util.*;
import net.minecraft.world.IBlockAccess;
import tconstruct.util.ItemHelper;
import cpw.mods.fml.client.registry.*;
public class SlimeChannelRender implements ISimpleBlockRenderingHandler {
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
@@ -18,8 +20,8 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
RenderBlocks renderer) {
if (modelID == model) {
renderRotatedBlock(block, x, y, z, world, renderer);
return true;
@@ -74,13 +76,10 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler {
tessellator.addVertexWithUV(x + 1, y + 0.5, z + 0, u3, v3);
renderer.renderStandardBlock(block, x, y, z);
/*
* int direction = world.getBlockMetadata(x, y, z) % 4; if (direction ==
* 0) renderer.uvRotateTop = 2; if (direction == 1) renderer.uvRotateTop
* = 1; if (direction == 2) renderer.uvRotateTop = 0; if (direction ==
* 3) renderer.uvRotateTop = 3;
*
* boolean flag = renderer.renderStandardBlock(block, x, y, z);
* renderer.uvRotateTop = 0; return flag;
* int direction = world.getBlockMetadata(x, y, z) % 4; if (direction == 0) renderer.uvRotateTop = 2; if
* (direction == 1) renderer.uvRotateTop = 1; if (direction == 2) renderer.uvRotateTop = 0; if (direction == 3)
* renderer.uvRotateTop = 3; boolean flag = renderer.renderStandardBlock(block, x, y, z); renderer.uvRotateTop =
* 0; return flag;
*/
return true;
}
@@ -1,11 +1,13 @@
package tconstruct.world.model;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.model.*;
import net.minecraft.entity.Entity;
import cpw.mods.fml.relauncher.*;
@SideOnly(Side.CLIENT)
public class SlimeModel extends ModelBase {
/** The slime's bodies, both the inside box and the outside box */
ModelRenderer slimeBodies;
@@ -1,15 +1,17 @@
package tconstruct.world.model;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import tconstruct.client.BlockSkinRenderHelper;
import tconstruct.util.ItemHelper;
import tconstruct.world.TinkerWorld;
import tconstruct.world.blocks.SlimePad;
import cpw.mods.fml.client.registry.*;
public class SlimePadRender implements ISimpleBlockRenderingHandler {
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
@@ -22,8 +24,8 @@ public class SlimePadRender implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
RenderBlocks renderer) {
if (modelID == model) {
renderer.setRenderBounds(0f, 0, 0f, 1f, 0.5f, 1f);
int metadata = world.getBlockMetadata(x, y, z);
@@ -58,23 +60,23 @@ public class SlimePadRender implements ISimpleBlockRenderingHandler {
// xMin, zMin, xMax, zMax
switch (meta) {
case 0:
return new float[] {0.375f, 0.6875f, 0.625f, 0.9375f};
return new float[] { 0.375f, 0.6875f, 0.625f, 0.9375f };
case 1:
return new float[] {0.0625f, 0.6875f, 0.3125f, 0.9375f};
return new float[] { 0.0625f, 0.6875f, 0.3125f, 0.9375f };
case 2:
return new float[] {0.0625f, 0.375f, 0.3125f, 0.625f};
return new float[] { 0.0625f, 0.375f, 0.3125f, 0.625f };
case 3:
return new float[] {0.0625f, 0.0625f, 0.3125f, 0.3125f};
return new float[] { 0.0625f, 0.0625f, 0.3125f, 0.3125f };
case 4:
return new float[] {0.375f, 0.0625f, 0.625f, 0.3125f};
return new float[] { 0.375f, 0.0625f, 0.625f, 0.3125f };
case 5:
return new float[] {0.6875f, 0.0625f, 0.9375f, 0.3125f};
return new float[] { 0.6875f, 0.0625f, 0.9375f, 0.3125f };
case 6:
return new float[] {0.6875f, 0.375f, 0.9375f, 0.625f};
return new float[] { 0.6875f, 0.375f, 0.9375f, 0.625f };
case 7:
return new float[] {0.6875f, 0.6875f, 0.9375f, 0.9375f};
return new float[] { 0.6875f, 0.6875f, 0.9375f, 0.9375f };
}
return new float[] {0.375f, 0.375f, 0.625f, 0.625f};
return new float[] { 0.375f, 0.375f, 0.625f, 0.625f };
}
@Override
@@ -1,17 +1,20 @@
package tconstruct.world.model;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.*;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import tconstruct.world.entity.KingBlueSlime;
import tconstruct.world.entity.SlimeBase;
import cpw.mods.fml.relauncher.*;
@SideOnly(Side.CLIENT)
public class SlimeRender extends RenderLiving {
static final ResourceLocation texture = new ResourceLocation("tinker", "textures/mob/slimeedible.png");
private final ModelBase scaleAmount;
@@ -60,8 +63,8 @@ public class SlimeRender extends RenderLiving {
}
/**
* Allows the render to do any OpenGL state modifications necessary before
* the model is rendered. Args: entityLiving, partialTickTime
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
@Override
protected void preRenderCallback(EntityLivingBase par1EntityLiving, float par2) {
@@ -1,38 +1,41 @@
package tconstruct.world.village;
import java.util.*;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
import tconstruct.smeltery.TinkerSmeltery;
public class ComponentSmeltery extends StructureVillagePieces.House1 {
private int averageGroundLevel = -1;
public ComponentSmeltery() {}
public ComponentSmeltery(
Start villagePiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) {
public ComponentSmeltery(Start villagePiece, int par2, Random par3Random,
StructureBoundingBox par4StructureBoundingBox, int par5) {
super();
this.coordBaseMode = par5;
this.boundingBox = par4StructureBoundingBox;
}
public static ComponentSmeltery buildComponent(
Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) {
StructureBoundingBox structureboundingbox =
StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 9, 3, 7, p4);
public static ComponentSmeltery buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2,
int p3, int p4, int p5) {
StructureBoundingBox structureboundingbox = StructureBoundingBox
.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 9, 3, 7, p4);
return canVillageGoDeeper(structureboundingbox)
&& StructureComponent.findIntersecting(pieces, structureboundingbox) == null
? new ComponentSmeltery(villagePiece, p5, random, structureboundingbox, p4)
: null;
&& StructureComponent.findIntersecting(pieces, structureboundingbox) == null
? new ComponentSmeltery(villagePiece, p5, random, structureboundingbox, p4)
: null;
}
/**
* second Part of Structure generating, this for example places Spiderwebs,
* Mob Spawners, it closes Mineshafts at the end, it adds Fences...
* second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
* the end, it adds Fences...
*/
@Override
public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) {
@@ -47,8 +50,8 @@ public class ComponentSmeltery extends StructureVillagePieces.House1 {
}
/**
* arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int
* maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
* arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY,
* int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
*/
this.fillWithBlocks(world, sbb, 1, 0, 0, 7, 0, 6, Blocks.stonebrick, Blocks.stonebrick, false); // Base
this.fillWithBlocks(world, sbb, 0, 0, 1, 0, 0, 5, Blocks.stonebrick, Blocks.stonebrick, false);
@@ -56,7 +59,19 @@ public class ComponentSmeltery extends StructureVillagePieces.House1 {
this.fillWithBlocks(world, sbb, 0, 1, 0, 9, 3, 7, Blocks.air, Blocks.air, false);
this.fillWithMetaBlocks(
world, sbb, 2, 0, 1, 6, 2, 5, TinkerSmeltery.smeltery, 2, TinkerSmeltery.smeltery, 2, false); // Basin
world,
sbb,
2,
0,
1,
6,
2,
5,
TinkerSmeltery.smeltery,
2,
TinkerSmeltery.smeltery,
2,
false); // Basin
this.fillWithBlocks(world, sbb, 3, 1, 2, 5, 2, 4, Blocks.air, Blocks.air, false);
this.placeBlockAtCurrentPosition(world, TinkerSmeltery.searedBlock, 0, 1, 1, 2, sbb);
@@ -80,25 +95,26 @@ public class ComponentSmeltery extends StructureVillagePieces.House1 {
return true;
}
protected void fillWithMetaBlocks(
World par1World,
StructureBoundingBox par2StructureBoundingBox,
int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ,
Block placeBlockID,
int placeBlockMeta,
Block replaceBlockID,
int replaceBlockMeta,
boolean alwaysReplace) {
protected void fillWithMetaBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int minX,
int minY, int minZ, int maxX, int maxY, int maxZ, Block placeBlockID, int placeBlockMeta,
Block replaceBlockID, int replaceBlockMeta, boolean alwaysReplace) {
Block i2 = this.func_151558_b(placeBlockID, placeBlockMeta);
int j2 = this.func_151557_c(placeBlockID, placeBlockMeta);
Block k2 = this.func_151558_b(replaceBlockID, replaceBlockMeta);
int l2 = this.func_151557_c(replaceBlockID, replaceBlockMeta);
super.fillWithMetadataBlocks(
par1World, par2StructureBoundingBox, minX, minY, minZ, maxX, maxY, maxZ, i2, j2, k2, l2, alwaysReplace);
par1World,
par2StructureBoundingBox,
minX,
minY,
minZ,
maxX,
maxY,
maxZ,
i2,
j2,
k2,
l2,
alwaysReplace);
}
}
@@ -1,40 +1,43 @@
package tconstruct.world.village;
import java.util.*;
import net.minecraft.init.Blocks;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
import tconstruct.tools.TinkerTools;
import tconstruct.tools.logic.*;
import tconstruct.world.TinkerWorld;
public class ComponentToolWorkshop extends StructureVillagePieces.House1 {
private int averageGroundLevel = -1;
public ComponentToolWorkshop() {}
public ComponentToolWorkshop(
Start villagePiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) {
public ComponentToolWorkshop(Start villagePiece, int par2, Random par3Random,
StructureBoundingBox par4StructureBoundingBox, int par5) {
super();
this.coordBaseMode = par5;
this.boundingBox = par4StructureBoundingBox;
}
public static ComponentToolWorkshop buildComponent(
Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) {
StructureBoundingBox structureboundingbox =
StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4);
public static ComponentToolWorkshop buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2,
int p3, int p4, int p5) {
StructureBoundingBox structureboundingbox = StructureBoundingBox
.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4);
return canVillageGoDeeper(structureboundingbox)
&& StructureComponent.findIntersecting(pieces, structureboundingbox) == null
? new ComponentToolWorkshop(villagePiece, p5, random, structureboundingbox, p4)
: null;
&& StructureComponent.findIntersecting(pieces, structureboundingbox) == null
? new ComponentToolWorkshop(villagePiece, p5, random, structureboundingbox, p4)
: null;
}
/**
* second Part of Structure generating, this for example places Spiderwebs,
* Mob Spawners, it closes Mineshafts at the end, it adds Fences...
* second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
* the end, it adds Fences...
*/
@Override
public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb) {
@@ -49,9 +52,8 @@ public class ComponentToolWorkshop extends StructureVillagePieces.House1 {
}
/**
* arguments: (World worldObj, StructureBoundingBox structBB, int minX,
* int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId,
* int replaceBlockId, boolean alwaysreplace)
* arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY,
* int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
*/
this.fillWithBlocks(world, sbb, 0, 0, 0, 6, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false); // Base
this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Blocks.fence, Blocks.fence, false);
@@ -168,15 +170,9 @@ public class ComponentToolWorkshop extends StructureVillagePieces.House1 {
return true;
}
protected boolean generateStructureCraftingStationContents(
World world,
StructureBoundingBox par2StructureBoundingBox,
Random random,
int x,
int y,
int z,
WeightedRandomChestContent[] content,
int par8) {
protected boolean generateStructureCraftingStationContents(World world,
StructureBoundingBox par2StructureBoundingBox, Random random, int x, int y, int z,
WeightedRandomChestContent[] content, int par8) {
int posX = this.getXWithOffset(x, z);
int posY = this.getYWithOffset(y);
int posZ = this.getZWithOffset(x, z);
@@ -196,15 +192,8 @@ public class ComponentToolWorkshop extends StructureVillagePieces.House1 {
}
}
protected boolean generateStructurePatternChestContents(
World world,
StructureBoundingBox par2StructureBoundingBox,
Random random,
int x,
int y,
int z,
WeightedRandomChestContent[] content,
int par8) {
protected boolean generateStructurePatternChestContents(World world, StructureBoundingBox par2StructureBoundingBox,
Random random, int x, int y, int z, WeightedRandomChestContent[] content, int par8) {
int posX = this.getXWithOffset(x, z);
int posY = this.getYWithOffset(y);
int posZ = this.getZWithOffset(x, z);
@@ -225,8 +214,7 @@ public class ComponentToolWorkshop extends StructureVillagePieces.House1 {
}
/**
* Returns the villager type to spawn in this component, based on the number
* of villagers already spawned.
* Returns the villager type to spawn in this component, based on the number of villagers already spawned.
*/
@Override
protected int getVillagerType(int par1) {
@@ -1,14 +1,16 @@
package tconstruct.world.village;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
import java.util.*;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.village.*;
import tconstruct.mechworks.TinkerMechworks;
import tconstruct.tools.TinkerTools;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
public class TVillageTrades implements IVillageTradeHandler {
@@ -1,11 +1,14 @@
package tconstruct.world.village;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
import java.util.*;
import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
public class VillageSmelteryHandler implements IVillageCreationHandler {
@Override
public PieceWeight getVillagePieceWeight(Random random, int i) {
return new PieceWeight(ComponentSmeltery.class, 9, 1);
@@ -17,16 +20,8 @@ public class VillageSmelteryHandler implements IVillageCreationHandler {
}
@Override
public Object buildComponent(
PieceWeight villagePiece,
Start startPiece,
List pieces,
Random random,
int p1,
int p2,
int p3,
int p4,
int p5) {
public Object buildComponent(PieceWeight villagePiece, Start startPiece, List pieces, Random random, int p1, int p2,
int p3, int p4, int p5) {
return ComponentSmeltery.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
}
}
@@ -1,11 +1,14 @@
package tconstruct.world.village;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
import java.util.*;
import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
public class VillageToolStationHandler implements IVillageCreationHandler {
@Override
public PieceWeight getVillagePieceWeight(Random random, int i) {
return new PieceWeight(ComponentToolWorkshop.class, 30, i + random.nextInt(4));
@@ -17,16 +20,8 @@ public class VillageToolStationHandler implements IVillageCreationHandler {
}
@Override
public Object buildComponent(
PieceWeight villagePiece,
Start startPiece,
List pieces,
Random random,
int p1,
int p2,
int p3,
int p4,
int p5) {
public Object buildComponent(PieceWeight villagePiece, Start startPiece, List pieces, Random random, int p1, int p2,
int p3, int p4, int p5) {
return ComponentToolWorkshop.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
}
}