Examples of CustomBlock


Examples of com.gmail.nossr50.datatypes.mods.CustomBlock

                    customLeaves.add(blockMaterialData);
                    xp = 0; // Leaves don't grant XP
                }
            }

            customBlockMap.put(blockMaterialData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp));
        }
    }
View Full Code Here

Examples of com.gmail.nossr50.datatypes.mods.CustomBlock

            else if (mcMMO.getModManager().isCustomLog(blockState)) {
                if (canGetDoubleDrops()) {
                    Woodcutting.checkForDoubleDrop(blockState);
                }

                CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
                xp = customBlock.getXpGain();

                Misc.dropItems(blockState.getLocation(), block.getDrops());
            }
            else if (mcMMO.getModManager().isCustomLeaf(blockState)) {
                Misc.dropItems(blockState.getLocation(), block.getDrops());
View Full Code Here

Examples of com.gmail.nossr50.datatypes.mods.CustomBlock

        int amount = 1;
        int xp;
        boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility());

        if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) {
            CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
            xp = customBlock.getXpGain();

            if (Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) {
                drops = blockState.getBlock().getDrops();
            }
        }
        else {
            if (Permissions.greenThumbPlant(player, material)) {
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomBlock

    SpoutBlock block = (SpoutBlock) event.getBlock();

    SpoutPlayer player = (SpoutPlayer) event.getPlayer();

    if (block.getCustomBlock() != null) {
      CustomBlock material = block.getCustomBlock();
      material.onBlockDestroyed(block.getWorld(), block.getX(), block.getY(), block.getZ(), player);
      if (material.getItemDrop() != null) {
        if (player.getGameMode() == GameMode.SURVIVAL) {
          block.getWorld().dropItem(block.getLocation(), material.getItemDrop());
        }
        block.setTypeId(0);
        event.setCancelled(true);
      }
      mm.removeBlockOverride(block);
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomBlock

        int damage = item.getDurability();
        if (item.getType() == Material.FLINT && damage != 0) {
          SimpleMaterialManager mm = (SimpleMaterialManager)SpoutManager.getMaterialManager();

          if (!player.getEyeLocation().getBlock().equals(block) && !player.getLocation().getBlock().equals(block)) {
            CustomBlock cb = MaterialData.getCustomBlock(damage);

            if (cb != null && isReplaceable(block.getType())) {
              BlockState oldState = block.getState();
              block.setTypeIdAndData(cb.getBlockId(), (byte)(cb.getBlockData()), true);
              cb.onBlockPlace(block.getWorld(), block.getX(), block.getY(), block.getZ(), player);

              int rot = Math.round(player.getLocation().getYaw() + 45 % 360);
              boolean mirrored = player.getLocation().getPitch() < -45;
              if (rot < 0 ) {
                rot += 360;
              }
              rot = (2 - (rot/90)) % 4;
              if (rot < 0) {
                rot += 4;
              }
              byte rotation;
              if (cb.canMirroredRotate() && mirrored) {
                rotation = cb.canRotate() ? (byte) (rot + 4) : 4;
              } else {
                rotation = cb.canRotate() ? (byte) rot : 0;
              }
              mm.overrideBlock(block, cb, rotation);

              if (canPlaceAt(block, oldState, (SpoutBlock)event.getClickedBlock(), item, player)) {
                // Yay, take the item from inventory
                if (player.getGameMode() == GameMode.SURVIVAL) {
                  if (item.getAmount() == 1) {
                  // Remove this for Stuff 
                  event.getPlayer().setItemInHand(null);
                  } else {
                    item.setAmount(item.getAmount() - 1);
                  }
                }
                player.playSound(player.getLocation(), Sound.DIG_STONE, 1.0F, 0.7936508F);
                player.updateInventory();
                // Now we have placed a nice custom block! We should check its rotation and rotate the base block!
                if (cb.canRotate()) {
                  if (cb.canMirroredRotate() && mirrored) {
                    if (block.getType() == Material.LEVER || block.getType() == Material.TORCH || block.getType() == Material.STONE_BUTTON || block.getType() == Material.WOOD_BUTTON) {
                      // The below Types need a slightly different data value to assign correct positioning.
                      if (event.getBlockFace() == BlockFace.UP) {
                        block.setData((byte) 5);
                      } else if (event.getBlockFace() == BlockFace.DOWN) {
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomBlock

        if (block instanceof SpoutPacket) {
          player.sendPacket((SpoutPacket)block);
        }
      }
      for (CustomItem item : MaterialData.getCustomItems()) {
        CustomBlock owner = MaterialData.getCustomBlock(item.getCustomId());
        if (item instanceof SpoutPacket && owner == null) {
          player.sendPacket((SpoutPacket)item);
        }
      }
    }
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomBlock

    chunk.powerOverrides.remove(getIndex());
  }

  @Override
  public org.getspout.spoutapi.material.Block getBlockType() {
    CustomBlock custom = getCustomBlock();
    if (custom != null) {
      return custom;
    }
    return MaterialData.getBlock(getTypeId());
  }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

      customId = sChunk.getCustomBlockId(x, y, z)
      short[] customBlockIds = sChunk.getCustomBlockIds();
      byte[] customBlockData = sChunk.getCustomBlockData();     

      if (customId > 0) {
        CustomBlock block = MaterialData.getCustomBlock(customId);
        if (block != null) {
          BlockDesign design = block.getBlockDesign(customBlockData[customId]);
          if (design != null) {
            texture = getTextureFromUrl(block.getAddon(), design.getTextureURL());         
          }
        }
      }
    }
    return texture;
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

  @Override
  public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int face, float xOffset, float yOffset, float zOffset) {
    if (stack.itemID == MaterialData.flint.getRawId()) {
      int damage = stack.getItemDamage();
      if (damage >= 1024) {
        CustomBlock block = MaterialData.getCustomBlock(damage);
        // Item with no block component, return success
        if (block == null) {
          return true;
        }
        if (onItemUse(stack, block, player, world, x, y, z, face, xOffset, yOffset, zOffset)) {
View Full Code Here

Examples of org.spoutcraft.api.material.CustomBlock

    } finally {
      if (design != null && design.isReset()) {
        design = null;
      }
      if (customId != -1) {
        CustomBlock block = MaterialData.getCustomBlock(customId);
        if (block != null) {
          block.setBlockDesign(design, data);
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.