net.minecraft.world.WorldProvider Java Examples

The following examples show how to use net.minecraft.world.WorldProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThermiteTeleportationHandler.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
public static void transferEntityToWorld(Entity ent, WorldServer oldWorld, WorldServer newWorld) {

		WorldProvider pOld = oldWorld.provider;
		WorldProvider pNew = newWorld.provider;
		double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor();
		double x = ent.posX * moveFactor;
		double z = ent.posZ * moveFactor;
		x = MathHelper.clamp_double(x, -29999872, 29999872);
		z = MathHelper.clamp_double(z, -29999872, 29999872);

		if (ent.isEntityAlive()) {
			ent.setLocationAndAngles(x, ent.posY, z, ent.rotationYaw, ent.rotationPitch);
			newWorld.spawnEntityInWorld(ent);
			newWorld.updateEntityWithOptionalForce(ent, false);
		}

		ent.setWorld(newWorld);
	}
 
Example #2
Source File: WorldGenRegistry.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
public List<Entry<Integer, OreDepositDefinition>> getCachedBiomeVeins(WorldProvider provider, Biome biome) {
    if (oreVeinCache.containsKey(provider))
        return oreVeinCache.get(provider).getBiomeEntry(biome);
    WorldOreVeinCache worldOreVeinCache = new WorldOreVeinCache(provider);
    oreVeinCache.put(provider, worldOreVeinCache);
    return worldOreVeinCache.getBiomeEntry(biome);
}
 
Example #3
Source File: TofuVillageCollection.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static String fileNameForProvider(WorldProvider provider) {
    return "tofuvillages" + provider.getDimensionType().getSuffix();
}
 
Example #4
Source File: WorldGenRegistry.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
public WorldOreVeinCache(WorldProvider worldProvider) {
    this.worldVeins = registeredDefinitions.stream()
        .filter(definition -> definition.getDimensionFilter().test(worldProvider))
        .collect(Collectors.toList());
}
 
Example #5
Source File: OreDepositDefinition.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
public Predicate<WorldProvider> getDimensionFilter() {
    return dimensionFilter;
}
 
Example #6
Source File: OreDepositDefinition.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@ZenMethod("checkDimension")
@Method(modid = GTValues.MODID_CT)
public boolean ctCheckDimension(int dimensionId) {
    WorldProvider worldProvider = DimensionManager.getProvider(dimensionId);
    return worldProvider != null && getDimensionFilter().test(worldProvider);
}
 
Example #7
Source File: DummySaveHandler.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public IChunkLoader getChunkLoader(WorldProvider provider) {
    return this;
}
 
Example #8
Source File: FakeWorld.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
public FakeWorld(WorldProvider provider) {
    super(FakeSaveHandler.instance, "", null, provider, new Profiler());
    theProfiler.profilingEnabled = false;
    difficultySetting = EnumDifficulty.NORMAL;
}
 
Example #9
Source File: FakeWorld.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) {
    return null;
}
 
Example #10
Source File: WorldUtil.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public WorldProvider getProviderForName(String name) {
	return null;
}
 
Example #11
Source File: DummySaveHandler.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
@Override
public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) {
	return null;
}
 
Example #12
Source File: FakeWorldServer.java    From Framez with GNU General Public License v3.0 4 votes vote down vote up
@Override
public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) {

    return null;
}
 
Example #13
Source File: PacketHandler.java    From EmergingTechnology with MIT License 3 votes vote down vote up
public static TargetPoint getTargetPoint(World world, BlockPos blockPos) {
    if (world == null)
        return null;

    WorldProvider provider = world.provider;

    int dimension = provider.getDimension();

    return new TargetPoint(dimension, blockPos.getX(), blockPos.getY(), blockPos.getZ(), 5);
}
 
Example #14
Source File: IWorldGen.java    From Framez with GNU General Public License v3.0 votes vote down vote up
public void disableWorldGenForProviderID(WorldGenType type, Class<? extends WorldProvider> provider); 
Example #15
Source File: GuiEntityRender.java    From WearableBackpacks with MIT License votes vote down vote up
public IChunkLoader getChunkLoader(WorldProvider provider) { return null; } 
Example #16
Source File: IWorldGen.java    From PneumaticCraft with GNU General Public License v3.0 votes vote down vote up
void disableWorldGenForProviderID( WorldGenType type, Class<? extends WorldProvider> provider );