Tabnine Logo
MapData.addTargetDecoration
Code IndexAdd Tabnine to your IDE (free)

How to use
addTargetDecoration
method
in
net.minecraft.world.storage.MapData

Best Java code snippets using net.minecraft.world.storage.MapData.addTargetDecoration (Showing top 5 results out of 315)

origin: Vazkii/Quark

public static void addMarker(ItemStack stack, EntityPlayer player) {
  if(stack.getItem() == Items.FILLED_MAP) {
    MapData data = ((ItemMap) Items.FILLED_MAP).getMapData(stack, player.world);
    
    if(data != null)
      data.addTargetDecoration(stack, player.getPosition(), "Pin" + player.getPosition().hashCode(), Type.TARGET_X);
  }
}

origin: Vazkii/Quark

mapdata.unlimitedTracking = true;
ItemMap.renderBiomePreviewMap(world, itemstack);
mapdata.addTargetDecoration(itemstack, treasurePos, "x", Type.TARGET_X);
origin: Vazkii/Quark

public static ItemStack createMap(World world, BlockPos pos, TradeInfo info) {
  BlockPos biomePos = BiomeLocator.spiralOutwardsLookingForBiome(world, info.biome, pos.getX(), pos.getZ());
  if(biomePos == null)
    return ItemStack.EMPTY;
  
  int id = world.getUniqueDataId("map");
  ItemStack stack = new ItemStack(Items.FILLED_MAP, 1, id);
  stack.setTranslatableName(info.name);
  NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, "display", false);
  cmp.setInteger("MapColor", info.color);
  ItemNBTHelper.setCompound(stack, "display", cmp);
  String s = "map_" + id;
  MapData mapdata = new MapData(s);
  world.setData(s, mapdata);
  mapdata.scale = 2;
  mapdata.xCenter = biomePos.getX() + (int) ((Math.random() - 0.5) * 200);
  mapdata.zCenter = biomePos.getZ() + (int) ((Math.random() - 0.5) * 200);
  mapdata.dimension = 0;
  mapdata.trackingPosition = true;
  mapdata.unlimitedTracking = true;
  ItemMap.renderBiomePreviewMap(world, stack);
  MapData.addTargetDecoration(stack, biomePos, "+", Type.TARGET_X);
  return stack;
}
origin: TeamLapen/Vampirism

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
  World w = getCommandSenderAsPlayer(sender).getEntityWorld();
  VampirismWorldData worldData = VampirismWorldData.get(w);
  BlockPos dungeonPos = worldData.getRandomVampireDungeon(getCommandSenderAsPlayer(sender).getRNG());
  ItemStack itemstack = ItemMap.setupNewMap(w, (double) dungeonPos.getX(), (double) dungeonPos.getZ(), (byte) 2, true, true);
  ItemMap.renderBiomePreviewMap(w, itemstack);
  MapData.addTargetDecoration(itemstack, dungeonPos, "+", MapDecoration.Type.TARGET_X);
  getCommandSenderAsPlayer(sender).dropItem(itemstack, false);
}
origin: JurassiCraftTeam/JurassiCraft2

public static void init() {
  ResourceLocation location = new ResourceLocation("minecraft", "librarian");
  VillagerRegistry.VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(location);
  if(!profession.getRegistryName().equals(location)) {
    JurassiCraft.getLogger().error("Could not find librarian profession");
  } else {
    VillagerRegistry.VillagerCareer career = profession.getCareer(1);
    if(career.getName().equals("cartographer")) {
      career.addTrade(4, (merchant, recipeList, random) -> {
        if(StructureUtils.getStructureData().isVisitorCenter()) {
          World world = FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(0);
          BlockPos blockpos = MapUtils.getVisitorCenterPosition();
          ItemStack itemstack = ItemMap.setupNewMap(world, blockpos.getX(), blockpos.getZ(), (byte)2, true, true);
          ItemMap.renderBiomePreviewMap(world, itemstack);
          MapData.addTargetDecoration(itemstack, blockpos, "+", MapDecoration.Type.MANSION);
          itemstack.setTranslatableName("filled_map.jurassicraft.visitorcenter");
          recipeList.add(new MerchantRecipe(new ItemStack(Items.EMERALD, random.nextInt(12) + 16), new ItemStack(Items.COMPASS), itemstack));
        }
      });
      JurassiCraft.getLogger().info("Successfully registered maps trade");
    } else {
      JurassiCraft.getLogger().error("Could not find cartographer maps career");
    }
  }
}
net.minecraft.world.storageMapDataaddTargetDecoration

Popular methods of MapData

  • <init>
  • markDirty
  • calculateMapCenter
  • getMapPacket
  • updateMapData

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now