@Override public boolean equals(Object o) { return o instanceof DimWithPos && dim == ((DimWithPos) o).dim && blockPos.equals(((DimWithPos) o).blockPos); }
@Override public boolean equals(Object other) { if(!(other instanceof SwapCandidate)) return false; SwapCandidate cand = (SwapCandidate) other; return coordinates.equals(cand.coordinates) && range == cand.range; }
@Override public boolean equals(Object o) { return o instanceof PositionProperties && ((PositionProperties) o).state == state && ((PositionProperties) o).coords.equals(coords); } }
public boolean coordsEqual(PositionProperties props) { return coords.equals(props.coords); }
@Override public boolean equals(Object o) { return o instanceof InvWithLocation && handler.equals(((InvWithLocation) o).handler) && world == ((InvWithLocation) o).world && pos.equals(((InvWithLocation) o).pos); }
@Override public boolean isValidBlock(World world, BlockPos pos) { // controller always is valid if(pos.equals(tile.getPos())) { return true; } // only seared blocks in the main structure return world.getBlockState(pos).getBlock() == TinkerSmeltery.searedBlock && isValidSlave(world, pos); }
@Override public boolean isValidBlock(World world, BlockPos pos) { // controller always is valid if(pos.equals(tile.getPos())) { return true; } // main structure can use anything return TinkerSmeltery.validTinkerTankBlocks.contains(world.getBlockState(pos).getBlock()) && isValidSlave(world, pos); }
public boolean equalPos(RayTraceResult pos) { return pos.getBlockPos().equals(this.pos.getBlockPos()); } }
@Override public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { boolean bound = super.bindTo(player, wand, pos, side); if(!bound && !pos.equals(bindPos) && pos.distanceSq(supertile.getPos()) <= BIND_RANGE * BIND_RANGE && !pos.equals(supertile.getPos())) { bindPos = pos; sync(); return true; } return bound; }
public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, BlockPos centerPos, Vec3i startDelta, Vec3i endDelta, Predicate<IBlockState> filter, boolean dispose) { for (BlockPos iterPos : BlockPos.getAllInBox(centerPos.add(startDelta), centerPos.add(endDelta))) { if (iterPos.equals(centerPos)) // skip original block space to avoid crash, vanilla code in the tool class will handle it continue; removeBlockWithDrops(player, stack, world, iterPos, filter, dispose); } }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { this.refresh(); } }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { this.resetCache( false ); } }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { this.refresh(); } }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { this.opacity = -1; this.getHost().markForUpdate(); } }
@Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true); } else dead = false; return dead; }
@Override public boolean acceptBlock(BlockPos pos) { if(pos.equals(getPos().up())) return false; Block block = world.getBlockState(pos).getBlock(); TileEntity tile = world.getTileEntity(pos); return (block instanceof BlockFlower || block instanceof BlockMushroom || block instanceof BlockDoublePlant) && (tile == null || !(tile instanceof ISubTileContainer)); }
@Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true); } else dead = false; return dead; }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( this.isOutput() && pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { this.opacity = -1; this.getHost().markForUpdate(); } else { this.doWork(); } }
@Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { ItemStack fireworkStack = generateFirework(burst.getColor()); EntityFireworkRocket rocket = new EntityFireworkRocket(entity.world, entity.posX, entity.posY, entity.posZ, fireworkStack); entity.world.spawnEntity(rocket); } } else dead = false; return dead; }
@Override public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor ) { if( pos.offset( this.getSide().getFacing() ).equals( neighbor ) ) { final TileEntity te = this.getHost().getTile(); final AEPartLocation side = this.getSide(); final BlockPos tePos = te.getPos().offset( side.getFacing() ); this.blocked = !w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ); } }