Split more files into parts

This commit is contained in:
mDiyo committed 2014-06-06 19:46:05 -08:00
1 parent e2f0558b6f
commit 5a87c102ea
61 files changed
+1365 -1499

No files matched your search

@@ -4,10 +4,19 @@ import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.util.IIcon;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import tconstruct.TConstruct;
public class ItemHelper
@@ -30,4 +39,82 @@ public class ItemHelper
}
}
public static void addDrops (LivingDropsEvent event, ItemStack dropStack)
{
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(0, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(1, meta)));// block.getIcon(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(2, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(3, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(4, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(5, meta)));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glScalef(2f, 2f, 2f);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glRotatef(45, 0, 1, 0);
GL11.glRotatef(60, 1, 0, 0);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(0, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(1, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(2, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(3, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(4, meta)));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(5, meta)));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
public static IIcon getIconSafe (IIcon icon)
{
if (icon != null)
return icon;
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
}
}
@@ -1,234 +0,0 @@
package tconstruct.util;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class MiningExplosion extends Explosion
{
World world;
private Random random = new Random();
private int field_77289_h = 16;
private Map field_77288_k = new HashMap();
public MiningExplosion(World par1World, Entity par2Entity, double par3, double par5, double par7, float par9)
{
super(par1World, par2Entity, par3, par5, par7, par9);
world = par1World;
}
@Override
public void doExplosionA ()
{
float f = this.explosionSize;
HashSet hashset = new HashSet();
int i;
int j;
int k;
double d0;
double d1;
double d2;
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 || j == 0 || j == this.field_77289_h - 1 || k == 0 || k == this.field_77289_h - 1)
{
double d3 = (double) ((float) i / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d4 = (double) ((float) j / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d5 = (double) ((float) k / ((float) this.field_77289_h - 1.0F) * 2.0F - 1.0F);
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
d3 /= d6;
d4 /= d6;
d5 /= d6;
float f1 = this.explosionSize * (0.7F + this.world.rand.nextFloat() * 0.6F);
d0 = this.explosionX;
d1 = this.explosionY;
d2 = this.explosionZ;
for (float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F)
{
int l = MathHelper.floor_double(d0);
int i1 = MathHelper.floor_double(d1);
int j1 = MathHelper.floor_double(d2);
Block k1 = this.world.getBlock(l, i1, j1);
if (k1 != Blocks.air)
{
Block block = k1;
float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.world, l, i1, j1, block) : block.getExplosionResistance(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)))
{
hashset.add(new ChunkPosition(l, i1, j1));
}
d0 += d3 * (double) f2;
d1 += d4 * (double) f2;
d2 += d5 * (double) f2;
}
}
}
}
}
this.affectedBlockPositions.addAll(hashset);
this.explosionSize *= 2.0F;
i = MathHelper.floor_double(this.explosionX - (double) this.explosionSize - 1.0D);
j = MathHelper.floor_double(this.explosionX + (double) this.explosionSize + 1.0D);
k = MathHelper.floor_double(this.explosionY - (double) this.explosionSize - 1.0D);
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 list = this.world.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getAABBPool().getAABB((double) i, (double) k, (double) i2, (double) j, (double) l1, (double) j2));
Vec3 vec3 = this.world.getWorldVec3Pool().getVecFromPool(this.explosionX, this.explosionY, this.explosionZ);
for (int k2 = 0; k2 < list.size(); ++k2)
{
Entity entity = (Entity) list.get(k2);
double d7 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double) this.explosionSize;
if (d7 <= 1.0D)
{
d0 = entity.posX - this.explosionX;
d1 = entity.posY + (double) entity.getEyeHeight() - this.explosionY;
d2 = entity.posZ - this.explosionZ;
double d8 = (double) MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2);
if (d8 != 0.0D)
{
d0 /= d8;
d1 /= d8;
d2 /= d8;
double d9 = (double) 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)));
double d11 = EnchantmentProtection.func_92092_a(entity, d10);
entity.motionX += d0 * d11;
entity.motionY += d1 * d11;
entity.motionZ += d2 * d11;
if (entity instanceof EntityPlayer)
{
this.field_77288_k.put((EntityPlayer) entity, this.world.getWorldVec3Pool().getVecFromPool(d0 * d10, d1 * d10, d2 * d10));
}
}
}
}
this.explosionSize = f;
}
@Override
public void doExplosionB (boolean par1)
{
this.world.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.world.rand.nextFloat() - this.world.rand.nextFloat()) * 0.2F) * 0.7F);
if (this.explosionSize >= 2.0F && this.isSmoking)
{
this.world.spawnParticle("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);
}
Iterator iterator;
ChunkPosition chunkposition;
int i;
int j;
int k;
Block l;
if (this.isSmoking)
{
iterator = this.affectedBlockPositions.iterator();
while (iterator.hasNext())
{
chunkposition = (ChunkPosition) iterator.next();
i = chunkposition.chunkPosX;
j = chunkposition.chunkPosY;
k = chunkposition.chunkPosZ;
l = this.world.getBlock(i, j, k);
if (par1)
{
double d0 = (double) ((float) i + this.world.rand.nextFloat());
double d1 = (double) ((float) j + this.world.rand.nextFloat());
double d2 = (double) ((float) k + this.world.rand.nextFloat());
double d3 = d0 - this.explosionX;
double d4 = d1 - this.explosionY;
double d5 = d2 - this.explosionZ;
double d6 = (double) MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5);
d3 /= d6;
d4 /= d6;
d5 /= d6;
double d7 = 0.5D / (d6 / (double) this.explosionSize + 0.1D);
d7 *= (double) (this.world.rand.nextFloat() * this.world.rand.nextFloat() + 0.3F);
d3 *= d7;
d4 *= d7;
d5 *= d7;
this.world.spawnParticle("explode", (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5);
this.world.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
}
if (l != Blocks.air)
{
Block block = l;
if (block.canDropFromExplosion(this))
{
block.dropBlockAsItemWithChance(this.world, i, j, k, this.world.getBlockMetadata(i, j, k), 1.0F, 0);
}
block.onBlockExploded(this.world, i, j, k, this);
}
}
}
if (this.isFlaming)
{
iterator = this.affectedBlockPositions.iterator();
while (iterator.hasNext())
{
chunkposition = (ChunkPosition) iterator.next();
i = chunkposition.chunkPosX;
j = chunkposition.chunkPosY;
k = chunkposition.chunkPosZ;
l = this.world.getBlock(i, j, k);
Block i1 = this.world.getBlock(i, j - 1, k);
if (l == Blocks.air && i1.isOpaqueCube() && this.random.nextInt(3) == 0)
{
this.world.setBlock(i, j, k, Blocks.fire);
}
}
}
}
}
@@ -1,42 +0,0 @@
package tconstruct.util;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;
import tconstruct.library.tools.AbilityHelper;
public class SmelteryDamageSource extends DamageSource
{
public SmelteryDamageSource()
{
super("smeltery");
}
@Override
public IChatComponent func_151519_b (EntityLivingBase par1EntityLiving)
{
String type = "";
switch (AbilityHelper.random.nextInt(4))
{
case 0:
type = "one.";
break;
case 1:
type = "two.";
break;
case 2:
type = "three.";
break;
case 3:
type = "four.";
break;
}
EntityLivingBase entityliving1 = par1EntityLiving.func_94060_bK();
String s = "death." + type + this.damageType;
String s1 = s + ".player";
return entityliving1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] { par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_() })
: new ChatComponentTranslation(s, new Object[] { par1EntityLiving.func_145748_c_() });
}
}
@@ -1,57 +0,0 @@
package tconstruct.util;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.TConstruct;
import tconstruct.achievements.TAchievements;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.tools.TinkerTools;
import tconstruct.util.player.TPlayerStats;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
public class TCraftingHandler // implements ICraftingHandler
{
@SubscribeEvent
public void onCrafting (ItemCraftedEvent event)// EntityPlayer player,
// ItemStack itemstack,
// IInventory craftMatrix)
{
Item item = event.crafting.getItem();
if (!event.player.worldObj.isRemote)
{
if (item == Item.getItemFromBlock(TinkerTools.toolStationWood))
{
TPlayerStats stats = TPlayerStats.get(event.player);
if (!stats.materialManual)
{
stats.materialManual = true;
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 1));
}
}
if (item == Item.getItemFromBlock(TinkerSmeltery.smeltery) || item == Item.getItemFromBlock(TinkerSmeltery.lavaTank))
{
TPlayerStats stats = TPlayerStats.get(event.player);
if (!stats.smelteryManual)
{
stats.smelteryManual = true;
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 2));
}
event.player.addStat(TAchievements.achievements.get("tconstruct:smelteryMaker"), 1);
}
if (item == Item.getItemFromBlock(TinkerTools.craftingStationWood))
{
event.player.addStat(TAchievements.achievements.get("tconstruct:betterCrafting"), 1);
}
else if (item == TinkerTools.blankPattern)
{
event.player.addStat(TAchievements.achievements.get("tconstruct:pattern"), 1);
}
}
}
}
@@ -1,50 +0,0 @@
package tconstruct.util;
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.dispenser.IBlockSource;
import net.minecraft.dispenser.IPosition;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import tconstruct.tools.entity.ArrowEntity;
public class TDispenserBehaviorArrow extends BehaviorDefaultDispenseItem
{
@Override
public ItemStack dispenseStack (IBlockSource dispenser, ItemStack stack)
{
World world = dispenser.getWorld();
// TODO getIPositionFromBlockSource
IPosition iposition = BlockDispenser.func_149939_a(dispenser);
// TODO getFacing
EnumFacing enumfacing = BlockDispenser.func_149937_b(dispenser.getBlockMetadata());
ItemStack arrowItem = stack.splitStack(1);
ArrowEntity projectile = new ArrowEntity(world, iposition.getX(), iposition.getY(), iposition.getZ(), arrowItem);
projectile.canBePickedUp = 1;
projectile.setThrowableHeading((double) enumfacing.getFrontOffsetX(), (double) ((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ(), this.func_82500_b(),
this.func_82498_a());
world.spawnEntityInWorld(projectile);
return stack;
}
@Override
protected void playDispenseSound (IBlockSource dispenser)
{
dispenser.getWorld().playAuxSFX(1002, dispenser.getXInt(), dispenser.getYInt(), dispenser.getZInt(), 0);
}
protected float func_82498_a ()
{
return 6.0F;
}
protected float func_82500_b ()
{
return 1.1F;
}
}
@@ -1,34 +0,0 @@
package tconstruct.util;
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.dispenser.IBlockSource;
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.
*/
@Override
public ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
EnumFacing enumfacing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
double d0 = par1IBlockSource.getX() + (double) enumfacing.getFrontOffsetX();
double d1 = (double) ((float) par1IBlockSource.getYInt() + 0.2F);
double d2 = par1IBlockSource.getZ() + (double) enumfacing.getFrontOffsetZ();
EntityLiving entity = TitleIcon.activateSpawnEgg(par2ItemStack, par1IBlockSource.getWorld(), d0, d1, d2, 0);
if (par2ItemStack.hasDisplayName())
{
((EntityLiving) entity).setCustomNameTag(par2ItemStack.getDisplayName());
}
par2ItemStack.splitStack(1);
return par2ItemStack;
}
}
@@ -1,753 +0,0 @@
package tconstruct.util;
import java.util.Random;
import mantle.blocks.BlockUtils;
import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
import tconstruct.TConstruct;
import tconstruct.achievements.TAchievements;
import tconstruct.armor.TinkerArmor;
import tconstruct.items.tools.FryingPan;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.event.PartBuilderEvent;
import tconstruct.library.event.ToolCraftEvent;
import tconstruct.library.tools.ArrowMaterial;
import tconstruct.library.tools.BowMaterial;
import tconstruct.library.tools.BowstringMaterial;
import tconstruct.library.tools.FletchingMaterial;
import tconstruct.library.tools.ToolCore;
import tconstruct.library.tools.Weapon;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.smeltery.blocks.LiquidMetalFinite;
import tconstruct.smeltery.blocks.TankAirBlock;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;
import tconstruct.util.player.ArmorExtended;
import tconstruct.util.player.TPlayerStats;
import tconstruct.world.TinkerWorld;
import tconstruct.world.entity.BlueSlime;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class TEventHandler
{
Random random = new Random();
/* Crafting */
@SubscribeEvent
public void craftTool (ToolCraftEvent.NormalTool event)
{
NBTTagCompound toolTag = event.toolTag.getCompoundTag("InfiTool");
if (PHConstruct.denyMattock && event.tool == TinkerTools.mattock)
{
int head = toolTag.getInteger("Head");
int handle = toolTag.getInteger("Handle");
int accessory = toolTag.getInteger("Accessory");
if (!allowCrafting(head, handle, accessory))
{
event.setResult(Result.DENY);
return;
}
}
int thaum = 0;
if (toolTag.getInteger("Head") == 31)
thaum++;
if (toolTag.getInteger("Handle") == 31)
thaum++;
if (toolTag.getInteger("Accessory") == 31)
thaum++;
if (toolTag.getInteger("Extra") == 31)
thaum++;
if ((thaum >= 3) || (!toolTag.hasKey("Accessory") && thaum >= 2))
{
int modifiers = toolTag.getInteger("Modifiers");
modifiers += 2;
toolTag.setInteger("Modifiers", modifiers);
}
else if (thaum >= 1)
{
int modifiers = toolTag.getInteger("Modifiers");
modifiers += 1;
toolTag.setInteger("Modifiers", modifiers);
}
if (event.tool == TinkerTools.shortbow)
{
BowMaterial top = TConstructRegistry.getBowMaterial(toolTag.getInteger("Head"));
BowMaterial bottom = TConstructRegistry.getBowMaterial(toolTag.getInteger("Accessory"));
BowstringMaterial string = (BowstringMaterial) TConstructRegistry.getCustomMaterial(toolTag.getInteger("Handle"), BowstringMaterial.class);
if (top != null && bottom != null && string != null)
{
if (toolTag.getInteger("Handle") == 1)
{
int modifiers = toolTag.getInteger("Modifiers");
modifiers += 1;
toolTag.setInteger("Modifiers", modifiers);
}
int durability = (int) ((top.durability + bottom.durability) / 2 * string.durabilityModifier);
toolTag.setInteger("TotalDurability", durability);
toolTag.setInteger("BaseDurability", durability);
int drawSpeed = (int) ((top.drawspeed + bottom.drawspeed) / 2 * string.drawspeedModifier);
toolTag.setInteger("DrawSpeed", drawSpeed);
toolTag.setInteger("BaseDrawSpeed", drawSpeed);
float flightSpeed = (top.flightSpeedMax + bottom.flightSpeedMax) / 2f * string.flightSpeedModifier;
toolTag.setFloat("FlightSpeed", flightSpeed);
}
}
if (event.tool == TinkerTools.arrow)
{
ArrowMaterial head = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Head"));
ArrowMaterial shaft = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Handle"));
FletchingMaterial fletching = (FletchingMaterial) TConstructRegistry.getCustomMaterial(toolTag.getInteger("Accessory"), FletchingMaterial.class);
if (head != null && shaft != null && fletching != null)
{
float mass = head.mass / 5f + shaft.mass + fletching.mass;
float shatter = (head.breakChance + shaft.breakChance + fletching.breakChance) / 4f;
float accuracy = (head.accuracy + shaft.accuracy + fletching.accuracy) / 3;
ItemStack arrow = new ItemStack(event.tool, 4);
toolTag.setInteger("TotalDurability", 0);
toolTag.setFloat("Mass", mass);
toolTag.setFloat("BreakChance", shatter);
toolTag.setFloat("Accuracy", accuracy);
toolTag.setInteger("Unbreaking", 10);
arrow.setTagCompound(event.toolTag);
event.overrideResult(arrow);
}
}
if (event.tool == TinkerTools.battlesign)
{
int modifiers = toolTag.getInteger("Modifiers");
modifiers += 1;
toolTag.setInteger("Modifiers", modifiers);
}
}
private boolean allowCrafting (int head, int handle, int accessory)
{
int[] nonMetals = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 17 };
for (int i = 0; i < nonMetals.length; i++)
{
if (head == nonMetals[i] || handle == nonMetals[i] || accessory == nonMetals[i])
return false;
}
return true;
}
@SubscribeEvent
public void craftPart (PartBuilderEvent.NormalPart event)
{
if (event.pattern.getItem() == TinkerTools.woodPattern && event.pattern.getItemDamage() == 23)
{
ItemStack result = craftBowString(event.material);
if (result != null)
{
event.overrideResult(new ItemStack[] { result, null });
}
}
if (event.pattern.getItem() == TinkerTools.woodPattern && event.pattern.getItemDamage() == 24)
{
ItemStack result = craftFletching(event.material);
if (result != null)
{
event.overrideResult(new ItemStack[] { result, null });
}
}
}
public static ItemStack craftBowString (ItemStack stack)
{
if (stack.stackSize < 3)
return null;
BowstringMaterial mat = (BowstringMaterial) TConstructRegistry.getCustomMaterial(stack, BowstringMaterial.class);
if (mat != null)
return mat.craftingItem.copy();
return null;
}
public static ItemStack craftFletching (ItemStack stack)
{
if (matchesLeaves(stack))
{
FletchingMaterial leaves = (FletchingMaterial) TConstructRegistry.getCustomMaterial(new ItemStack(Blocks.leaves), FletchingMaterial.class);
return leaves.craftingItem.copy();
}
FletchingMaterial mat = (FletchingMaterial) TConstructRegistry.getCustomMaterial(stack, FletchingMaterial.class);
if (mat != null)
return mat.craftingItem.copy();
return null;
}
public static boolean matchesLeaves (ItemStack stack)
{
if (stack != null)
{
Block block = BlockUtils.getBlockFromItemStack(stack);
if (block != null)
{
if (block.isLeaves(null, 0, 0, 0))
return true;
}
}
return false;
}
/* Damage */
@SubscribeEvent
public void onHurt (LivingHurtEvent event)
{
EntityLivingBase reciever = event.entityLiving;
if (reciever instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
// Cutlass
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && player.isUsingItem())
{
Item item = stack.getItem();
if (item == TinkerTools.cutlass)
{
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 3 * 20, 1));
}
else if (item == TinkerTools.battlesign)
{
event.ammount *= 1.5; //Puts battlesign blocking at 3/4 instead of 1/2
}
}
}
else if (reciever instanceof EntityCreeper)
{
Entity attacker = event.source.getEntity();
if (attacker instanceof EntityLivingBase)
{
Entity target = ((EntityCreeper) reciever).getAttackTarget();
if (target != null)
{
float d1 = reciever.getDistanceToEntity(((EntityCreeper) reciever).getAttackTarget());
float d2 = reciever.getDistanceToEntity(attacker);
if (d2 < d1)
{
((EntityCreeper) event.entityLiving).setAttackTarget((EntityLivingBase) event.source.getEntity());
}
}
}
}
}
@SubscribeEvent
public void onAttack (LivingAttackEvent event)
{
//System.out.println("Damage: "+event.ammount);
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
//Cutlass
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.getItem() == TinkerTools.battlesign && player.isUsingItem())
{
DamageSource source = event.source;
if (!source.isUnblockable() && !source.isMagicDamage() && !source.isExplosion())
{
if (source instanceof EntityDamageSourceIndirect)
{
if (random.nextInt(3) == 0)
{
Entity attacker = source.getEntity();
Entity projectile = ((EntityDamageSourceIndirect) source).getSourceOfDamage();
projectile.motionX *= -1;
projectile.motionZ *= -1;
projectile.setDead();
event.setCanceled(true);
if (projectile.getClass() == EntityArrow.class && !player.worldObj.isRemote)
{
EntityArrow reflection = null;
if (attacker instanceof EntityLivingBase)
reflection = new EntityArrow(player.worldObj, (EntityLivingBase) attacker, 0);
else
reflection = new EntityArrow(player.worldObj, player, 0);
Vec3 look = player.getLookVec();
reflection.posX = projectile.posX;
reflection.posY = projectile.posY;
reflection.posZ = projectile.posZ;
reflection.motionX = (projectile.motionX + (look.xCoord * 8)) / 6;
reflection.motionY = (projectile.motionY + (look.yCoord * 8)) / 6;
reflection.motionZ = (projectile.motionZ + (look.zCoord * 8)) / 6;
reflection.damage = ((EntityArrow) projectile).damage;
player.worldObj.spawnEntityInWorld(reflection);
}
}
}
else
{
Entity attacker = source.getEntity();
if(attacker != null)
{
attacker.attackEntityFrom(DamageSource.causeThornsDamage(player), event.ammount);
}
}
}
}
}
}
/* Drops */
@SubscribeEvent
public void onLivingDrop (LivingDropsEvent event)
{
if (event.entityLiving == null)
return;
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof FryingPan)
{
for (int i = 0; i < event.drops.size(); i++)
{
ItemStack is = event.drops.get(i).getEntityItem();
if (FurnaceRecipes.smelting().getSmeltingResult(is) != null && FurnaceRecipes.smelting().getSmeltingResult(is).getItem() instanceof ItemFood)
{
NBTTagCompound stackCompound = is.getTagCompound();
if (stackCompound == null)
{
stackCompound = new NBTTagCompound();
}
stackCompound.setBoolean("frypanKill", true);
is.setTagCompound(stackCompound);
}
}
}
}
if (random.nextInt(200) == 0 && event.entityLiving instanceof IMob && event.source.damageType.equals("player"))
{
if (event.entityLiving instanceof BlueSlime)
{
BlueSlime slime = (BlueSlime) event.entityLiving;
if (slime.getSlimeSize() < 8)
return;
}
int count = event.entityLiving instanceof EntityDragon ? 5 : 1;
for (int i = 0; i < count; i++)
{
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 1);
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
}
if (event.entityLiving instanceof IBossDisplayData)
{
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 3);
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
if (!event.entityLiving.isChild() && event.entityLiving.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
{
if (event.entityLiving.getClass() == EntityCow.class)
{
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
for (int iter = 0; iter < amount; ++iter)
{
addDrops(event, new ItemStack(Items.leather, 1));
}
}
if (event.entityLiving.getClass() == EntityChicken.class)
{
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
for (int iter = 0; iter < amount; ++iter)
{
addDrops(event, new ItemStack(Items.feather, 1));
}
}
}
if (event.recentlyHit)
{
if (event.entityLiving.getClass() == EntitySkeleton.class)
{
EntitySkeleton enemy = (EntitySkeleton) event.entityLiving;
if (event.source.damageType.equals("player"))
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (stack.getItem() == TinkerTools.cleaver)
beheading += 2;
if (beheading > 0 && random.nextInt(100) < beheading * 10)
{
addDrops(event, new ItemStack(Items.skull, 1, enemy.getSkeletonType()));
}
}
}
if (enemy.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)
{
addDrops(event, new ItemStack(TinkerTools.materials, 1, 8));
}
}
if (event.entityLiving.getClass() == EntityZombie.class)
{
EntityZombie enemy = (EntityZombie) event.entityLiving;
if (event.source.damageType.equals("player"))
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (stack != null && stack.hasTagCompound() && stack.getItem() == TinkerTools.cleaver)
beheading += 2;
if (beheading > 0 && random.nextInt(100) < beheading * 10)
{
addDrops(event, new ItemStack(Items.skull, 1, 2));
}
}
if (stack != null && stack.hasTagCompound() && stack.getItem() == TinkerTools.cleaver && random.nextInt(100) < 10) //Swap out for real beheading
{
addDrops(event, new ItemStack(Items.skull, 1, 2));
}
}
}
if (event.entityLiving.getClass() == EntityCreeper.class)
{
EntityCreeper enemy = (EntityCreeper) event.entityLiving;
if (event.source.damageType.equals("player"))
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (stack.getItem() == TinkerTools.cleaver)
beheading += 2;
if (beheading > 0 && random.nextInt(100) < beheading * 5)
{
addDrops(event, new ItemStack(Items.skull, 1, 4));
}
}
}
}
}
if (event.entityLiving.getClass() == EntityGhast.class)
{
if (PHConstruct.uhcGhastDrops)
{
for (EntityItem o : event.drops)
{
if (o.getEntityItem().getItem() == Items.ghast_tear)
{
o.setEntityItemStack(new ItemStack(Items.gold_ingot, 1));
}
}
}
else
{
addDrops(event, new ItemStack(Items.ghast_tear, 1));
}
}
// }
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
if (PHConstruct.dropPlayerHeads)
{
ItemStack dropStack = new ItemStack(Items.skull, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", player.getDisplayName());
dropStack.setTagCompound(nametag);
addDrops(event, dropStack);
}
else if (event.source.damageType.equals("player"))
{
EntityPlayer source = (EntityPlayer) event.source.getEntity();
ItemStack stack = source.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (stack.getItem() == TinkerTools.cleaver)
beheading += 2;
if (beheading > 0 && random.nextInt(100) < beheading * 50)
{
ItemStack dropStack = new ItemStack(Items.skull, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", player.getDisplayName());
dropStack.setTagCompound(nametag);
addDrops(event, dropStack);
}
}
}
}
}
@SubscribeEvent
public void onLivingDeath (LivingDeathEvent event)
{
Entity cause = event.source.getSourceOfDamage();
if (cause != null && cause instanceof EntityPlayer)
{
EntityPlayer murderer = (EntityPlayer) cause;
ItemStack stack = murderer.getHeldItem();
if (stack != null && stack.getItem() instanceof Weapon)
{
murderer.addStat(TAchievements.achievements.get("tconstruct:enemySlayer"), 1);
}
}
}
void addDrops (LivingDropsEvent event, ItemStack dropStack)
{
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
entityitem.delayBeforeCanPickup = 10;
event.drops.add(entityitem);
}
/*
* @ForgeSubscribe public void onLivingSpawn (EntityJoinWorldEvent event) {
* if (event.entity instanceof EntityXPOrb) {
* TConstruct.logger.info("Entity: " + event.entity); } }
*/
@SubscribeEvent
public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event)
{
EntityLivingBase living = event.entityLiving;
if (living.getClass() == EntitySpider.class && random.nextInt(100) == 0)
{
EntityCreeper creeper = new EntityCreeper(living.worldObj);
spawnEntityLiving(living.posX, living.posY + 1, living.posZ, creeper, living.worldObj);
if (living.riddenByEntity != null)
creeper.mountEntity(living.riddenByEntity);
else
creeper.mountEntity(living);
EntityXPOrb orb = new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, random.nextInt(20) + 20);
orb.mountEntity(creeper);
}
}
public static void spawnEntityLiving (double x, double y, double z, EntityLiving entity, World world)
{
if (!world.isRemote)
{
entity.setPosition(x, y, z);
entity.onSpawnWithEgg((IEntityLivingData) null);
world.spawnEntityInWorld(entity);
}
}
/* Bonemeal */
@SubscribeEvent
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))
event.setResult(Event.Result.ALLOW);
}
}
}
/* Ore Dictionary */
@SubscribeEvent
public void registerOre (OreRegisterEvent evt)
{
if (evt.Name == "crystalQuartz")
{
TinkerTools.modAttack.addStackToMatchList(evt.Ore, 2);
}
else if (evt.Name == "crystalCerusQuartz")
{
TinkerTools.modAttack.addStackToMatchList(evt.Ore, 24);
}
}
@SubscribeEvent
public void bucketFill (FillBucketEvent evt)
{
if (evt.current.getItem() == Items.bucket && evt.target.typeOfHit == MovingObjectType.ENTITY)
{
int hitX = evt.target.blockX;
int hitY = evt.target.blockY;
int hitZ = evt.target.blockZ;
if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current))
{
return;
}
Block bID = evt.world.getBlock(hitX, hitY, hitZ);
for (int id = 0; id < TinkerSmeltery.fluidBlocks.length; id++)
{
if (bID == TinkerSmeltery.fluidBlocks[id])
{
if (evt.entityPlayer.capabilities.isCreativeMode)
{
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
}
else
{
if (TinkerSmeltery.fluidBlocks[id] instanceof LiquidMetalFinite)
{
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
/*
* int quanta = 0; for (int posX = -1; posX <= 1;
* posX++) { for (int posZ = -1; posZ <= 1; posZ++)
* { int localID = evt.world.getBlockId(hitX + posX,
* hitY, hitZ + posZ); if (localID == bID) { quanta
* += evt.world.getBlockMetadata(hitX + posX, hitY,
* hitZ + posZ) + 1; } } }
*
* if (quanta >= 8) { while (quanta > 0) { for (int
* posX = -1; posX <= 1; posX++) { for (int posZ =
* -1; posZ <= 1; posZ++) { int localID =
* evt.world.getBlockId(hitX + posX, hitY, hitZ +
* posZ); if (localID == bID) { quanta -= 1; int
* meta = evt.world.getBlockMetadata(hitX + posX,
* hitY, hitZ + posZ); if (meta > 0)
* evt.world.setBlockMetadataWithNotify(hitX + posX,
* hitY, hitZ + posZ, meta - 1, 3); else
* evt.world.setBlockToAir(hitX + posX, hitY, hitZ +
* posZ); } } } } }
*/
}
else
{
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
}
evt.setResult(Result.ALLOW);
evt.result = new ItemStack(TinkerSmeltery.buckets, 1, id);
}
}
}
}
}
// TODO 1.7 Fix this -- for ticking stuffs in extra armor slots
@SubscribeEvent
public void livingUpdate (LivingUpdateEvent event)
{
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
TPlayerStats stats = TPlayerStats.get(player);
if (stats != null && stats.armor != null)
{
ArmorExtended armor = stats.armor;
for (int i = 0; i < armor.getSizeInventory(); i++)
{
if (armor.getStackInSlot(i) != null)
{
armor.getStackInSlot(i).getItem().onUpdate(armor.getStackInSlot(i), player.worldObj, player, i, false);
armor.getStackInSlot(i).getItem().onArmorTick(player.worldObj, player, armor.getStackInSlot(i));
}
}
}
}
}
// Player interact event - prevent breaking of tank air blocks in creative
@SubscribeEvent
public void playerInteract (PlayerInteractEvent event)
{
if (event.action == Action.LEFT_CLICK_BLOCK)
{
Block block = event.entity.worldObj.getBlock(event.x, event.y, event.z);
if (block instanceof TankAirBlock)
{
event.setCanceled(true);
}
}
}
}
@@ -1,45 +0,0 @@
package tconstruct.util;
import net.minecraftforge.common.util.FakePlayer;
import tconstruct.achievements.TAchievements;
import tconstruct.library.event.SmelteryEvent;
import tconstruct.library.event.ToolCraftedEvent;
import tconstruct.library.tools.ToolCore;
import tconstruct.library.tools.Weapon;
import tconstruct.tools.logic.ToolForgeLogic;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class TEventHandlerAchievement
{
@SubscribeEvent
public void onToolCrafted (ToolCraftedEvent event)
{
if (event.player != null && !(event.player instanceof FakePlayer))
{
event.player.addStat(TAchievements.achievements.get("tconstruct:tinkerer"), 1);
if (event.tool != null && event.tool.getItem() instanceof Weapon)
{
event.player.addStat(TAchievements.achievements.get("tconstruct:preparedFight"), 1);
}
if (event.inventory != null && event.inventory instanceof ToolForgeLogic && event.tool.getItem() instanceof ToolCore && ((ToolCore) event.tool.getItem()).durabilityTypeExtra() != 0)
{
event.player.addStat(TAchievements.achievements.get("tconstruct:proTinkerer"), 1);
}
}
}
@SubscribeEvent
public void onItemPlacedIntoCasting (SmelteryEvent.ItemInsertedIntoCasting event)
{
if (event.player != null && event.item != null)
{
if (event.item.getItem() instanceof ToolCore)
{
event.player.addStat(TAchievements.achievements.get("tconstruct:doingItWrong"), 1);
}
}
}
}
@@ -168,9 +168,6 @@ public class PHConstruct
isCleaverTwoHanded = config.get("Battlegear", "Can Cleavers have shields", true).getBoolean(true);
isHatchetWeapon = config.get("Battlegear", "Are Hatches also weapons", true).getBoolean(true);
// Achievement Properties
achievementsEnabled = config.get("Achievement Properties", "AchievementsEnabled", true).getBoolean(true);
/* Save the configuration file */
config.save();
@@ -329,7 +326,4 @@ public class PHConstruct
// Addon stuff
public static boolean isCleaverTwoHanded;
public static boolean isHatchetWeapon;
// Achievement options
public static boolean achievementsEnabled;
}
@@ -5,7 +5,7 @@ import io.netty.channel.ChannelHandlerContext;
import mantle.common.network.AbstractPacket;
import net.minecraft.entity.player.EntityPlayer;
import tconstruct.TConstruct;
import tconstruct.common.TProxyCommon;
import tconstruct.armor.ArmorProxyCommon;
public class PacketExtendedInventory extends AbstractPacket
{
@@ -45,14 +45,14 @@ public class PacketExtendedInventory extends AbstractPacket
{
switch (type)
{
case TProxyCommon.inventoryGui:
player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
case ArmorProxyCommon.inventoryGui:
player.openGui(TConstruct.instance, ArmorProxyCommon.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
break;
case TProxyCommon.armorGuiID:
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
case ArmorProxyCommon.armorGuiID:
player.openGui(TConstruct.instance, ArmorProxyCommon.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
break;
case TProxyCommon.knapsackGuiID:
player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
case ArmorProxyCommon.knapsackGuiID:
player.openGui(TConstruct.instance, ArmorProxyCommon.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
break;
}
}