Update Readme
This commit is contained in:
parent
49a2658129
commit
12b99e6f32
@ -2,4 +2,6 @@ Tinker's Construct - 1.5
|
||||
|
||||
Modify all the things, then do it again!
|
||||
Melt down any metals you find.
|
||||
Turn everything into golems!
|
||||
Turn everything into golems!
|
||||
|
||||
Most code is public domain; any that isn't has a note in their folders
|
||||
|
@ -21,7 +21,9 @@ import mods.tinker.tconstruct.crafting.Smeltery;
|
||||
import mods.tinker.tconstruct.crafting.ToolBuilder;
|
||||
import mods.tinker.tconstruct.entity.CartEntity;
|
||||
import mods.tinker.tconstruct.entity.Crystal;
|
||||
import mods.tinker.tconstruct.entity.EdibleSlime;
|
||||
import mods.tinker.tconstruct.entity.Skyla;
|
||||
import mods.tinker.tconstruct.entity.UnstableCreeper;
|
||||
import mods.tinker.tconstruct.items.CraftedSoilItemBlock;
|
||||
import mods.tinker.tconstruct.items.CraftingItem;
|
||||
import mods.tinker.tconstruct.items.FilledBucket;
|
||||
@ -73,10 +75,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.liquids.LiquidContainerData;
|
||||
import net.minecraftforge.liquids.LiquidContainerRegistry;
|
||||
@ -178,6 +182,13 @@ public class TContent implements IFuelHandler
|
||||
EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
|
||||
|
||||
EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
|
||||
EntityRegistry.registerModEntity(UnstableCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(EdibleSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
|
||||
|
||||
BiomeGenBase[] overworldBiomes = new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga,
|
||||
BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach,
|
||||
BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills };
|
||||
EntityRegistry.addSpawn(UnstableCreeper.class, 8, 4, 6, EnumCreatureType.monster, overworldBiomes);
|
||||
}
|
||||
|
||||
void registerBlocks ()
|
||||
@ -194,26 +205,13 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.registerBlock(heldItemBlock, "HeldItemBlock");
|
||||
GameRegistry.registerTileEntity(FrypanLogic.class, "FrypanLogic");
|
||||
|
||||
String[] soilTypes = new String[] {
|
||||
"slimesand",
|
||||
"grout"
|
||||
};
|
||||
String[] soilTypes = new String[] { "slimesand", "grout" };
|
||||
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, Material.sand, 3.0F, soilTypes);
|
||||
craftedSoil.stepSound = Block.soundGravelFootstep;
|
||||
GameRegistry.registerBlock(craftedSoil, CraftedSoilItemBlock.class, "CraftedSoil");
|
||||
|
||||
String[] metalTypes = new String[] {
|
||||
"compressed_cobalt",
|
||||
"compressed_ardite",
|
||||
"compressed_manyullyn",
|
||||
"compressed_copper",
|
||||
"compressed_bronze",
|
||||
"compressed_tin",
|
||||
"compressed_aluminum",
|
||||
"compressed_alubrass",
|
||||
"compressed_alumite",
|
||||
"compressed_steel"
|
||||
};
|
||||
String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn", "compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum",
|
||||
"compressed_alubrass", "compressed_alumite", "compressed_steel" };
|
||||
metalBlock = new TConstructBlock(PHConstruct.metalBlock, Material.iron, 10.0F, metalTypes);
|
||||
metalBlock.stepSound = Block.soundMetalFootstep;
|
||||
GameRegistry.registerBlock(metalBlock, MetalItemBlock.class, "MetalBlock");
|
||||
@ -235,18 +233,10 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.registerTileEntity(CastingTableLogic.class, "CastingTable");
|
||||
GameRegistry.registerTileEntity(FaucetLogic.class, "Faucet");
|
||||
|
||||
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" };
|
||||
oreSlag = new MetalOre(PHConstruct.oreSlag, Material.iron, 10.0F, oreTypes);
|
||||
GameRegistry.registerBlock(oreSlag, MetalOreItemBlock.class, "SearedBrick");
|
||||
MinecraftForge.setBlockHarvestLevel(oreSlag, 0, "pickaxe", 2);
|
||||
//MinecraftForge.setBlockHarvestLevel(oreSlag, 0, "pickaxe", 0);
|
||||
MinecraftForge.setBlockHarvestLevel(oreSlag, 1, "pickaxe", 4);
|
||||
MinecraftForge.setBlockHarvestLevel(oreSlag, 2, "pickaxe", 4);
|
||||
MinecraftForge.setBlockHarvestLevel(oreSlag, 3, "pickaxe", 1);
|
||||
@ -269,15 +259,13 @@ public class TContent implements IFuelHandler
|
||||
void registerItems ()
|
||||
{
|
||||
titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon");
|
||||
String[] blanks = new String[] {"blank_pattern", "blank_cast"};
|
||||
String[] blanks = new String[] { "blank_pattern", "blank_cast" };
|
||||
blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/").setUnlocalizedName("tconstruct.Pattern");
|
||||
String[] craftingMaterials = new String[] {
|
||||
"PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone",
|
||||
"CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" };
|
||||
String[] craftingTextures = new String[] {
|
||||
"material_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot",
|
||||
"material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot",
|
||||
"material_aluminumraw", "material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot" };
|
||||
String[] craftingMaterials = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone",
|
||||
"CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" };
|
||||
String[] craftingTextures = new String[] { "material_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot",
|
||||
"material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot", "material_aluminumraw",
|
||||
"material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot" };
|
||||
materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials");
|
||||
toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod");
|
||||
toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_chunk").setUnlocalizedName("tconstruct.ToolShard");
|
||||
@ -372,7 +360,7 @@ public class TContent implements IFuelHandler
|
||||
pb.registerMaterial(Block.cobblestone, 2, "Stone");
|
||||
}
|
||||
//else
|
||||
//pb.registerMaterialSet("Stone", new ItemStack(TContent.toolShard, 1, 1), new ItemStack(TContent.toolRod, 1, 1), 1);
|
||||
//pb.registerMaterialSet("Stone", new ItemStack(TContent.toolShard, 1, 1), new ItemStack(TContent.toolRod, 1, 1), 1);
|
||||
pb.registerFullMaterial(Item.ingotIron, 2, "Iron", 2);
|
||||
pb.registerFullMaterial(Item.flint, 2, "Flint", 3);
|
||||
if (PHConstruct.enableTCactus)
|
||||
@ -446,7 +434,7 @@ public class TContent implements IFuelHandler
|
||||
}
|
||||
|
||||
RecipeRemover.removeShapedRecipes(removeTools);
|
||||
|
||||
|
||||
patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, axeHead, swordBlade, largeGuard, medGuard, crossbar, binding, frypanHead, signHead };
|
||||
|
||||
ToolBuilder tb = ToolBuilder.instance;
|
||||
@ -502,7 +490,9 @@ public class TContent implements IFuelHandler
|
||||
// obsidian
|
||||
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, 1, 12), ingotcast, 50); //steel
|
||||
|
||||
liquids = new LiquidStack[] { new LiquidStack(liquidMetalStill.blockID, 1, 0), new LiquidStack(liquidMetalStill.blockID, 1, 2), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6), new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 7), new LiquidStack(liquidMetalStill.blockID, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 12) };
|
||||
liquids = new LiquidStack[] { new LiquidStack(liquidMetalStill.blockID, 1, 0), new LiquidStack(liquidMetalStill.blockID, 1, 2), new LiquidStack(liquidMetalStill.blockID, 1, 5),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 6), new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 7),
|
||||
new LiquidStack(liquidMetalStill.blockID, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 12) };
|
||||
int[] liquidDamage = new int[] { 2, 13, 10, 11, 12, 14, 15, 16 };
|
||||
|
||||
for (int iter = 0; iter < patternOutputs.length; iter++)
|
||||
@ -535,7 +525,8 @@ public class TContent implements IFuelHandler
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 8), new LiquidStack(liquidMetalStill.blockID, 3, 4), new LiquidStack(liquidMetalStill.blockID, 1, 2)); //Aluminum Brass
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 9), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6)); //Manyullyn
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 9, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(liquidMetalStill.blockID, 2, 11)); //Alumite
|
||||
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 9, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(
|
||||
liquidMetalStill.blockID, 2, 11)); //Alumite
|
||||
}
|
||||
|
||||
void addCraftingRecipes ()
|
||||
|
@ -22,4 +22,6 @@ public class TProxyCommon
|
||||
{
|
||||
return new File(".");
|
||||
}
|
||||
|
||||
public void spawnParticle (String slimeParticle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) {}
|
||||
}
|
||||
|
@ -19,11 +19,44 @@ import mods.tinker.tconstruct.client.entityrender.SkylaRender;
|
||||
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
|
||||
import mods.tinker.tconstruct.entity.CartEntity;
|
||||
import mods.tinker.tconstruct.entity.Crystal;
|
||||
import mods.tinker.tconstruct.entity.EdibleSlime;
|
||||
import mods.tinker.tconstruct.entity.Skyla;
|
||||
import mods.tinker.tconstruct.entity.UnstableCreeper;
|
||||
import mods.tinker.tconstruct.logic.CastingTableLogic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelSlime;
|
||||
import net.minecraft.client.particle.EntityAuraFX;
|
||||
import net.minecraft.client.particle.EntityBreakingFX;
|
||||
import net.minecraft.client.particle.EntityBubbleFX;
|
||||
import net.minecraft.client.particle.EntityCloudFX;
|
||||
import net.minecraft.client.particle.EntityCritFX;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
import net.minecraft.client.particle.EntityDropParticleFX;
|
||||
import net.minecraft.client.particle.EntityEnchantmentTableParticleFX;
|
||||
import net.minecraft.client.particle.EntityExplodeFX;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.particle.EntityFireworkSparkFX;
|
||||
import net.minecraft.client.particle.EntityFlameFX;
|
||||
import net.minecraft.client.particle.EntityFootStepFX;
|
||||
import net.minecraft.client.particle.EntityHeartFX;
|
||||
import net.minecraft.client.particle.EntityHugeExplodeFX;
|
||||
import net.minecraft.client.particle.EntityLargeExplodeFX;
|
||||
import net.minecraft.client.particle.EntityLavaFX;
|
||||
import net.minecraft.client.particle.EntityNoteFX;
|
||||
import net.minecraft.client.particle.EntityPortalFX;
|
||||
import net.minecraft.client.particle.EntityReddustFX;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.particle.EntitySnowShovelFX;
|
||||
import net.minecraft.client.particle.EntitySpellParticleFX;
|
||||
import net.minecraft.client.particle.EntitySplashFX;
|
||||
import net.minecraft.client.particle.EntitySuspendFX;
|
||||
import net.minecraft.client.renderer.entity.RenderCreeper;
|
||||
import net.minecraft.client.renderer.entity.RenderSlime;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
|
||||
@ -32,9 +65,7 @@ import org.w3c.dom.Document;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -43,6 +74,7 @@ public class TProxyClient extends TProxyCommon
|
||||
{
|
||||
public static SmallFontRenderer smallFontRenderer;
|
||||
public static Icon blankSprite;
|
||||
public static Minecraft mc;
|
||||
|
||||
/* Registers any rendering code. */
|
||||
public void registerRenderer ()
|
||||
@ -72,6 +104,8 @@ public class TProxyClient extends TProxyCommon
|
||||
RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new SkylaRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender());
|
||||
RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EdibleSlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
|
||||
//RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo!
|
||||
|
||||
addRenderMappings();
|
||||
@ -80,10 +114,6 @@ public class TProxyClient extends TProxyCommon
|
||||
/* Ties an internal name to a visible one. */
|
||||
public void addNames ()
|
||||
{
|
||||
//LanguageRegistry.addName(TContent.lavaTank, "Lava Tank");
|
||||
/*LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructTools", "TConstruct Tools");
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructMaterials", "TConstruct Materials");
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructBlocks", "TConstruct Blocks");*/
|
||||
|
||||
String langDir = "/mods/tinker/resources/lang/";
|
||||
String[] langFiles = { "en_US.xml" };
|
||||
@ -100,36 +130,6 @@ public class TProxyClient extends TProxyCommon
|
||||
}
|
||||
}
|
||||
|
||||
/*LanguageRegistry.instance().addStringLocalization("crafters.ToolStation", "Tool Station");
|
||||
LanguageRegistry.instance().addStringLocalization("crafters.PartBuilder", "Part Builder");
|
||||
LanguageRegistry.instance().addStringLocalization("crafters.PatternShaper", "Pattern Shaper");
|
||||
LanguageRegistry.instance().addStringLocalization("inventory.PatternChest", "Pattern Chest");
|
||||
LanguageRegistry.instance().addStringLocalization("crafters.Smeltery", "Smeltery");
|
||||
LanguageRegistry.instance().addStringLocalization("crafters.Frypan", "Frying Pan");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("ToolStation.Crafter.name", "Tool Station");
|
||||
LanguageRegistry.instance().addStringLocalization("ToolStation.Parts.name", "Part Builder");
|
||||
LanguageRegistry.instance().addStringLocalization("ToolStation.PatternChest.name", "Pattern Chest");
|
||||
LanguageRegistry.instance().addStringLocalization("ToolStation.PatternShaper.name", "Stencil Table");
|
||||
LanguageRegistry.instance().addStringLocalization("ToolStation.CastingTable.name", "Casting Table");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("CraftedSoil.Slime.name", "Slimy Mud");
|
||||
LanguageRegistry.instance().addStringLocalization("CraftedSoil.Grout.name", "Grout");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.NetherSlag.name", "Netherack Slag");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Cobalt.name", "Cobalt Ore");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Ardite.name", "Ardite Ore");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Copper.name", "Copper Ore");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Tin.name", "Tin Ore");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Aluminum.name", "Aluminum Ore");
|
||||
LanguageRegistry.instance().addStringLocalization("MetalOre.Slag.name", "Stone Slag");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("Smeltery.Controller.name", "Smeltery");
|
||||
LanguageRegistry.instance().addStringLocalization("Smeltery.Drain.name", "Smeltery Drain");
|
||||
LanguageRegistry.instance().addStringLocalization("Smeltery.Brick.name", "Seared Bricks");
|
||||
LanguageRegistry.instance().addStringLocalization("Smeltery.Gague.name", "Seared Glass");
|
||||
LanguageRegistry.instance().addStringLocalization("Smeltery.Window.name", "Seared Window");*/
|
||||
|
||||
for (int mat = 0; mat < materialTypes.length; mat++)
|
||||
{
|
||||
for (int type = 0; type < toolMaterialNames.length; type++)
|
||||
@ -166,6 +166,9 @@ public class TProxyClient extends TProxyCommon
|
||||
|
||||
//LanguageRegistry.addName(TContent.manualBook, "Tinker's Log");
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Unstable Creeper");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.EdibleSlime.name", "en_US", "Blue Slime");
|
||||
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.MetalSlime.name", "en_US", "Metal Slime");
|
||||
LanguageRegistry.instance().addStringLocalization("item.tconstruct.diary.diary.name", "en_US", "Tinker's Log");
|
||||
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_pattern.name", "en_US", "Blank Pattern");
|
||||
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_cast.name", "en_US", "Cast");
|
||||
@ -181,34 +184,6 @@ public class TProxyClient extends TProxyCommon
|
||||
LanguageRegistry.addName(TContent.mattock, "Mattock");
|
||||
//LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe");
|
||||
|
||||
/*LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
|
||||
LanguageRegistry.addName(TContent.ironStill, "Liquid Iron");
|
||||
LanguageRegistry.addName(TContent.goldFlowing, "Liquid Gold");
|
||||
LanguageRegistry.addName(TContent.goldStill, "Liquid Gold");
|
||||
LanguageRegistry.addName(TContent.copperFlowing, "Liquid Copper");
|
||||
LanguageRegistry.addName(TContent.copperStill, "Liquid Copper");
|
||||
LanguageRegistry.addName(TContent.tinFlowing, "Liquid Tin");
|
||||
LanguageRegistry.addName(TContent.tinStill, "Liquid Tin");
|
||||
LanguageRegistry.addName(TContent.aluminumFlowing, "Liquid Aluminum");
|
||||
LanguageRegistry.addName(TContent.aluminumStill, "Liquid Aluminum");
|
||||
LanguageRegistry.addName(TContent.cobaltFlowing, "Liquid Cobalt");
|
||||
LanguageRegistry.addName(TContent.cobaltStill, "Liquid Cobalt");
|
||||
LanguageRegistry.addName(TContent.arditeFlowing, "Liquid Ardite");
|
||||
LanguageRegistry.addName(TContent.arditeStill, "Liquid Ardite");
|
||||
|
||||
LanguageRegistry.addName(TContent.bronzeFlowing, "Liquid Bronze");
|
||||
LanguageRegistry.addName(TContent.bronzeStill, "Liquid Bronze");
|
||||
LanguageRegistry.addName(TContent.alBrassFlowing, "Liquid Brass");
|
||||
LanguageRegistry.addName(TContent.alBrassStill, "Liquid Brass");
|
||||
LanguageRegistry.addName(TContent.alumiteFlowing, "Liquid Alumite");
|
||||
LanguageRegistry.addName(TContent.alumiteStill, "Liquid Alumite");
|
||||
LanguageRegistry.addName(TContent.manyullynFlowing, "Liquid Manyullyn");
|
||||
LanguageRegistry.addName(TContent.manyullynStill, "Liquid Manyullyn");
|
||||
LanguageRegistry.addName(TContent.obsidianFlowing, "Liquid Obsidian");
|
||||
LanguageRegistry.addName(TContent.obsidianStill, "Liquid Obsidian");
|
||||
LanguageRegistry.addName(TContent.steelFlowing, "Liquid Steel");
|
||||
LanguageRegistry.addName(TContent.steelStill, "Liquid Steel");*/
|
||||
|
||||
addToolButtons();
|
||||
}
|
||||
|
||||
@ -389,4 +364,224 @@ public class TProxyClient extends TProxyCommon
|
||||
settings.keyBindings = allKeys;
|
||||
settings.loadOptions();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (this.mc == null)
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
|
||||
if ( this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
|
||||
{
|
||||
int i = this.mc.gameSettings.particleSetting;
|
||||
|
||||
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
|
||||
{
|
||||
i = 2;
|
||||
}
|
||||
|
||||
double d6 = this.mc.renderViewEntity.posX - par2;
|
||||
double d7 = this.mc.renderViewEntity.posY - par4;
|
||||
double d8 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX entityfx = null;
|
||||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("largeexplode"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("fireworksSpark"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
return (EntityFX)entityfx;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d9 = 16.0D;
|
||||
|
||||
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par1Str.equals("bubble"))
|
||||
{
|
||||
entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("suspended"))
|
||||
{
|
||||
entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("depthsuspend"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("townaura"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("crit"))
|
||||
{
|
||||
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("magicCrit"))
|
||||
{
|
||||
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntityFX)entityfx).setRBGColorF(((EntityFX)entityfx).getRedColorF() * 0.3F, ((EntityFX)entityfx).getGreenColorF() * 0.8F, ((EntityFX)entityfx).getBlueColorF());
|
||||
((EntityFX)entityfx).func_94053_h();
|
||||
}
|
||||
else if (par1Str.equals("smoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX)entityfx).setRBGColorF((float)par8, (float)par10, (float)par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpellAmbient"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX)entityfx).setAlphaF(0.15F);
|
||||
((EntityFX)entityfx).setRBGColorF((float)par8, (float)par10, (float)par12);
|
||||
}
|
||||
else if (par1Str.equals("spell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("instantSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);
|
||||
}
|
||||
else if (par1Str.equals("witchMagic"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144);
|
||||
float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F;
|
||||
((EntityFX)entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
|
||||
}
|
||||
else if (par1Str.equals("note"))
|
||||
{
|
||||
entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("portal"))
|
||||
{
|
||||
entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("enchantmenttable"))
|
||||
{
|
||||
entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("explode"))
|
||||
{
|
||||
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("flame"))
|
||||
{
|
||||
entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("lava"))
|
||||
{
|
||||
entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("footstep"))
|
||||
{
|
||||
entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("splash"))
|
||||
{
|
||||
entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("largesmoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F);
|
||||
}
|
||||
else if (par1Str.equals("cloud"))
|
||||
{
|
||||
entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("reddust"))
|
||||
{
|
||||
entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float)par8, (float)par10, (float)par12);
|
||||
}
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.snowball, mc.renderEngine);
|
||||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
|
||||
}
|
||||
else if (par1Str.equals("dripLava"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava);
|
||||
}
|
||||
else if (par1Str.equals("snowshovel"))
|
||||
{
|
||||
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("slime"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine);
|
||||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("angryVillager"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12);
|
||||
((EntityFX)entityfx).setParticleTextureIndex(81);
|
||||
((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else if (par1Str.equals("happyVillager"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntityFX)entityfx).setParticleTextureIndex(82);
|
||||
((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else if (par1Str.startsWith("iconcrack_"))
|
||||
{
|
||||
int j = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[j], mc.renderEngine);
|
||||
}
|
||||
else if (par1Str.startsWith("tilecrack_"))
|
||||
{
|
||||
String[] astring = par1Str.split("_", 3);
|
||||
int k = Integer.parseInt(astring[1]);
|
||||
int l = Integer.parseInt(astring[2]);
|
||||
entityfx = (new EntityDiggingFX(mc.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[k], 0, l, mc.renderEngine)).applyRenderColor(l);
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
this.mc.effectRenderer.addEffect((EntityFX)entityfx);
|
||||
}
|
||||
|
||||
return (EntityFX)entityfx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
349
mods/tinker/tconstruct/entity/EdibleSlime.java
Normal file
349
mods/tinker/tconstruct/entity/EdibleSlime.java
Normal file
@ -0,0 +1,349 @@
|
||||
package mods.tinker.tconstruct.entity;
|
||||
|
||||
import mods.tinker.tconstruct.TConstruct;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EdibleSlime extends EntityLiving implements IMob
|
||||
{
|
||||
private static final float[] field_100000_e = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F};
|
||||
public float field_70813_a;
|
||||
public float field_70811_b;
|
||||
public float field_70812_c;
|
||||
|
||||
/** the time between each jump of the slime */
|
||||
private int slimeJumpDelay = 0;
|
||||
|
||||
public EdibleSlime(World world)
|
||||
{
|
||||
super(world);
|
||||
this.texture = "/mods/tinker/textures/mob/slimeedible.png";
|
||||
int i = 1 << this.rand.nextInt(3);
|
||||
this.yOffset = 0.0F;
|
||||
this.slimeJumpDelay = this.rand.nextInt(20) + 10;
|
||||
this.setSlimeSize(i);
|
||||
}
|
||||
|
||||
protected String getSlimeParticle()
|
||||
{
|
||||
return "slime";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere ()
|
||||
{
|
||||
return isValidLightLevel() && this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()
|
||||
&& !this.worldObj.isAnyLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
protected boolean isValidLightLevel ()
|
||||
{
|
||||
int x = MathHelper.floor_double(this.posX);
|
||||
int y = MathHelper.floor_double(this.boundingBox.minY);
|
||||
int z = MathHelper.floor_double(this.posZ);
|
||||
|
||||
if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int light = this.worldObj.getBlockLightValue(x, y, z);
|
||||
|
||||
if (this.worldObj.isThundering())
|
||||
{
|
||||
int i1 = this.worldObj.skylightSubtracted;
|
||||
this.worldObj.skylightSubtracted = 10;
|
||||
light = this.worldObj.getBlockLightValue(x, y, z);
|
||||
this.worldObj.skylightSubtracted = i1;
|
||||
}
|
||||
|
||||
return light <= this.rand.nextInt(12);
|
||||
}
|
||||
}
|
||||
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, new Byte((byte)1));
|
||||
}
|
||||
|
||||
protected void setSlimeSize(int par1)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, new Byte((byte)par1));
|
||||
this.setSize(0.6F * (float)par1, 0.6F * (float)par1);
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.setEntityHealth(this.getMaxHealth());
|
||||
this.experienceValue = par1;
|
||||
}
|
||||
|
||||
public int getMaxHealth()
|
||||
{
|
||||
int i = this.getSlimeSize();
|
||||
return i * i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the slime.
|
||||
*/
|
||||
public int getSlimeSize()
|
||||
{
|
||||
return this.dataWatcher.getWatchableObjectByte(16);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(par1NBTTagCompound);
|
||||
par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readEntityFromNBT(par1NBTTagCompound);
|
||||
this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the sound played when the slime jumps.
|
||||
*/
|
||||
protected String getJumpSound()
|
||||
{
|
||||
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
|
||||
{
|
||||
this.isDead = true;
|
||||
}
|
||||
|
||||
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
|
||||
this.field_70812_c = this.field_70811_b;
|
||||
boolean flag = this.onGround;
|
||||
super.onUpdate();
|
||||
int i;
|
||||
|
||||
if (this.onGround && !flag)
|
||||
{
|
||||
i = this.getSlimeSize();
|
||||
|
||||
for (int j = 0; j < i * 8; ++j)
|
||||
{
|
||||
float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
|
||||
float offset = this.rand.nextFloat() * 0.5F + 0.5F;
|
||||
float xPos = MathHelper.sin(f) * (float)i * 0.5F * offset;
|
||||
float zPos = MathHelper.cos(f) * (float)i * 0.5F * offset;
|
||||
//this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)f2, this.boundingBox.minY, this.posZ + (double)f3, 0.0D, 0.0D, 0.0D);
|
||||
TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double)xPos, this.boundingBox.minY, this.posZ + (double)zPos, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (this.makesSoundOnLand())
|
||||
{
|
||||
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||
}
|
||||
|
||||
this.field_70813_a = -0.5F;
|
||||
}
|
||||
else if (!this.onGround && flag)
|
||||
{
|
||||
this.field_70813_a = 1.0F;
|
||||
}
|
||||
|
||||
this.func_70808_l();
|
||||
|
||||
if (this.worldObj.isRemote)
|
||||
{
|
||||
i = this.getSlimeSize();
|
||||
this.setSize(0.6F * (float)i, 0.6F * (float)i);
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateEntityActionState()
|
||||
{
|
||||
this.despawnEntity();
|
||||
EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
|
||||
|
||||
if (entityplayer != null)
|
||||
{
|
||||
this.faceEntity(entityplayer, 10.0F, 20.0F);
|
||||
}
|
||||
|
||||
if (this.onGround && this.slimeJumpDelay-- <= 0)
|
||||
{
|
||||
this.slimeJumpDelay = this.getJumpDelay();
|
||||
|
||||
if (entityplayer != null)
|
||||
{
|
||||
this.slimeJumpDelay /= 3;
|
||||
}
|
||||
|
||||
this.isJumping = true;
|
||||
|
||||
if (this.makesSoundOnJump())
|
||||
{
|
||||
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
}
|
||||
|
||||
this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
|
||||
this.moveForward = (float)(1 * this.getSlimeSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isJumping = false;
|
||||
|
||||
if (this.onGround)
|
||||
{
|
||||
this.moveStrafing = this.moveForward = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void func_70808_l()
|
||||
{
|
||||
this.field_70813_a *= 0.6F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of time the slime needs to wait between jumps.
|
||||
*/
|
||||
protected int getJumpDelay()
|
||||
{
|
||||
return this.rand.nextInt(20) + 10;
|
||||
}
|
||||
|
||||
protected EdibleSlime createInstance()
|
||||
{
|
||||
return new EdibleSlime(this.worldObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will get destroyed next tick.
|
||||
*/
|
||||
public void setDead()
|
||||
{
|
||||
int i = this.getSlimeSize();
|
||||
|
||||
if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0)
|
||||
{
|
||||
int j = 2 + this.rand.nextInt(3);
|
||||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F;
|
||||
float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F;
|
||||
EdibleSlime entityslime = this.createInstance();
|
||||
entityslime.setSlimeSize(i / 2);
|
||||
entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F);
|
||||
this.worldObj.spawnEntityInWorld(entityslime);
|
||||
}
|
||||
}
|
||||
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by a player entity when they collide with an entity
|
||||
*/
|
||||
public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
if (this.canDamagePlayer())
|
||||
{
|
||||
int i = this.getSlimeSize();
|
||||
|
||||
if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)i * 0.6D * (double)i && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength()))
|
||||
{
|
||||
this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
protected int getAttackStrength()
|
||||
{
|
||||
return this.getSlimeSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sound this mob makes when it is hurt.
|
||||
*/
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sound this mob makes on death.
|
||||
*/
|
||||
protected String getDeathSound()
|
||||
{
|
||||
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the item ID for the item the mob drops on death.
|
||||
*/
|
||||
protected int getDropItemId()
|
||||
{
|
||||
return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the volume for the sounds this mob makes.
|
||||
*/
|
||||
protected float getSoundVolume()
|
||||
{
|
||||
return 0.4F * (float)this.getSlimeSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
|
||||
* use in wolves.
|
||||
*/
|
||||
public int getVerticalFaceSpeed()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the slime makes a sound when it jumps (based upon the slime's size)
|
||||
*/
|
||||
protected boolean makesSoundOnJump()
|
||||
{
|
||||
return this.getSlimeSize() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size)
|
||||
*/
|
||||
protected boolean makesSoundOnLand()
|
||||
{
|
||||
return this.getSlimeSize() > 2;
|
||||
}
|
||||
}
|
129
mods/tinker/tconstruct/entity/UnstableCreeper.java
Normal file
129
mods/tinker/tconstruct/entity/UnstableCreeper.java
Normal file
@ -0,0 +1,129 @@
|
||||
package mods.tinker.tconstruct.entity;
|
||||
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class UnstableCreeper extends EntityCreeper
|
||||
{
|
||||
protected int fuseTime = 12;
|
||||
protected int timeSinceIgnited;
|
||||
protected int lastActiveTime;
|
||||
|
||||
protected int explosionRadius = 3;
|
||||
|
||||
public UnstableCreeper(World world)
|
||||
{
|
||||
super(world);
|
||||
this.texture = "/mods/tinker/textures/mob/creeperunstable.png";
|
||||
}
|
||||
|
||||
public int getMaxHealth()
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
|
||||
protected void fall (float distance)
|
||||
{
|
||||
if (!this.worldObj.isRemote && distance > 3)
|
||||
{
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if (this.getPowered())
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius * 2), flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius, flag);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(par1NBTTagCompound);
|
||||
par1NBTTagCompound.setShort("Fuse", (short) this.fuseTime);
|
||||
}
|
||||
|
||||
public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readEntityFromNBT(par1NBTTagCompound);
|
||||
|
||||
if (par1NBTTagCompound.hasKey("Fuse"))
|
||||
{
|
||||
this.fuseTime = par1NBTTagCompound.getShort("Fuse");
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdate ()
|
||||
{
|
||||
if (this.isEntityAlive())
|
||||
{
|
||||
this.lastActiveTime = this.timeSinceIgnited;
|
||||
int i = this.getCreeperState();
|
||||
|
||||
if (i > 0 && this.timeSinceIgnited == 0)
|
||||
{
|
||||
this.playSound("random.fuse", 1.0F, 0.5F);
|
||||
}
|
||||
|
||||
this.timeSinceIgnited += i;
|
||||
|
||||
if (this.timeSinceIgnited < 0)
|
||||
{
|
||||
this.timeSinceIgnited = 0;
|
||||
}
|
||||
|
||||
if (this.timeSinceIgnited >= this.fuseTime)
|
||||
{
|
||||
this.timeSinceIgnited = this.fuseTime;
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
|
||||
|
||||
if (this.getPowered())
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (this.explosionRadius * 2), flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius, flag);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
public float getCreeperFlashIntensity (float par1)
|
||||
{
|
||||
return ((float) this.lastActiveTime + (float) (this.timeSinceIgnited - this.lastActiveTime) * par1) / (float) (this.fuseTime - 2);
|
||||
}
|
||||
|
||||
protected void dropFewItems(boolean par1, int par2)
|
||||
{
|
||||
int j = this.getDropItemId();
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
int k = this.rand.nextInt(3)+3;
|
||||
|
||||
if (par2 > 0)
|
||||
{
|
||||
k += this.rand.nextInt(par2 + 1);
|
||||
}
|
||||
|
||||
for (int l = 0; l < k; ++l)
|
||||
{
|
||||
this.dropItem(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
mods/tinker/textures/mob/creeperunstable.png
Normal file
BIN
mods/tinker/textures/mob/creeperunstable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/tinker/textures/mob/inversecreeper.png
Normal file
BIN
mods/tinker/textures/mob/inversecreeper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/tinker/textures/mob/slimeedible.png
Normal file
BIN
mods/tinker/textures/mob/slimeedible.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 767 B |
BIN
test/JTest.class
Normal file
BIN
test/JTest.class
Normal file
Binary file not shown.
25
test/JTest.rb
Normal file
25
test/JTest.rb
Normal file
@ -0,0 +1,25 @@
|
||||
require 'java'
|
||||
require 'xinstick'
|
||||
#java_package 'test'
|
||||
#java_import cpw.mods.fml.common.Mod
|
||||
#java_import cpw.mods.fml.common.Mod.Init
|
||||
|
||||
java_annotation 'Mod(modid = "JTest", name = "JTest", version = "Test")'
|
||||
class JTest
|
||||
java_annotation 'Init'
|
||||
def init(event)
|
||||
puts 'Init, heyo!'
|
||||
end
|
||||
end
|
||||
|
||||
#jest = JTest.new
|
||||
#jest.init
|
||||
|
||||
#stick = XinStick.new(10000)
|
||||
|
||||
#cls = JTest.become_java!
|
||||
#cls.declared_methods.each do |method|
|
||||
#puts method.simple_name
|
||||
#end
|
||||
|
||||
puts 'Heyooooooooo'
|
79
test/XinStick.java
Normal file
79
test/XinStick.java
Normal file
@ -0,0 +1,79 @@
|
||||
package test;
|
||||
|
||||
import mods.tinker.tconstruct.entity.EdibleSlime;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/*
|
||||
* mDiyo's development testing mod
|
||||
* Does everything on right-click!
|
||||
*/
|
||||
|
||||
public class XinStick extends Item
|
||||
{
|
||||
public XinStick(int id)
|
||||
{
|
||||
super(id);
|
||||
setCreativeTab(CreativeTabs.tabMisc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
//spawnItem(player.posX, player.posY, player.posZ, tool, world);
|
||||
//CartEntity cart = new CartEntity(world, 1);
|
||||
//cart.cartType = 1;
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, new EdibleSlime(world), world, player);
|
||||
return stack;
|
||||
}
|
||||
|
||||
/*public boolean onItemUse (ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par3World.spawnEntityInWorld(new CartEntity(par3World, (double) ((float) par4 + 0.5F), (double) ((float) par5 + 1.5F), (double) ((float) par6 + 0.5F), 0));
|
||||
}
|
||||
|
||||
//--par1ItemStack.stackSize;
|
||||
return true;
|
||||
}*/
|
||||
|
||||
public static void spawnItem (double x, double y, double z, ItemStack stack, World world)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
|
||||
//entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.setAngles(player.cameraYaw, player.cameraYaw);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeChunk (World world, double dx, double dz)
|
||||
{
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
for (int z = 0; z < 16; z++)
|
||||
{
|
||||
for (int y = 0; y < 128; y++)
|
||||
{
|
||||
world.setBlockAndMetadataWithNotify((int) (x + dx), y, (int) (z + dz), 0, 0, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
72
test/mod_Test.java
Normal file
72
test/mod_Test.java
Normal file
@ -0,0 +1,72 @@
|
||||
package test;
|
||||
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
/*
|
||||
* mDiyo's development testing mod
|
||||
* Free everything from dirt!
|
||||
*/
|
||||
|
||||
@Mod(modid = "mod_Test", name = "mod_Test", version = "Test")
|
||||
public class mod_Test
|
||||
{
|
||||
public static Item xinstick;
|
||||
public static Item TArmorChestplate;
|
||||
public KeyBinding grabKey;
|
||||
EntityPlayer player;
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent evt)
|
||||
{
|
||||
System.out.println("Test!");
|
||||
}
|
||||
|
||||
@Init
|
||||
public void init (FMLInitializationEvent evt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit (FMLPostInitializationEvent evt) throws ScriptException
|
||||
{
|
||||
/*TArmorChestplate = new TArmor(4598, EnumArmorMaterial.CLOTH, 1, 1);
|
||||
GameRegistry.addRecipe(new ItemStack(TArmorChestplate, 64, 0), "s", 's', Block.dirt);
|
||||
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().chiselDiamond, 64, 0), "ss", 's', Block.dirt);
|
||||
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, 0), "s", "s", 's', Block.dirt);*/
|
||||
|
||||
/*ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("ruby");
|
||||
InputStream resource = mod_Test.class.getResourceAsStream("/test/JTest.rb");
|
||||
engine.eval(new InputStreamReader(resource));*/
|
||||
//JTest jRubyTest = new JTest();
|
||||
|
||||
// Cycle through metadata, don't go over the maximum or it will crash on mouseover
|
||||
/*for (int i = 0; i < 15; i++)
|
||||
{
|
||||
//GameRegistry.addRecipe(new ItemStack(TConstructContent.woodPattern, 1, i + 1), "s", 's', new ItemStack(TConstructContent.woodPattern, 1, i));
|
||||
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "s", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i));
|
||||
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "ss", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i));
|
||||
}*/
|
||||
|
||||
// ModLoader.addName(xinstick, "Stick of Power");
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
xinstick = new XinStick(10000).setUnlocalizedName("xinstick");
|
||||
LanguageRegistry.addName(xinstick, "XinRecord");
|
||||
}
|
||||
}
|
9
test/xinstick.rb
Normal file
9
test/xinstick.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class XinStick < net.minecraft.item.Item
|
||||
def initialize(id)
|
||||
super(id)
|
||||
setIconIndex(37)
|
||||
end
|
||||
def superhappyfuntime
|
||||
puts 'superhappyfuntime'
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user