Codota Logo
MultiServantLogic
Code IndexAdd Codota to your IDE (free)

How to use
MultiServantLogic
in
slimeknights.mantle.multiblock

Best Java code snippets using slimeknights.mantle.multiblock.MultiServantLogic (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: SlimeKnights/TinkersConstruct

 protected boolean isValidSlave(World world, BlockPos pos) {
  if(!world.isBlockLoaded(pos)) {
   return false;
  }
  TileEntity te = world.getTileEntity(pos);

  // slave-blocks are only allowed if they already belong to this smeltery
  if(te instanceof MultiServantLogic) {
   MultiServantLogic slave = (MultiServantLogic) te;
   if(slave.hasValidMaster()) {
    if(!tile.getPos().equals(slave.getMasterPosition())) {
     return false;
    }
   }
  }

  return true;
 }
}
origin: SlimeKnights/TinkersConstruct

 public static void assignMultiBlock(World world, BlockPos master, List<BlockPos> servants) {
  TileEntity masterBlock = world.getTileEntity(master);
  if(!(masterBlock instanceof IMasterLogic)) {
   throw new IllegalArgumentException("Master must be of IMasterLogic");
  }

  // assign master to each servant
  for(BlockPos pos : servants) {
   if(world.isBlockLoaded(pos)) {
    TileEntity slave = world.getTileEntity(pos);
    if(slave instanceof MultiServantLogic && slave.getWorld() != null) {
     ((MultiServantLogic) slave).overrideMaster(master);
     IBlockState state = world.getBlockState(pos);
     world.notifyBlockUpdate(pos, state, state, 3);
    }
   }
  }
 }
}
origin: SlimeKnights/TinkersConstruct

@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
 super.onDataPacket(net, pkt);
 readFromNBT(pkt.getNbtCompound());
}
origin: SlimeKnights/Mantle

@Override
public boolean verifyMaster(IMasterLogic logic, World world, BlockPos pos) {
 if(this.hasMaster) {
  return this.hasValidMaster();
 }
 else {
  this.overrideMaster(pos);
  return true;
 }
}
origin: SlimeKnights/Mantle

@Override
public void notifyMasterOfChange() {
 if(this.hasValidMaster()) {
  IMasterLogic logic = (IMasterLogic) this.world.getTileEntity(this.master);
  logic.notifyChange(this, this.pos);
 }
}
origin: SlimeKnights/Mantle

public void readFromNBT(NBTTagCompound tags) {
 super.readFromNBT(tags);
 this.readCustomNBT(tags);
public NBTTagCompound writeToNBT(NBTTagCompound tags) {
 tags = super.writeToNBT(tags);
 return this.writeCustomNBT(tags);
public NBTTagCompound getUpdateTag() {
 NBTTagCompound tag = new NBTTagCompound();
 this.writeCustomNBT(tag);
 return tag;
origin: SlimeKnights/Mantle

@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
 this.readCustomNBT(packet.getNbtCompound());
 this.world.notifyLightSet(this.pos);
 IBlockState state = world.getBlockState(this.pos);
 this.world.notifyBlockUpdate(this.pos, state, state, 3);
}
origin: SlimeKnights/Mantle

@Deprecated
public boolean setMaster(BlockPos pos) {
 if(!this.hasMaster || this.world.getBlockState(this.master) != this.state || (this.world
                                            .getBlockState(this.master)
                                            .getBlock() != this.masterBlock)) {
  this.overrideMaster(pos);
  return true;
 }
 else {
  return false;
 }
}
slimeknights.mantle.multiblockMultiServantLogic

Most used methods

  • hasValidMaster
  • overrideMaster
  • getMasterPosition
  • onDataPacket
  • readCustomNBT
  • writeCustomNBT

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now