make it give the achievement to the player who places it down, not the one who is the closest
This commit is contained in:
parent
dbc0fe42ad
commit
45d1458ae5
5 changed files with 16 additions and 10 deletions
|
@ -110,8 +110,9 @@ public class BlockFiller extends BlockContainer {
|
|||
}
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack){
|
||||
if (world.getClosestPlayer(i, j, k, 5)!=null){
|
||||
world.getClosestPlayer(i, j, k, 5).addStat(BuildCraftCore.fasterFillingAchievement, 1);
|
||||
if (entityliving instanceof EntityPlayer){
|
||||
EntityPlayer p=(EntityPlayer) entityliving;
|
||||
p.addStat(BuildCraftCore.fasterFillingAchievement, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,8 +80,9 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
|
|||
}
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
|
||||
if (world.getClosestPlayer(i, j, k, 5)!=null){
|
||||
world.getClosestPlayer(i, j, k, 5).addStat(BuildCraftCore.aLotOfCraftingAchievement, 1);
|
||||
if (entityliving instanceof EntityPlayer){
|
||||
EntityPlayer p=(EntityPlayer) entityliving;
|
||||
p.addStat(BuildCraftCore.aLotOfCraftingAchievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
@ -64,8 +65,9 @@ public class BlockMiningWell extends BlockBuildCraft {
|
|||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
|
||||
ForgeDirection orientation = Utils.get2dOrientation(entityliving);
|
||||
if (world.getClosestPlayer(i, j, k, 5)!=null){
|
||||
world.getClosestPlayer(i, j, k, 5).addStat(BuildCraftCore.straightDownAchievement, 1);
|
||||
if (entityliving instanceof EntityPlayer){
|
||||
EntityPlayer p=(EntityPlayer) entityliving;
|
||||
p.addStat(BuildCraftCore.straightDownAchievement, 1);
|
||||
}
|
||||
world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
|
||||
}
|
||||
|
|
|
@ -52,8 +52,9 @@ public class BlockQuarry extends BlockBuildCraft {
|
|||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
|
||||
super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
|
||||
if (world.getClosestPlayer(i, j, k, 5)!=null){
|
||||
world.getClosestPlayer(i, j, k, 5).addStat(BuildCraftCore.chunkDestroyerAchievement, 1);
|
||||
if (entityliving instanceof EntityPlayer){
|
||||
EntityPlayer p=(EntityPlayer) entityliving;
|
||||
p.addStat(BuildCraftCore.chunkDestroyerAchievement, 1);
|
||||
}
|
||||
|
||||
ForgeDirection orientation = Utils.get2dOrientation(entityliving);
|
||||
|
|
|
@ -137,8 +137,9 @@ public class BlockLaserTable extends BlockContainer {
|
|||
}
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack){
|
||||
if (world.getClosestPlayer(i, j, k, 5)!=null){
|
||||
world.getClosestPlayer(i, j, k, 5).addStat(BuildCraftCore.timeForSomeLogicAchievement, 1);
|
||||
if (entityliving instanceof EntityPlayer){
|
||||
EntityPlayer p=(EntityPlayer) entityliving;
|
||||
p.addStat(BuildCraftCore.timeForSomeLogicAchievement, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue