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

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

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

origin: vadis365/TheErebus

public static ItemStack setupNewMap(World worldIn, double worldX, double worldZ, byte scale, boolean trackingPosition, boolean unlimitedTracking)
{
  ItemStack itemstack = new ItemStack(ModItems.EREBUS_MAP_FILLED, 1, worldIn.getUniqueDataId("map"));
  String s = "map_" + itemstack.getMetadata();
  MapData mapdata = new MapData(s);
  worldIn.setData(s, mapdata);
  mapdata.scale = scale;
  mapdata.calculateMapCenter(worldX, worldZ, mapdata.scale);
  mapdata.dimension = worldIn.provider.getDimension();
  mapdata.trackingPosition = trackingPosition;
  mapdata.unlimitedTracking = unlimitedTracking;
  mapdata.markDirty();
  return itemstack;
}
origin: vadis365/TheErebus

protected static void enableMapTracking(ItemStack p_185064_0_, World p_185064_1_)
{
  MapData mapdata = ((ItemErebusMap) ModItems.EREBUS_MAP_FILLED).getMapData(p_185064_0_, p_185064_1_);
  p_185064_0_.setItemDamage(p_185064_1_.getUniqueDataId("map"));
  MapData mapdata1 = new MapData("map_" + p_185064_0_.getMetadata());
  mapdata1.trackingPosition = true;
  if (mapdata != null)
  {
    mapdata1.xCenter = mapdata.xCenter;
    mapdata1.zCenter = mapdata.zCenter;
    mapdata1.scale = mapdata.scale;
    mapdata1.dimension = mapdata.dimension;
    mapdata1.markDirty();
    p_185064_1_.setData("map_" + p_185064_0_.getMetadata(), mapdata1);
  }
}
origin: Vazkii/Quark

mapdata.addTargetDecoration(itemstack, treasurePos, "x", Type.TARGET_X);
mapdata.markDirty();
origin: vadis365/TheErebus

protected static void scaleMap(ItemStack p_185063_0_, World p_185063_1_, int p_185063_2_)
{
  MapData mapdata = ((ItemErebusMap) ModItems.EREBUS_MAP_FILLED).getMapData(p_185063_0_, p_185063_1_);
  p_185063_0_.setItemDamage(p_185063_1_.getUniqueDataId("map"));
  MapData mapdata1 = new MapData("map_" + p_185063_0_.getMetadata());
  if (mapdata != null)
  {
    mapdata1.scale = (byte)MathHelper.clamp(mapdata.scale + p_185063_2_, 0, 4);
    mapdata1.trackingPosition = mapdata.trackingPosition;
    mapdata1.calculateMapCenter((double)mapdata.xCenter, (double)mapdata.zCenter, mapdata1.scale);
    mapdata1.dimension = mapdata.dimension;
    mapdata1.markDirty();
    p_185063_1_.setData("map_" + p_185063_0_.getMetadata(), mapdata1);
  }
}
origin: vadis365/TheErebus

@Nullable
public MapData getMapData(ItemStack stack, World worldIn)
{
  String s = "map_" + stack.getMetadata();
  MapData mapdata = (MapData)worldIn.loadData(MapData.class, s);
  if (mapdata == null && !worldIn.isRemote)
  {
    stack.setItemDamage(worldIn.getUniqueDataId("map"));
    s = "map_" + stack.getMetadata();
    mapdata = new MapData(s);
    mapdata.scale = 3;
    mapdata.calculateMapCenter((double)worldIn.getWorldInfo().getSpawnX(), (double)worldIn.getWorldInfo().getSpawnZ(), mapdata.scale);
    mapdata.dimension = worldIn.provider.getDimension();
    mapdata.markDirty();
    worldIn.setData(s, mapdata);
  }
  return mapdata;
}
net.minecraft.world.storageMapDatamarkDirty

Popular methods of MapData

  • addTargetDecoration
  • <init>
  • calculateMapCenter
  • getMapPacket
  • updateMapData

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Permission (java.security)
    Legacy security code; do not use.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • BoxLayout (javax.swing)
  • Top Sublime Text plugins
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