Tabnine Logo
MapData.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
net.minecraft.world.storage.MapData
constructor

Best Java code snippets using net.minecraft.world.storage.MapData.<init> (Showing top 6 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 mapdata = new MapData(s);
world.setData(s, mapdata);
mapdata.scale = 1;
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: 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: 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.storageMapData<init>

Popular methods of MapData

  • addTargetDecoration
  • markDirty
  • calculateMapCenter
  • getMapPacket
  • updateMapData

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • String (java.lang)
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • Best plugins for Eclipse
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