Start on the update

This commit is contained in:
modmuss50 2016-11-19 12:50:08 +00:00
parent c8d8ce0241
commit a0e6a2dc34
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
112 changed files with 522 additions and 503 deletions

View file

@ -83,9 +83,9 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse( EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
}
@Override

View file

@ -70,9 +70,9 @@ public class ItemCloakingDevice extends ItemTextureBase implements IEnergyItemIn
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
ItemStack itemstack1 = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if (itemstack1 == null) {
if (itemstack1 == ItemStack.EMPTY) {
player.setItemStackToSlot(EntityEquipmentSlot.CHEST, itemStack.copy());
itemStack.stackSize = 0;
itemStack.setCount(0);
}
return itemStack;

View file

@ -37,12 +37,12 @@ public class ItemDebugTool extends ItemTextureBase implements ITexturedItem {
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
TileEntity tile = worldIn.getTileEntity(pos);
if (tile instanceof IEnergyInterfaceTile) {
if (!tile.getWorld().isRemote) {
playerIn.addChatComponentMessage(
playerIn.sendMessage(
new TextComponentString(TextFormatting.GREEN + "Power" + TextFormatting.BLUE
+ PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy())));
}

View file

@ -81,9 +81,9 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
}
@Override

View file

@ -81,9 +81,9 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
}
@Override

View file

@ -69,9 +69,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
modifier = 9;
if (slot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(),
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(),
new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) modifier, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(),
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4000000953674316D, 0));
}
return multimap;
@ -130,8 +130,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player,
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
EnumHand hand) {
ItemStack stack = player.getHeldItem(hand);
if (player.isSneaking()) {
if (!PoweredItem.canUseEnergy(cost, stack)) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(

View file

@ -88,9 +88,9 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, ITextu
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
return TorchHelper.placeTorch(playerIn.getHeldItem(hand), playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
}
@Override

View file

@ -25,11 +25,11 @@ public class ItemTechManual extends ItemTextureBase implements ITexturedItem {
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player,
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
EnumHand hand) {
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, (int) player.posX, (int) player.posY,
(int) player.posY);
return new ActionResult<>(EnumActionResult.SUCCESS, itemStackIn);
return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
@Override

View file

@ -49,13 +49,13 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
}
@Override
public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos,
public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos,
EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
if(!PermissionAPI.hasPermission(player.getGameProfile(), RebornPermissions.WRENCH_BLOCK, new BlockPosContext(player, pos, world.getBlockState(pos), side))){
return EnumActionResult.FAIL;
}
if (CompatManager.isIC2Loaded) {
EnumActionResult result = IC2WrenchHelper.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
EnumActionResult result = IC2WrenchHelper.onItemUseFirst(player.getHeldItem(hand), player, world, pos, side, hitX, hitY, hitZ, hand);
if (result == EnumActionResult.SUCCESS) {
return result;
}
@ -68,7 +68,7 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
return EnumActionResult.FAIL;
}
if (!player.isSneaking() && !player.worldObj.isRemote) {
if (!player.isSneaking() && !player.world.isRemote) {
if (tile instanceof TileMachineBase) {
if (side != EnumFacing.DOWN && side != EnumFacing.UP) {
((TileMachineBase) tile).setFacing(side);
@ -76,17 +76,17 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
}
}
}
return super.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
return super.onItemUseFirst(player, world, pos, side, hitX, hitY, hitZ, hand);
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos,
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if(!PermissionAPI.hasPermission(player.getGameProfile(), RebornPermissions.WRENCH_BLOCK, new BlockPosContext(player, pos, world.getBlockState(pos), facing))){
return EnumActionResult.FAIL;
}
if (CompatManager.isIC2Loaded) {
EnumActionResult result = IC2WrenchHelper.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ);
EnumActionResult result = IC2WrenchHelper.onItemUse(player.getHeldItem(hand), player, world, pos, hand, facing, hitX, hitY, hitZ);
if (result == EnumActionResult.SUCCESS) {
return result;
}
@ -106,8 +106,8 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack itemStack = inventory.getStackInSlot(i);
if (itemStack != null) {
if (itemStack.stackSize > 0) {
if (itemStack != ItemStack.EMPTY) {
if (itemStack.getCount() > 0) {
if (itemStack.getItem() instanceof ItemBlock)
if (!(((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase) || !(((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid)
@ -147,7 +147,7 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
entityItem.motionZ = rand.nextGaussian() * factor;
if (!world.isRemote) {
world.spawnEntityInWorld(entityItem);
world.spawnEntity(entityItem);
}
}
}