Search in sources :

Example 11 with IChunkProvider

use of net.minecraft.world.chunk.IChunkProvider in project MineFactoryReloaded by powercrystals.

the class WorldServerProxy method createChunkProvider.

@Override
protected /**
 * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
 */
IChunkProvider createChunkProvider() {
    ArrayList<String> q = new ArrayList<String>();
    q.add("createChunkProvider");
    q.addAll(Arrays.asList(ObfuscationReflectionHelper.remapFieldNames("net.minecraft.world.World", new String[] { "func_72970_h" })));
    Method callable = ReflectionHelper.findMethod(World.class, this.proxiedWorld, q.toArray(new String[q.size()]));
    try {
        return (IChunkProvider) callable.invoke(this.proxiedWorld);
    } catch (Throwable e) {
        return null;
    }
}
Also used : IChunkProvider(net.minecraft.world.chunk.IChunkProvider) ArrayList(java.util.ArrayList) Method(java.lang.reflect.Method)

Example 12 with IChunkProvider

use of net.minecraft.world.chunk.IChunkProvider in project MineFactoryReloaded by powercrystals.

the class WorldProxy method createChunkProvider.

@Override
protected /**
 * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
 */
IChunkProvider createChunkProvider() {
    ArrayList<String> q = new ArrayList<String>();
    q.add("createChunkProvider");
    q.addAll(Arrays.asList(ObfuscationReflectionHelper.remapFieldNames("net.minecraft.world.World", new String[] { "func_72970_h" })));
    Method callable = ReflectionHelper.findMethod(World.class, this.proxiedWorld, q.toArray(new String[q.size()]));
    try {
        return (IChunkProvider) callable.invoke(this.proxiedWorld);
    } catch (Throwable e) {
        return null;
    }
}
Also used : IChunkProvider(net.minecraft.world.chunk.IChunkProvider) ArrayList(java.util.ArrayList) Method(java.lang.reflect.Method)

Aggregations

IChunkProvider (net.minecraft.world.chunk.IChunkProvider)12 BlockPos (net.minecraft.util.math.BlockPos)6 IMultiblockComponent (forestry.api.multiblock.IMultiblockComponent)5 ArrayList (java.util.ArrayList)4 World (net.minecraft.world.World)3 WorldServer (net.minecraft.world.WorldServer)3 Method (java.lang.reflect.Method)2 HashSet (java.util.HashSet)2 ChunkPos (net.minecraft.util.math.ChunkPos)2 Chunk (net.minecraft.world.chunk.Chunk)2 ChunkProviderChess (com.builtbroken.mc.core.content.world.chunks.ChunkProviderChess)1 ChunkProviderEmpty (com.builtbroken.mc.core.content.world.chunks.ChunkProviderEmpty)1 ChunkProviderStone (com.builtbroken.mc.core.content.world.chunks.ChunkProviderStone)1 IMultiblockLogic (forestry.api.multiblock.IMultiblockLogic)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Random (java.util.Random)1 Set (java.util.Set)1 Nullable (javax.annotation.Nullable)1 Block (net.minecraft.block.Block)1