1.11, first step.

This commit is contained in:
Ellpeck 2016-11-19 21:11:17 +01:00
parent 483d20ff99
commit ec8c642099
132 changed files with 317 additions and 740 deletions

View file

@ -23,10 +23,10 @@ if(hasProperty('buildnumber')){
} }
minecraft { minecraft {
version = "1.10.2-12.18.2.2121" version = "1.11-13.19.0.2153"
runDir = "idea" runDir = "idea"
mappings = "snapshot_20160519" mappings = "snapshot_20161111"
makeObfSourceJar = false makeObfSourceJar = false
//useDepAts = true //useDepAts = true
@ -45,7 +45,7 @@ repositories {
dependencies { dependencies {
compile "net.darkhax.tesla:Tesla:1.10.2-1.2.1.49" compile "net.darkhax.tesla:Tesla:1.10.2-1.2.1.49"
deobfCompile "mezz.jei:jei_1.10.2:3.13.2.360" deobfCompile "mezz.jei:jei_1.11:4.0.1.193"
} }
processResources { processResources {

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip

View file

@ -64,7 +64,8 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack heldItem = player.getHeldItem(hand);
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }
@ -140,7 +141,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -43,7 +43,7 @@ public class BlockBioReactor extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
if(world.getTileEntity(pos) instanceof TileEntityBioReactor){ if(world.getTileEntity(pos) instanceof TileEntityBioReactor){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BIO_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BIO_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());

View file

@ -52,7 +52,7 @@ public class BlockBreaker extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }
@ -73,7 +73,7 @@ public class BlockBreaker extends BlockContainerBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -52,11 +52,11 @@ public class BlockCanolaPress extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(pos); TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(pos);
if(press != null){ if(press != null){
if(this.checkFailUseItemOnTank(player, stack, press.tank)){ if(this.checkFailUseItemOnTank(player, player.getHeldItem(hand), press.tank)){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
} }
} }

View file

@ -77,7 +77,7 @@ public class BlockCoalGenerator extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(pos); TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(pos);
if(press != null){ if(press != null){

View file

@ -61,11 +61,11 @@ public class BlockCoffeeMachine extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing f6, float f7, float f8, float f9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing f6, float f7, float f8, float f9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(pos); TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(pos);
if(machine != null){ if(machine != null){
if(this.checkFailUseItemOnTank(player, stack, machine.tank)){ if(this.checkFailUseItemOnTank(player, player.getHeldItem(hand), machine.tank)){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
} }
} }

View file

@ -29,6 +29,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -64,7 +65,8 @@ public class BlockColoredLamp extends BlockBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){
ItemStack stack = player.getHeldItem(hand);
//Turning On //Turning On
if(player.isSneaking()){ if(player.isSneaking()){
if(!world.isRemote){ if(!world.isRemote){
@ -105,7 +107,7 @@ public class BlockColoredLamp extends BlockBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){ public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_LAMP_TYPES.length; j++){ for(int j = 0; j < ALL_LAMP_TYPES.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }

View file

@ -82,7 +82,8 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stackPlayer, EnumFacing f6, float f7, float f8, float f9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing f6, float f7, float f8, float f9){
ItemStack stackPlayer = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityCompost){ if(tile instanceof TileEntityCompost){

View file

@ -23,6 +23,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -50,7 +51,7 @@ public class BlockCrystal extends BlockBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){ public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_CRYSTALS.length; j++){ for(int j = 0; j < ALL_CRYSTALS.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }

View file

@ -49,7 +49,7 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }
@ -70,7 +70,7 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -50,7 +50,8 @@ public class BlockDisplayStand extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,EnumFacing par6, float par7, float par8, float par9){
ItemStack heldItem = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
TileEntityDisplayStand stand = (TileEntityDisplayStand)world.getTileEntity(pos); TileEntityDisplayStand stand = (TileEntityDisplayStand)world.getTileEntity(pos);
if(stand != null){ if(stand != null){

View file

@ -48,7 +48,7 @@ public class BlockDropper extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }
@ -69,7 +69,7 @@ public class BlockDropper extends BlockContainerBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -50,7 +50,8 @@ public class BlockEmpowerer extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack heldItem = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
TileEntityEmpowerer empowerer = (TileEntityEmpowerer)world.getTileEntity(pos); TileEntityEmpowerer empowerer = (TileEntityEmpowerer)world.getTileEntity(pos);
if(empowerer != null){ if(empowerer != null){

View file

@ -47,7 +47,7 @@ public class BlockEnergizer extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
if(this.isEnergizer){ if(this.isEnergizer){
TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(pos); TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(pos);

View file

@ -48,7 +48,7 @@ public class BlockFarmer extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityFarmer farmer = (TileEntityFarmer)world.getTileEntity(pos); TileEntityFarmer farmer = (TileEntityFarmer)world.getTileEntity(pos);
if(farmer != null){ if(farmer != null){

View file

@ -43,7 +43,7 @@ public class BlockFeeder extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(pos); TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(pos);
if(feeder != null){ if(feeder != null){

View file

@ -58,7 +58,8 @@ public class BlockFermentingBarrel extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack heldItem = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(pos); TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(pos);
if(press != null){ if(press != null){

View file

@ -42,7 +42,7 @@ public class BlockFireworkBox extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
return this.tryToggleRedstone(world, pos, player); return this.tryToggleRedstone(world, pos, player);
} }

View file

@ -53,7 +53,8 @@ public class BlockFluidCollector extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack stack = player.getHeldItem(hand);
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }
@ -76,7 +77,7 @@ public class BlockFluidCollector extends BlockContainerBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -96,7 +96,7 @@ public class BlockFurnaceDouble extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(pos); TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(pos);
if(furnace != null){ if(furnace != null){

View file

@ -79,7 +79,7 @@ public class BlockGiantChest extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(pos); TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(pos);
if(chest != null){ if(chest != null){
@ -106,7 +106,7 @@ public class BlockGiantChest extends BlockContainerBase{
for(int i = 0; i < list.tagCount(); i++){ for(int i = 0; i < list.tagCount(); i++){
NBTTagCompound compound = list.getCompoundTagAt(i); NBTTagCompound compound = list.getCompoundTagAt(i);
if(compound != null && compound.hasKey("id")){ if(compound != null && compound.hasKey("id")){
slots[i] = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i)); slots[i] = new ItemStack(list.getCompoundTagAt(i));
} }
} }
} }

View file

@ -71,7 +71,7 @@ public class BlockGrinder extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(pos); TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(pos);
if(grinder != null){ if(grinder != null){

View file

@ -58,7 +58,7 @@ public class BlockInputter extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(pos); TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(pos);
if(inputter != null){ if(inputter != null){

View file

@ -46,7 +46,7 @@ public class BlockItemRepairer extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(pos); TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(pos);
if(repairer != null){ if(repairer != null){

View file

@ -42,7 +42,7 @@ public class BlockLampPowerer extends BlockBase{
} }
@Override @Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos otherPos){
this.updateLamp(worldIn, pos); this.updateLamp(worldIn, pos);
} }
@ -53,7 +53,7 @@ public class BlockLampPowerer extends BlockBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); int rotation = EnumFacing.func_190914_a(pos, player).ordinal();
world.setBlockState(pos, this.getStateFromMeta(rotation), 2); world.setBlockState(pos, this.getStateFromMeta(rotation), 2);
super.onBlockPlacedBy(world, pos, state, player, stack); super.onBlockPlacedBy(world, pos, state, player, stack);

View file

@ -135,7 +135,8 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack stack = player.getHeldItem(hand);
TileEntityLaserRelay tile = (TileEntityLaserRelay)world.getTileEntity(pos); TileEntityLaserRelay tile = (TileEntityLaserRelay)world.getTileEntity(pos);
if(tile instanceof TileEntityLaserRelayItem){ if(tile instanceof TileEntityLaserRelayItem){
TileEntityLaserRelayItem relay = (TileEntityLaserRelayItem)tile; TileEntityLaserRelayItem relay = (TileEntityLaserRelayItem)tile;

View file

@ -49,7 +49,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityMiner){ if(tile instanceof TileEntityMiner){

View file

@ -23,6 +23,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -47,7 +48,7 @@ public class BlockMisc extends BlockBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){ public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_MISC_BLOCKS.length; j++){ for(int j = 0; j < ALL_MISC_BLOCKS.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }

View file

@ -77,7 +77,8 @@ public class BlockOilGenerator extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(pos); TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(pos);
if(generator != null){ if(generator != null){

View file

@ -106,7 +106,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){
if(this.tryToggleRedstone(world, pos, player)){ if(this.tryToggleRedstone(world, pos, player)){
return true; return true;
} }

View file

@ -43,7 +43,7 @@ public class BlockRangedCollector extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityRangedCollector breaker = (TileEntityRangedCollector)world.getTileEntity(pos); TileEntityRangedCollector breaker = (TileEntityRangedCollector)world.getTileEntity(pos);
if(breaker != null){ if(breaker != null){

View file

@ -118,7 +118,8 @@ public class BlockSlabs extends BlockBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
ItemStack stack = playerIn.getHeldItem(hand);
if(StackUtil.isValid(stack) && playerIn.canPlayerEdit(pos.offset(facing), facing, stack)){ if(StackUtil.isValid(stack) && playerIn.canPlayerEdit(pos.offset(facing), facing, stack)){
IBlockState state = worldIn.getBlockState(pos); IBlockState state = worldIn.getBlockState(pos);
@ -138,7 +139,7 @@ public class BlockSlabs extends BlockBase{
} }
} }
return this.tryPlace(playerIn, stack, hand, worldIn, pos.offset(facing)) ? EnumActionResult.SUCCESS : super.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); return this.tryPlace(playerIn, stack, hand, worldIn, pos.offset(facing)) ? EnumActionResult.SUCCESS : super.onItemUse(playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
} }
else{ else{
return EnumActionResult.FAIL; return EnumActionResult.FAIL;

View file

@ -72,7 +72,7 @@ public class BlockSmileyCloud extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing f6, float f7, float f8, float f9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing f6, float f7, float f8, float f9){
if(!world.isRemote){ if(!world.isRemote){
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntitySmileyCloud){ if(tile instanceof TileEntitySmileyCloud){

View file

@ -26,6 +26,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Random; import java.util.Random;
//Copied from BlockTorch. //Copied from BlockTorch.
@ -66,8 +67,9 @@ public class BlockTinyTorch extends BlockBase{
} }
} }
@Nullable
@Override @Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos){ public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos){
return NULL_AABB; return NULL_AABB;
} }
@ -125,7 +127,7 @@ public class BlockTinyTorch extends BlockBase{
} }
@Override @Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos otherPos){
this.onNeighborChangeInternal(worldIn, pos, state); this.onNeighborChangeInternal(worldIn, pos, state);
} }

View file

@ -66,7 +66,7 @@ public class BlockTreasureChest extends BlockBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
world.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.2F, world.rand.nextFloat()*0.1F+0.9F); world.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.2F, world.rand.nextFloat()*0.1F+0.9F);
this.dropItems(world, pos); this.dropItems(world, pos);

View file

@ -22,6 +22,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -109,7 +110,7 @@ public class BlockWallAA extends BlockBase{
} }
@Override @Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos){ public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos){
blockState = this.getActualState(blockState, worldIn, pos); blockState = this.getActualState(blockState, worldIn, pos);
return CLIP_AABB_BY_INDEX[yesThisIsCopyPastedFromBlockWallAndIHaveNoIdeaWhatThisMethodDoes(blockState)]; return CLIP_AABB_BY_INDEX[yesThisIsCopyPastedFromBlockWallAndIHaveNoIdeaWhatThisMethodDoes(blockState)];
} }
@ -126,7 +127,7 @@ public class BlockWallAA extends BlockBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){ public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){
list.add(new ItemStack(item, 1, 0)); list.add(new ItemStack(item, 1, 0));
} }

View file

@ -28,6 +28,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
@ -65,7 +66,7 @@ public class BlockWildPlant extends BlockBushBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){ public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_WILD_PLANTS.length; j++){ for(int j = 0; j < ALL_WILD_PLANTS.length; j++){
list.add(new ItemStack(item, 1, j)); list.add(new ItemStack(item, 1, j));
} }

View file

@ -49,7 +49,7 @@ public class BlockXPSolidifier extends BlockContainerBase{
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){
if(!world.isRemote){ if(!world.isRemote){
TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(pos); TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(pos);
if(solidifier != null){ if(solidifier != null){

View file

@ -37,6 +37,7 @@ import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidActionResult;
import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidUtil; import net.minecraftforge.fluids.FluidUtil;
@ -167,8 +168,8 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
} }
@Override @Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){ public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos otherPos){
super.neighborChanged(state, worldIn, pos, blockIn); super.neighborChanged(state, worldIn, pos, blockIn, otherPos);
this.neighborsChangedCustom(worldIn, pos); this.neighborsChangedCustom(worldIn, pos);
} }
@ -201,7 +202,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
} }
protected boolean checkFailUseItemOnTank(EntityPlayer player, ItemStack heldItem, FluidTank tank){ protected boolean checkFailUseItemOnTank(EntityPlayer player, ItemStack heldItem, FluidTank tank){
return !StackUtil.isValid(heldItem) || !FluidUtil.interactWithFluidHandler(heldItem, tank, player); return !StackUtil.isValid(heldItem) || !FluidUtil.interactWithFluidHandler(heldItem, tank, player).isSuccess();
} }
@Override @Override

View file

@ -90,7 +90,7 @@ public class BlockPlant extends BlockCrops implements ItemBlockBase.ICustomRarit
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing facing, float hitX, float hitY, float hitZ){ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
if(this.getMetaFromState(state) >= 7){ if(this.getMetaFromState(state) >= 7){
if(!world.isRemote){ if(!world.isRemote){

View file

@ -18,6 +18,7 @@ import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.common.ForgeModContainer; import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.fluids.UniversalBucket; import net.minecraftforge.fluids.UniversalBucket;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -28,7 +29,7 @@ import java.util.List;
public class CreativeTab extends CreativeTabs{ public class CreativeTab extends CreativeTabs{
public static final CreativeTab INSTANCE = new CreativeTab(); public static final CreativeTab INSTANCE = new CreativeTab();
private List<ItemStack> list; private NonNullList<ItemStack> list;
public CreativeTab(){ public CreativeTab(){
super(ModUtil.MOD_ID); super(ModUtil.MOD_ID);
@ -46,13 +47,13 @@ public class CreativeTab extends CreativeTabs{
} }
@Override @Override
public Item getTabIconItem(){ public ItemStack getTabIconItem(){
return InitItems.itemBooklet; return new ItemStack(InitItems.itemBooklet);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void displayAllRelevantItems(List<ItemStack> list){ public void displayAllRelevantItems(NonNullList<ItemStack> list){
this.list = list; this.list = list;
this.add(InitItems.itemBooklet); this.add(InitItems.itemBooklet);

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.entity;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -22,7 +23,7 @@ public final class InitEntities{
public static void init(){ public static void init(){
ModUtil.LOGGER.info("Initializing Entities..."); ModUtil.LOGGER.info("Initializing Entities...");
EntityRegistry.registerModEntity(EntityWorm.class, ModUtil.MOD_ID+".worm", 0, ActuallyAdditions.instance, 64, 1, false); EntityRegistry.registerModEntity(new ResourceLocation(ModUtil.MOD_ID, "worm"), EntityWorm.class, ModUtil.MOD_ID+".worm", 0, ActuallyAdditions.instance, 64, 1, false);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.gen;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.entity.IMerchant;
import net.minecraft.entity.passive.EntityVillager.ITradeList; import net.minecraft.entity.passive.EntityVillager.ITradeList;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -24,7 +25,7 @@ import java.util.Random;
public class JamVillagerTradeList implements ITradeList{ public class JamVillagerTradeList implements ITradeList{
@Override @Override
public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random){ public void func_190888_a(IMerchant merchant, MerchantRecipeList recipeList, Random random){
for(int i = 0; i < random.nextInt(3)+3; i++){ for(int i = 0; i < random.nextInt(3)+3; i++){
ItemStack jam = new ItemStack(InitItems.itemJams, 1, random.nextInt(TheJams.values().length)); ItemStack jam = new ItemStack(InitItems.itemJams, 1, random.nextInt(TheJams.values().length));
ItemStack emerald = new ItemStack(Items.EMERALD); ItemStack emerald = new ItemStack(Items.EMERALD);

View file

@ -115,7 +115,7 @@ public class OreGen implements IWorldGenerator{
BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8); BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8);
randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos); randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos);
if(event.getWorld().getBiomeGenForCoords(randomPos) instanceof BiomeOcean){ if(event.getWorld().getBiome(randomPos) instanceof BiomeOcean){
if(randomPos.getY() >= 25 && randomPos.getY() <= 45){ if(randomPos.getY() >= 25 && randomPos.getY() <= 45){
if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){ if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){
if(event.getWorld().getBlockState(randomPos.down()).getMaterial().isSolid()){ if(event.getWorld().getBlockState(randomPos.down()).getMaterial().isSolid()){

View file

@ -183,7 +183,7 @@ public class ContainerBag extends Container implements IButtonReactor{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }
@ -308,6 +308,11 @@ public class ContainerBag extends Container implements IButtonReactor{
return this.slots.length; return this.slots.length;
} }
@Override
public boolean func_191420_l(){
return StackUtil.isIInvEmpty(this.slots);
}
@Override @Override
public ItemStack getStackInSlot(int i){ public ItemStack getStackInSlot(int i){
if(i < this.getSizeInventory()){ if(i < this.getSizeInventory()){

View file

@ -88,7 +88,7 @@ public class ContainerBioReactor extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -85,7 +85,7 @@ public class ContainerBreaker extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -87,7 +87,7 @@ public class ContainerCanolaPress extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -86,7 +86,7 @@ public class ContainerCoalGenerator extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -114,7 +114,7 @@ public class ContainerCoffeeMachine extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -91,7 +91,7 @@ public class ContainerCrafter extends Container{
return StackUtil.getNull(); return StackUtil.getNull();
} }
slot.onPickupFromSlot(player, itemstack1); slot.func_190901_a(player, itemstack1);
} }
return itemstack; return itemstack;

View file

@ -85,7 +85,7 @@ public class ContainerDirectionalBreaker extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -115,7 +115,7 @@ public class ContainerDrill extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }
@ -222,6 +222,11 @@ public class ContainerDrill extends Container{
return this.slots.length; return this.slots.length;
} }
@Override
public boolean func_191420_l(){
return StackUtil.isIInvEmpty(this.slots);
}
@Override @Override
public ItemStack getStackInSlot(int i){ public ItemStack getStackInSlot(int i){
if(i < this.getSizeInventory()){ if(i < this.getSizeInventory()){

View file

@ -85,7 +85,7 @@ public class ContainerDropper extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -124,7 +124,7 @@ public class ContainerEnergizer extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -123,7 +123,7 @@ public class ContainerEnervator extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -95,7 +95,7 @@ public class ContainerFarmer extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -80,7 +80,7 @@ public class ContainerFeeder extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -75,7 +75,7 @@ public class ContainerFermentingBarrel extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -104,7 +104,7 @@ public class ContainerFilter extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }
@ -215,6 +215,11 @@ public class ContainerFilter extends Container{
return this.slots.length; return this.slots.length;
} }
@Override
public boolean func_191420_l(){
return StackUtil.isIInvEmpty(this.slots);
}
@Override @Override
public ItemStack getStackInSlot(int i){ public ItemStack getStackInSlot(int i){
if(i < this.getSizeInventory()){ if(i < this.getSizeInventory()){

View file

@ -82,7 +82,7 @@ public class ContainerFluidCollector extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -99,7 +99,7 @@ public class ContainerFurnaceDouble extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -86,7 +86,7 @@ public class ContainerGiantChest extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -110,7 +110,7 @@ public class ContainerGrinder extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -97,7 +97,7 @@ public class ContainerInputter extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -85,7 +85,7 @@ public class ContainerLaserRelayItemWhitelist extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -85,7 +85,7 @@ public class ContainerMiner extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -74,7 +74,7 @@ public class ContainerOilGenerator extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -85,7 +85,7 @@ public class ContainerPhantomPlacer extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -92,7 +92,7 @@ public class ContainerRangedCollector extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -87,7 +87,7 @@ public class ContainerRepairer extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -85,7 +85,7 @@ public class ContainerXPSolidifier extends Container{
if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){
return StackUtil.getNull(); return StackUtil.getNull();
} }
theSlot.onPickupFromSlot(player, newStack); theSlot.func_190901_a(player, newStack);
return currentStack; return currentStack;
} }

View file

@ -64,12 +64,12 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){
if(!playerIn.isSneaking()){ if(!playerIn.isSneaking()){
return Items.IRON_HOE.onItemUse(stack, playerIn, worldIn, pos, hand, side, hitX, hitY, hitZ); return Items.IRON_HOE.onItemUse(playerIn, worldIn, pos, hand, side, hitX, hitY, hitZ);
} }
else{ else{
return Items.IRON_SHOVEL.onItemUse(stack, playerIn, worldIn, pos, hand, side, hitX, hitY, hitZ); return Items.IRON_SHOVEL.onItemUse(playerIn, worldIn, pos, hand, side, hitX, hitY, hitZ);
} }
} }

View file

@ -137,7 +137,8 @@ public class ItemBag extends ItemBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
ItemStack stack = playerIn.getHeldItem(hand);
if(!this.isVoid){ if(!this.isVoid){
TileEntity tile = worldIn.getTileEntity(pos); TileEntity tile = worldIn.getTileEntity(pos);
if(tile != null && tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing)){ if(tile != null && tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing)){
@ -178,11 +179,11 @@ public class ItemBag extends ItemBase{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
if(!world.isRemote){ if(!world.isRemote){
player.openGui(ActuallyAdditions.instance, (this.isVoid ? GuiTypes.VOID_BAG : GuiTypes.BAG).ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.instance, (this.isVoid ? GuiTypes.VOID_BAG : GuiTypes.BAG).ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand));
} }
@Override @Override

View file

@ -77,14 +77,15 @@ public class ItemBattery extends ItemEnergy{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){
ItemStack stack = player.getHeldItem(hand);
if(!worldIn.isRemote && player.isSneaking()){ if(!worldIn.isRemote && player.isSneaking()){
boolean isDischarge = this.isDischargeMode(stack); boolean isDischarge = this.isDischargeMode(stack);
this.setDischargeMode(stack, !isDischarge); this.setDischargeMode(stack, !isDischarge);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
} }
return super.onItemRightClick(stack, worldIn, player, hand); return super.onItemRightClick(worldIn, player, hand);
} }
private boolean isDischargeMode(ItemStack stack){ private boolean isDischargeMode(ItemStack stack){

View file

@ -54,7 +54,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing face, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing face, float hitX, float hitY, float hitZ){
if(player.isSneaking()){ if(player.isSneaking()){
IBlockState state = world.getBlockState(pos); IBlockState state = world.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
@ -64,7 +64,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
if(world.isRemote){ if(world.isRemote){
forcedPage = page; forcedPage = page;
} }
this.onItemRightClick(stack, world, player, hand); this.onItemRightClick(world, player, hand);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
} }
@ -73,14 +73,14 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
if(!world.isRemote){ if(!world.isRemote){
TheAchievements.OPEN_BOOKLET.get(player); TheAchievements.OPEN_BOOKLET.get(player);
TheAchievements.OPEN_BOOKLET_MILESTONE.get(player); TheAchievements.OPEN_BOOKLET_MILESTONE.get(player);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
@Override @Override

View file

@ -37,7 +37,8 @@ public class ItemChestToCrateUpgrade extends ItemBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack heldStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10){
ItemStack heldStack = player.getHeldItem(hand);
if(player.isSneaking()){ if(player.isSneaking()){
TileEntity tileHit = world.getTileEntity(pos); TileEntity tileHit = world.getTileEntity(pos);
if(tileHit.getClass() == this.start){ if(tileHit.getClass() == this.start){
@ -79,7 +80,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{
} }
} }
return super.onItemUse(heldStack, player, world, pos, hand, facing, par8, par9, par10); return super.onItemUse(player, world, pos, hand, facing, par8, par9, par10);
} }

View file

@ -30,11 +30,11 @@ public class ItemCrafterOnAStick extends ItemBase{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
if(!world.isRemote){ if(!world.isRemote){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }

View file

@ -18,6 +18,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -58,7 +59,7 @@ public class ItemCrystal extends ItemBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < BlockCrystal.ALL_CRYSTALS.length; j++){ for(int j = 0; j < BlockCrystal.ALL_CRYSTALS.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }

View file

@ -104,7 +104,8 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
//Places Blocks if the Placing Upgrade is installed //Places Blocks if the Placing Upgrade is installed
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){
ItemStack stack = player.getHeldItem(hand);
ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER); ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER);
if(StackUtil.isValid(upgrade)){ if(StackUtil.isValid(upgrade)){
int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade); int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade);
@ -127,7 +128,7 @@ public class ItemDrill extends ItemEnergy{
} }
//Notify the Player and log the Exception //Notify the Player and log the Exception
catch(Exception e){ catch(Exception e){
player.addChatComponentMessage(new TextComponentString("Ouch! That really hurt! You must have done something wrong, don't do that again please!")); player.addChatMessage(new TextComponentString("Ouch! That really hurt! You must have done something wrong, don't do that again please!"));
ModUtil.LOGGER.error("Player "+player.getName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!"); ModUtil.LOGGER.error("Player "+player.getName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!");
} }
} }
@ -168,11 +169,11 @@ public class ItemDrill extends ItemEnergy{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
if(!world.isRemote && player.isSneaking()){ if(!world.isRemote && player.isSneaking()){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand));
} }
@Override @Override
@ -366,7 +367,7 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List list){ public void getSubItems(Item item, CreativeTabs tabs, NonNullList list){
for(int i = 0; i < 16; i++){ for(int i = 0; i < 16; i++){
this.addDrillStack(list, i); this.addDrillStack(list, i);
} }

View file

@ -39,7 +39,8 @@ public class ItemDrillUpgrade extends ItemBase{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote && this.type == UpgradeType.PLACER){ if(!world.isRemote && this.type == UpgradeType.PLACER){
this.setSlotToPlaceFrom(stack, player.inventory.currentItem); this.setSlotToPlaceFrom(stack, player.inventory.currentItem);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);

View file

@ -20,6 +20,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -53,7 +54,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_DUSTS.length; j++){ for(int j = 0; j < ALL_DUSTS.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }

View file

@ -33,14 +33,15 @@ public class ItemFertilizer extends ItemBase{
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10){
ItemStack stack = player.getHeldItem(hand);
if(ItemDye.applyBonemeal(stack, world, pos, player)){ if(ItemDye.applyBonemeal(stack, world, pos, player)){
if(!world.isRemote){ if(!world.isRemote){
world.playEvent(2005, pos, 0); world.playEvent(2005, pos, 0);
} }
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
return super.onItemUse(stack, player, world, pos, hand, side, par8, par9, par10); return super.onItemUse(player, world, pos, hand, side, par8, par9, par10);
} }

View file

@ -85,7 +85,8 @@ public class ItemFillingWand extends ItemEnergy{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote && player.getItemInUseCount() <= 0){ if(!world.isRemote && player.getItemInUseCount() <= 0){
if(player.isSneaking()){ if(player.isSneaking()){
IBlockState state = world.getBlockState(pos); IBlockState state = world.getBlockState(pos);

View file

@ -38,11 +38,11 @@ public class ItemFilter extends ItemBase{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
if(!world.isRemote){ if(!world.isRemote){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand));
} }
@Override @Override

View file

@ -24,6 +24,7 @@ import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -96,7 +97,7 @@ public class ItemFoods extends ItemFoodBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_FOODS.length; j++){ for(int j = 0; j < ALL_FOODS.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }

View file

@ -55,7 +55,8 @@ public class ItemHairyBall extends ItemBase{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
ItemStack returnItem = this.getRandomReturnItem(world.rand); ItemStack returnItem = this.getRandomReturnItem(world.rand);
if(!player.inventory.addItemStackToInventory(returnItem)){ if(!player.inventory.addItemStackToInventory(returnItem)){

View file

@ -26,6 +26,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -62,7 +63,7 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_JAMS.length; j++){ for(int j = 0; j < ALL_JAMS.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }

View file

@ -39,13 +39,14 @@ public class ItemLaserWrench extends ItemBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){
ItemStack stack = player.getHeldItem(hand);
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityLaserRelay){ if(tile instanceof TileEntityLaserRelay){
if(!world.isRemote){ if(!world.isRemote){
if(ItemPhantomConnector.getStoredPosition(stack) == null){ if(ItemPhantomConnector.getStoredPosition(stack) == null){
ItemPhantomConnector.storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); ItemPhantomConnector.storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world);
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.stored.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.stored.desc"));
} }
else{ else{
BlockPos savedPos = ItemPhantomConnector.getStoredPosition(stack); BlockPos savedPos = ItemPhantomConnector.getStoredPosition(stack);
@ -59,10 +60,10 @@ public class ItemLaserWrench extends ItemBase{
((TileEntityLaserRelay)savedTile).sendUpdate(); ((TileEntityLaserRelay)savedTile).sendUpdate();
relay.sendUpdate(); relay.sendUpdate();
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.connected.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.connected.desc"));
} }
else{ else{
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.cantConnect.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.cantConnect.desc"));
ItemPhantomConnector.clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored"); ItemPhantomConnector.clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored");
} }
} }

View file

@ -45,9 +45,9 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
player.setActiveHand(hand); player.setActiveHand(hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }

View file

@ -22,6 +22,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
@ -58,7 +59,7 @@ public class ItemMisc extends ItemBase{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_MISC_ITEMS.length; j++){ for(int j = 0; j < ALL_MISC_ITEMS.length; j++){
if(j != TheMiscItems.YOUTUBE_ICON.ordinal()){ if(j != TheMiscItems.YOUTUBE_ICON.ordinal()){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));

View file

@ -86,7 +86,8 @@ public class ItemPhantomConnector extends ItemBase{
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
//Passing Data to Phantoms //Passing Data to Phantoms
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
@ -99,7 +100,7 @@ public class ItemPhantomConnector extends ItemBase{
((TileEntityBase)tile).sendUpdate(); ((TileEntityBase)tile).sendUpdate();
} }
clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored"); clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored");
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.connected.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.connected.desc"));
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
return EnumActionResult.FAIL; return EnumActionResult.FAIL;
@ -107,7 +108,7 @@ public class ItemPhantomConnector extends ItemBase{
} }
//Storing Connections //Storing Connections
storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world);
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.stored.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.stored.desc"));
} }
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
@ -120,7 +121,7 @@ public class ItemPhantomConnector extends ItemBase{
if(tile instanceof IPhantomTile){ if(tile instanceof IPhantomTile){
((IPhantomTile)tile).setBoundPosition(null); ((IPhantomTile)tile).setBoundPosition(null);
} }
player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.unbound.desc")); player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.unbound.desc"));
return false; return false;
} }
} }

View file

@ -67,7 +67,8 @@ public class ItemPlayerProbe extends ItemBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
ItemStack stack = player.getHeldItem(hand);
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if(tile instanceof TileEntityPlayerInterface){ if(tile instanceof TileEntityPlayerInterface){
if(stack.hasTagCompound()){ if(stack.hasTagCompound()){

View file

@ -28,6 +28,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -91,7 +92,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list){ public void getSubItems(Item item, CreativeTabs tab, NonNullList list){
for(int j = 0; j < ALL_RINGS.length; j++){ for(int j = 0; j < ALL_RINGS.length; j++){
list.add(new ItemStack(this, 1, j)); list.add(new ItemStack(this, 1, j));
} }

View file

@ -28,7 +28,8 @@ public class ItemResonantRice extends ItemBase{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
stack = StackUtil.addStackSize(stack, -1); stack = StackUtil.addStackSize(stack, -1);
world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true); world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true);

View file

@ -51,8 +51,8 @@ public class ItemShovelAA extends ItemToolAA{
@Override @Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
return Items.IRON_SHOVEL.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); return Items.IRON_SHOVEL.onItemUse(playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ);
} }
@Override @Override

View file

@ -52,7 +52,8 @@ public class ItemSolidifiedExperience extends ItemBase{
} }
@Override @Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote){ if(!world.isRemote){
int amount; int amount;
if(!player.isSneaking()){ if(!player.isSneaking()){

View file

@ -29,6 +29,7 @@ import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -58,7 +59,7 @@ public class ItemSpawnerChanger extends ItemBase{
} }
@Override @Override
public EnumActionResult onItemUse(ItemStack aStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){
if(!world.isRemote){ if(!world.isRemote){
ItemStack stack = player.getHeldItemMainhand(); ItemStack stack = player.getHeldItemMainhand();
if(player.canPlayerEdit(pos.offset(facing), facing, stack)){ if(player.canPlayerEdit(pos.offset(facing), facing, stack)){
@ -76,7 +77,7 @@ public class ItemSpawnerChanger extends ItemBase{
compound.removeTag("SpawnData"); compound.removeTag("SpawnData");
logic.readFromNBT(compound); logic.readFromNBT(compound);
logic.setEntityName(entity); logic.func_190894_a(new ResourceLocation(entity));
tile.markDirty(); tile.markDirty();

Some files were not shown because too many files have changed in this diff Show more