master
mDiyo 2013-05-08 15:21:44 -07:00
parent e2b674153d
commit 1b5a237c95
16 changed files with 782 additions and 663 deletions

View File

@ -80,7 +80,7 @@
<entry key="item.tconstruct.Materials.ManyullynIngot.name">Manyullyn Ingot</entry>
<entry key="item.tconstruct.Materials.Mossball.name">Ball of Moss</entry>
<entry key="item.tconstruct.Materials.LavaCrystal.name">Lava Crystal</entry>
<entry key="item.tconstruct.Materials.NecroticBone.name">Necrotic Bone"</entry>
<entry key="item.tconstruct.Materials.NecroticBone.name">Necrotic Bone</entry>
<entry key="item.tconstruct.Materials.CopperIngot.name">Copper Ingot</entry>
<entry key="item.tconstruct.Materials.TinIngot.name">Tin Ingot</entry>
<entry key="item.tconstruct.Materials.AluminumIngot.name">Aluminum Ingot</entry>

View File

@ -37,7 +37,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.15", dependencies = "required-after:Forge@[7.7.1.675,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.3.6", dependencies = "required-after:Forge@[7.7.1.675,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
public class TConstruct
{
@ -72,7 +72,7 @@ public class TConstruct
content.oreRegistry();
proxy.registerRenderer();
//proxy.registerTickHandler();
proxy.registerTickHandler();
proxy.addNames();
proxy.readManuals();
proxy.registerKeys();
@ -89,9 +89,6 @@ public class TConstruct
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
}
DimensionManager.unregisterProviderType(0);
DimensionManager.registerProviderType(0, OverworldProvider.class, true);
}
@Init

File diff suppressed because it is too large Load Diff

View File

@ -529,24 +529,24 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
public void checkValidStructure (int x, int y, int z)
{
int capacity = 0;
int checkLayers = 0;
tempValidStructure = false;
if (checkSameLevel(x, y, z))
{
capacity++;
capacity += recurseStructureUp(x, y + 1, z, 0);
capacity += recurseStructureDown(x, y - 1, z, 0);
checkLayers++;
checkLayers += recurseStructureUp(x, y + 1, z, 0);
checkLayers += recurseStructureDown(x, y - 1, z, 0);
}
//maxLiquid = capacity * 20000;
if (tempValidStructure != validStructure)
if (tempValidStructure != validStructure || checkLayers != this.layers)
{
if (tempValidStructure)
{
internalTemp = 800;
activeLavaTank = lavaTanks.get(0);
adjustLayers(capacity, false);
adjustLayers(checkLayers, false);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
validStructure = true;
}

View File

@ -24,17 +24,10 @@ public class TClientTickHandler implements ITickHandler
TContent.oreBerry.setGraphicsLevel(Block.leaves.graphicsLevel);
TContent.oreBerrySecond.setGraphicsLevel(Block.leaves.graphicsLevel);
player = mc.thePlayer;
/*player = mc.thePlayer;
if (player == null || player.capabilities.isCreativeMode)
return;
/*ticks++;
if (ticks >= 200)
{
player.setEntityHealth(50);
ticks = 0;
}*/
ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
int scaledWidth = scaledresolution.getScaledWidth();
int scaledHeight = scaledresolution.getScaledHeight();
@ -56,7 +49,7 @@ public class TClientTickHandler implements ITickHandler
{
this.drawTexturedModalRect(xBasePos + 8*renderHearts, yBasePos, 9 + 18*iter, 0, 8, 8);
}
}
}*/
}
@Override

View File

@ -25,6 +25,7 @@ import mods.tinker.tconstruct.library.crafting.*;
import mods.tinker.tconstruct.library.tools.*;
import mods.tinker.tconstruct.util.PHConstruct;
import mods.tinker.tconstruct.util.player.*;
import mods.tinker.tconstruct.worldgen.OverworldProvider;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
@ -65,6 +66,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.DimensionManager;
import org.w3c.dom.Document;
@ -114,15 +116,15 @@ public class TProxyClient extends TProxyCommon
public static void openInventoryGui ()
{
if (mc == null)
/*if (mc == null)
mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new GuiInventory(mc.thePlayer));
addTabsToInventory();
addTabsToInventory();*/
}
public static void addTabsToInventory ()
{
if (mc == null)
/*if (mc == null)
mc = Minecraft.getMinecraft();
if (mc.currentScreen.getClass() == GuiInventory.class)
{
@ -136,12 +138,12 @@ public class TProxyClient extends TProxyCommon
gui.buttonList.add(repairButton);
repairButton = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1);
gui.buttonList.add(repairButton);
}
}*/
}
public void registerTickHandler ()
{
//TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT);
TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT);
//TickRegistry.registerTickHandler(new TCommonTickHandler(), Side.CLIENT);
}
@ -188,6 +190,15 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384));
//RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo!
if (PHConstruct.clearWater)
{
Block.waterMoving.setLightOpacity(1);
Block.waterStill.setLightOpacity(1);
}
DimensionManager.unregisterProviderType(0);
DimensionManager.registerProviderType(0, OverworldProvider.class, true);
addRenderMappings();
addToolButtons();
}

View File

@ -370,11 +370,6 @@ public class TContent implements IFuelHandler
Item.minecartCrate.setMaxStackSize(3);
Item.minecartPowered.setMaxStackSize(3);
Block.torchWood.setTickRandomly(false);
if (PHConstruct.clearWater)
{
Block.waterMoving.setLightOpacity(1);
Block.waterStill.setLightOpacity(1);
}
}
void registerMaterials ()

View File

@ -107,7 +107,7 @@ public class Chisel extends ToolCore
@Override
public EnumAction getItemUseAction (ItemStack itemstack)
{
return EnumAction.eat;
return EnumAction.bow;
}
@Override

View File

@ -487,7 +487,10 @@ public class AbilityHelper
public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack)
{
if (!player.inventory.addItemStackToInventory(stack))
EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
player.worldObj.spawnEntityInWorld(entityitem);
entityitem.onCollideWithPlayer(player);
/*if (!player.inventory.addItemStackToInventory(stack))
{
if (!player.worldObj.isRemote)
{
@ -499,7 +502,7 @@ public class AbilityHelper
else
{
player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F, ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
}*/
}
/* Ranged weapons */

View File

@ -464,7 +464,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
if (tags.hasKey("Moss"))
{
int chance = tags.getInteger("Moss");
int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 350 : 1150;
int check = world.canBlockSeeTheSky((int) entity.posX, (int) entity.posY, (int) entity.posZ) ? 750 : 1500;
if (random.nextInt(check) < chance)
{
AbilityHelper.healTool(stack, 1, (EntityLiving) entity, true, !((EntityLiving) entity).isSwingInProgress);
@ -597,6 +597,46 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
//Right-click
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
{
int posX = x;
int posY = y;
int posZ = z;
int playerPosX = (int) Math.floor(player.posX);
int playerPosY = (int) Math.floor(player.posY);
int playerPosZ = (int) Math.floor(player.posZ);
if (side == 0)
{
--posY;
}
if (side == 1)
{
++posY;
}
if (side == 2)
{
--posZ;
}
if (side == 3)
{
++posZ;
}
if (side == 4)
{
--posX;
}
if (side == 5)
{
++posX;
}
if (posX == playerPosX && (posY == playerPosY || posY == playerPosY + 1 || posY == playerPosY - 1) && posZ == playerPosZ)
{
return false;
}
int hotbarSlot = player.inventory.currentItem;
if (hotbarSlot == 0)
{

View File

@ -1,6 +1,7 @@
package mods.tinker.tconstruct.modifiers;
import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.tools.AbilityHelper;
import mods.tinker.tconstruct.library.tools.ToolMod;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -58,16 +59,38 @@ public class ModRepair extends ToolMod
materialValue = PatternBuilder.instance.getPartValue(input[1]);
int increase = (int) (50 + (dur * 0.4f * materialValue));
//System.out.println("Increase: "+increase);
int modifiers = tags.getInteger("Modifiers");
float mods = 1.0f;
if (modifiers == 2)
mods = 0.8f;
else if (modifiers == 1)
mods = 0.6f;
else if (modifiers == 0)
mods = 0.4f;
increase *= mods;
int repair = tags.getInteger("RepairCount");
repair += 1;
tags.setInteger("RepairCount", repair);
float repairCount = (100 - repair) / 100f;
if (repairCount < 0.5f)
repairCount = 0.5f;
increase *= repairCount;
//System.out.println("Modified increase: "+increase);
damage -= increase;
if (damage < 0)
damage = 0;
tags.setInteger("Damage", damage);
tool.setItemDamage(damage * 100 / dur);
AbilityHelper.damageTool(tool, 0, null, true);
//tool.setItemDamage(damage * 100 / dur);
int repair = tags.getInteger("RepairCount");
repair += 1;
tags.setInteger("RepairCount", repair);
}
@Override

View File

@ -46,6 +46,8 @@ public class PHConstruct
keepLevels = config.get("Difficulty Changes", "Keep levels on death", true).getBoolean(true);
clearWater = config.get("Difficulty Changes", "Turn water clear", true).getBoolean(true);
voidFog = config.get("Difficulty Changes", "Remove Overworld void fog", true).getBoolean(true);
superfunWorld = config.get("Superfun", "All the world is Superfun", false).getBoolean(false);
/*disableWoodTools = config.get("Difficulty Changes", "Disable vanilla wooden tools", false).getBoolean(false);
disableStoneTools = config.get("Difficulty Changes", "Disable vanilla stone tools", true).getBoolean(true);
@ -418,4 +420,7 @@ public class PHConstruct
public static boolean enableTStone;
public static boolean enableTCactus;
public static boolean enableTBone;
//Superfun
public static boolean superfunWorld;
}

View File

@ -112,7 +112,7 @@ public class TEventHandler
}
}
else if (event.recentlyHit && event.entityLiving.getClass() == EntitySkeleton.class)
if (event.recentlyHit && event.entityLiving.getClass() == EntitySkeleton.class)
{
EntitySkeleton skeleton = (EntitySkeleton) event.entityLiving;
if (skeleton.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)

View File

@ -87,10 +87,10 @@ 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)])
/*if (!Block.opaqueCubeLookup[world.getBlockId(x, y, z)])
{
setBlockAndMetadata(world, x, y, z, blockID, metadata);
}
}*/
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || (block != Block.endPortalFrame && !Block.opaqueCubeLookup[world.getBlockId(x, y, z)]))

View File

@ -6,6 +6,7 @@ import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.util.CoordTuple;
import mods.tinker.tconstruct.util.PHConstruct;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.chunk.IChunkProvider;
@ -51,6 +52,11 @@ public class TBaseWorldGenerator implements IWorldGenerator
if (world.provider.dimensionId == 0)
generateOreBushes(random, chunkX * 16, chunkZ * 16, world);
}
if (PHConstruct.superfunWorld && world.provider.dimensionId == 0)
{
superfunGenerate(random, chunkX * 16, chunkZ * 16, world);
}
}
void generateSurface (Random random, int xChunk, int zChunk, World world)
@ -305,6 +311,38 @@ public class TBaseWorldGenerator implements IWorldGenerator
return -1;
}
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.blockID);*/
for (int x = 0; x < 16; x++)
{
for (int z = 0; z < 16; z++)
{
for (int y = 0; y < 128; y++)
{
int blockID = world.getBlockId(x + chunkX, y, z + chunkZ);
Block block = Block.blocksList[blockID];
if (block != null)
{
if (block.blockMaterial == Material.leaves)
world.setBlock(x + chunkX, y, z + chunkZ, Block.lavaStill.blockID, 0, 0);
if (block.blockMaterial == Material.wood)
world.setBlock(x + chunkX, y, z + chunkZ, Block.netherrack.blockID, 0, 0);
if (block.blockID == Block.stone.blockID)
world.setBlock(x + chunkX, y, z + chunkZ, Block.whiteStone.blockID, 0, 0);
if (y > 40 && (block.blockMaterial == Material.ground || block.blockMaterial == Material.grass))
world.setBlock(x + chunkX, y, z + chunkZ, Block.slowSand.blockID, 0, 0);
if (block.blockMaterial == Material.sand)
world.setBlock(x + chunkX, y, z + chunkZ, Block.silverfish.blockID, 0, 0);
}
}
}
}
}
WorldGenMinable copper;
WorldGenMinable tin;
WorldGenMinable aluminum;

View File

@ -13,7 +13,7 @@ public class VillageSmelteryHandler implements IVillageCreationHandler
@Override
public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i)
{
return new StructureVillagePieceWeight(ComponentSmeltery.class, 18, i + 1);
return new StructureVillagePieceWeight(ComponentSmeltery.class, 9, i + 1);
}
@Override