Search in sources :

Example 1 with IWorld

use of crafttweaker.api.world.IWorld in project GregTech by GregTechCE.

the class ShapeGenerator method generate.

@ZenMethod
@Method(modid = GTValues.MODID_CT)
public void generate(long randomSeed, IWorld world, IBlockPos centerPos, IBlockState blockState) {
    World mcWorld = CraftTweakerMC.getWorld(world);
    net.minecraft.block.state.IBlockState mcBlockState = CraftTweakerMC.getBlockState(blockState);
    BlockPos blockPos = CraftTweakerMC.getBlockPos(centerPos);
    generate(new Random(randomSeed), (x, y, z) -> mcWorld.setBlockState(blockPos, mcBlockState));
}
Also used : Random(java.util.Random) IBlockPos(crafttweaker.api.world.IBlockPos) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) IWorld(crafttweaker.api.world.IWorld) ZenMethod(stanhebben.zenscript.annotations.ZenMethod) Method(net.minecraftforge.fml.common.Optional.Method) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

IBlockPos (crafttweaker.api.world.IBlockPos)1 IWorld (crafttweaker.api.world.IWorld)1 Random (java.util.Random)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 Method (net.minecraftforge.fml.common.Optional.Method)1 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1