Minecraft 1.8 Minecraft 1.7.10 Minecraft 1.6.4 TooManyItems 1.7.6 Forge 1.7.2 ModLoader 1.6.2 X-Ray 1.7.5
    • ,
    • Rox Casino -
    • -
    • -
    • !
    • ?
/
    • Rox Casino -
    • -
    • -
    • /
    • Diablo Immortal Android
    • P
?
! feel
. what
Mod, , , , 1.6.2, 1.6.4, 1.7.4, 1.7., 1.8, , , , , , , , , , , , , 1.6.2, 1.6.4, 1.7.10, 1.7.2, , , , , , , , , , , , 16x, 32, 64x,

minecraft

25-06-2012, 14:35     : ()     : 5829

     minecraft

. minecraft .
[1.2.5][SMP|SSP] Pudelhund's Dimension API v1.5.1 .


mod_file
package net.minecraft.src;

public class mod_Tutorial extends BaseMod{

public static final Item tutorial = new ItemTutorial(250, 0).setItemName("Derp");

public mod_Tutorial() {
DimensionAPI.registerDimension(new WorldProviderTutorial());
}

public String getVersion() {
return "Spaces Tutorials!";
}

public void load() {
ModLoader.addName(tutorial,"Tutorial Portal");
ModLoader.addRecipe(new ItemStack(tutorial, 1), new Object[] {"#", Character.valueOf('#'), Block.dirt});
}
}


WorldProvider
package net.minecraft.src;

public class WorldProviderTutorial extends WorldProviderBase
{
public int getDimensionID()
{
return 3;
}

public boolean renderClouds()
{
return true;
}

public boolean renderVoidFog()
{
return false;
}

public float setSunSize()
{
return 0.5F;
}

public float setMoonSize()
{
return 0.5F;
}

public boolean renderStars()
{
return true;
}

public boolean darkenSkyDuringRain()
{
return false;
}

public String getRespawnMessage()
{
return "Your a derp.";
}

public void registerWorldChunkManager()
{
worldChunkMgr = new WorldChunkManagerTutorial(worldObj);
}

public IChunkProvider getChunkProvider()
{
return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), hasNoSky);
}
}

ChankManager .
package net.minecraft.src;

import java.util.List;
import java.util.Random;

public class ChunkProviderTutorial implements IChunkProvider
{
private World worldObj;
private Random random;
private final boolean useStructures;
private MapGenVillage villageGen;

public ChunkProviderTutorial(World par1World, long par2, boolean par4)
{
villageGen = new MapGenVillage(1);
worldObj = par1World;
useStructures = par4;
random = new Random(par2);
}

private void generate(byte par1ArrayOfByte[])
{
int i = par1ArrayOfByte.length / 256;

for (int j = 0; j < 16; j++)
{
for (int k = 0; k < 16; k++)
{
for (int l = 0; l < i; l++)
{
int i1 = 0;

if (l == 0)
{
i1 = Block.bedrock.blockID;
}
else if (l <= 2)
{
i1 = Block.dirt.blockID;
}
else if (l == 3)
{
i1 = Block.grass.blockID;
}

par1ArrayOfByte[j << 11 | k << 7 | l] = (byte)i1;
}
}
}
}

/**
* Creates an empty chunk ready to put data from the server in
*/
public Chunk loadChunk(int par1, int par2)
{
return provideChunk(par1, par2);
}

/**
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
* specified chunk from the map seed and chunk seed
*/
public Chunk provideChunk(int par1, int par2)
{
byte abyte0[] = new byte[32768];
generate(abyte0);
Chunk chunk = new Chunk(worldObj, abyte0, par1, par2);

if (useStructures)
{
villageGen.generate(this, worldObj, par1, par2, abyte0);
}

chunk.generateSkylightMap();
return chunk;
}

/**
* Checks to see if a chunk exists at x, y
*/
public boolean chunkExists(int par1, int par2)
{
return true;
}

/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
random.setSeed(worldObj.getSeed());
long l = (random.nextLong() / 2L) * 2L + 1L;
long l1 = (random.nextLong() / 2L) * 2L + 1L;
random.setSeed((long)par2 * l + (long)par3 * l1 ^ worldObj.getSeed());

if (useStructures)
{
villageGen.generateStructuresInChunk(worldObj, random, par2, par3);
}
}

/**
* Two modes of operation: if passed true, save all Chunks in one go.If passed false, save up to two chunks.
* Return true if all chunks have been saved.
*/
public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate)
{
return true;
}

/**
* Unloads the 100 oldest chunks from memory, due to a bug with chunkSet.add() never being called it thinks the list
* is always empty and will not remove any chunks.
*/
public boolean unload100OldestChunks()
{
return false;
}

/**
* Returns if the IChunkProvider supports saving.
*/
public boolean canSave()
{
return true;
}

/**
* Converts the instance data to a readable string.
*/
public String makeString()
{
return "FlatLevelSource";
}

/**
* Returns a list of creatures of the specified type that can spawn at the given location.
*/
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
{
BiomeGenBase biomegenbase = worldObj.func_48454_a(par2, par4);

if (biomegenbase == null)
{
return null;
}
else
{
return biomegenbase.getSpawnableList(par1EnumCreatureType);
}
}

/**
* Returns the location of the closest structure of the specified type. If not found returns null.
*/
public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int i, int j)
{
return null;
}
}


WorldChunkManager
package net.minecraft.src;

import java.util.*;

public class WorldChunkManagerTutorial extends WorldChunkManager
{
private GenLayer genBiomes;

/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
private GenLayer biomeIndexLayer;

/** The BiomeCache object for this world. */
private BiomeCache biomeCache;

/** A list of biomes that the player can spawn in. */
private List biomesToSpawnIn;

protected WorldChunkManagerTutorial()
{
biomeCache = new BiomeCache(this);
biomesToSpawnIn = new ArrayList();
biomesToSpawnIn.add(BiomeGenBase.forest);
biomesToSpawnIn.add(BiomeGenBase.plains);
biomesToSpawnIn.add(BiomeGenBase.taiga);
biomesToSpawnIn.add(BiomeGenBase.taigaHills);
biomesToSpawnIn.add(BiomeGenBase.forestHills);
biomesToSpawnIn.add(BiomeGenBase.field_48416_w);
biomesToSpawnIn.add(BiomeGenBase.field_48417_x);
biomesToSpawnIn.add(BiomeGenBase.virus);
}

public WorldChunkManagerTutorial(long par1, WorldType par3WorldType)
{
this();
GenLayer agenlayer[] = GenLayer.func_48425_a(par1, par3WorldType);
genBiomes = agenlayer[0];
biomeIndexLayer = agenlayer[1];
}

public WorldChunkManagerTutorial(World par1World)
{
this(par1World.getSeed(), par1World.getWorldInfo().getTerrainType());
}

/**
* Gets the list of valid biomes for the player to spawn in.
*/
public List getBiomesToSpawnIn()
{
return biomesToSpawnIn;
}

/**
* Returns the BiomeGenBase related to the x, z position on the world.
*/
public BiomeGenBase getBiomeGenAt(int par1, int par2)
{
return biomeCache.getBiomeGenAt(par1, par2);
}

/**
* Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
*/
public float[] getRainfall(float par1ArrayOfFloat[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();

if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
{
par1ArrayOfFloat = new float[par4 * par5];
}

int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);

for (int i = 0; i < par4 * par5; i++)
{
float f = (float)BiomeGenBase.biomeList[ai[i]].getIntRainfall() / 65536F;

if (f > 1.0F)
{
f = 1.0F;
}

par1ArrayOfFloat[i] = f;
}

return par1ArrayOfFloat;
}

/**
* Return an adjusted version of a given temperature based on the y height
*/
public float getTemperatureAtHeight(float par1, int par2)
{
return par1;
}

/**
* Returns a list of temperatures to use for the specified blocks.Args: listToReuse, x, y, width, length
*/
public float[] getTemperatures(float par1ArrayOfFloat[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();

if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
{
par1ArrayOfFloat = new float[par4 * par5];
}

int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);

for (int i = 0; i < par4 * par5; i++)
{
float f = (float)BiomeGenBase.biomeList[ai[i]].getIntTemperature() / 65536F;

if (f > 1.0F)
{
f = 1.0F;
}

par1ArrayOfFloat[i] = f;
}

return par1ArrayOfFloat;
}

/**
* Returns an array of biomes for the location input.
*/
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();

if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
{
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
}

int ai[] = genBiomes.getInts(par2, par3, par4, par5);

for (int i = 0; i < par4 * par5; i++)
{
par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
}

return par1ArrayOfBiomeGenBase;
}

/**
* Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the
* WorldChunkManager Args: oldBiomeList, x, z, width, depth
*/
public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
{
return getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true);
}

/**
* Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
* don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
*/
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5, boolean par6)
{
IntCache.resetIntCache();

if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
{
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
}

if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0)
{
BiomeGenBase abiomegenbase[] = biomeCache.getCachedBiomes(par2, par3);
System.arraycopy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
return par1ArrayOfBiomeGenBase;
}

int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);

for (int i = 0; i < par4 * par5; i++)
{
par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
}

return par1ArrayOfBiomeGenBase;
}

/**
* checks given Chunk's Biomes against List of allowed ones
*/
public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
{
int i = par1 - par3 >> 2;
int j = par2 - par3 >> 2;
int k = par1 + par3 >> 2;
int l = par2 + par3 >> 2;
int i1 = (k - i) + 1;
int j1 = (l - j) + 1;
int ai[] = genBiomes.getInts(i, j, i1, j1);

for (int k1 = 0; k1 < i1 * j1; k1++)
{
BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[k1]];

if (!par4List.contains(biomegenbase))
{
return false;
}
}

return true;
}

/**
* Finds a valid position within a range, that is once of the listed biomes.
*/
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
{
int i = par1 - par3 >> 2;
int j = par2 - par3 >> 2;
int k = par1 + par3 >> 2;
int l = par2 + par3 >> 2;
int i1 = (k - i) + 1;
int j1 = (l - j) + 1;
int ai[] = genBiomes.getInts(i, j, i1, j1);
ChunkPosition chunkposition = null;
int k1 = 0;

for (int l1 = 0; l1 < ai.length; l1++)
{
int i2 = i + l1 % i1 << 2;
int j2 = j + l1 / i1 << 2;
BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[l1]];

if (par4List.contains(biomegenbase) && (chunkposition == null || par5Random.nextInt(k1 + 1) == 0))
{
chunkposition = new ChunkPosition(i2, 0, j2);
k1++;
}
}

return chunkposition;
}

/**
* Calls the WorldChunkManager's biomeCache.cleanupCache()
*/
public void cleanupCache()
{
biomeCache.cleanupCache();
}
}

, , .
Teleporter
package net.minecraft.src;

public class TeleporterTutorial extends Teleporter{}

.
Items
package net.minecraft.src;

import java.util.ArrayList;
import java.util.List;

public class ItemTutorial extends ItemTeleporterBase
{
public ItemTutorial(int i, int j)
{
super(i);
}

public WorldProviderBase getDimension()
{
return new WorldProviderTutorial();
}

public TeleporterTutorial getTeleporter()
{
return new TeleporterTutorial();
}

public String getEnteringMessage()
{
return "Entering the Tutorial Dimension";
}

public String getLeavingMessage()
{
return "Leaving the Tutorial Dimension";
}

public boolean isPortalImmediate()
{
return true;
}

public boolean displayPortalAnimation()
{
return true;
}

public int returnsPlayerToDimension()
{
return 0;
}

public double getDistanceRatio()
{
return 0.2D;
}

public int getPortalDelay()
{
return 150;
}
}


Puddlehund's ItemTeleporterBase :
Puddlehund's ItemTeleporterBase
package net.minecraft.src;

import java.util.ArrayList;
import java.util.List;

public abstract class ItemTeleporterBase extends Item
implements ISpecialTeleportation
{
public ItemTeleporterBase(int i)
{
super(i);
}

public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if (!world.isRemote)
{
DimensionAPI.setInPortal(getDimension(), ModLoader.getMinecraftInstance(), (EntityPlayerSP)entityplayer, this, null);
}
if (displayPortalOverlay())
{
GuiIngame.currentPortal = this;
entityplayer.setInPortal();
if(entityplayer.timeInPortal >= 0.9F)
{
entityplayer.timeInPortal = 0.0F;
GuiIngame.currentPortal = null;
}
}
return itemstack;
}

public abstract WorldProviderBase getDimension();

public abstract TeleporterTutorial getTeleporter();

public abstract String getEnteringMessage();

public abstract String getLeavingMessage();

public boolean isPortalImmediate()
{
return true;
}

public boolean displayPortalOverlay()
{
return false;
}

public int getOverlayTexture()
{
return Block.portal.blockIndexInTexture;
}

public List canTeleportFromDimension()
{
ArrayList arraylist = new ArrayList();
arraylist.add(Integer.valueOf(0));
return arraylist;
}

public int returnsPlayerToDimension()
{
return 0;
}

public double getDistanceRatio()
{
return 1.0D;
}

public int getPortalDelay()
{
return 0;
}

public Achievement triggerAchievement()
{
return null;
}
}

!
dimensionapiv1.5.1.zip [119,41 Kb] (c: 118)

:

Minecraft :
FAQ
Minecraft
: , , , ,
minecraft:
, .
.

1000 .