Java Code Examples for net.minecraft.world.World#getWorldInfo()
The following examples show how to use
net.minecraft.world.World#getWorldInfo() .
These examples are extracted from open source projects.
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 Project: CommunityMod File: ItemRainStick.java License: GNU Lesser General Public License v2.1 | 6 votes |
@Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack heldStack = player.getHeldItem(hand); if (!player.capabilities.isCreativeMode) heldStack.shrink(1); world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_SKELETON_DEATH, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!world.isRemote) { WorldInfo worldinfo = world.getWorldInfo(); worldinfo.setCleanWeatherTime(0); worldinfo.setRainTime(1200); worldinfo.setThunderTime(1200); worldinfo.setRaining(true); worldinfo.setThundering(false); } else player.sendMessage(new TextComponentString("Dark clouds start forming in the sky")); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, heldStack); }
Example 2
Source Project: malmo File: FlatWorldGeneratorImplementation.java License: MIT License | 6 votes |
@Override public boolean shouldCreateWorld(MissionInit missionInit, World world) { if (this.fwparams != null && this.fwparams.isForceReset()) return true; if (Minecraft.getMinecraft().world == null || world == null) return true; // Definitely need to create a world if there isn't one in existence! WorldInfo worldInfo = world.getWorldInfo(); if (worldInfo == null) return true; String genOptions = worldInfo.getGeneratorOptions(); if (genOptions == null) return true; if (!genOptions.equals(this.fwparams.getGeneratorString())) return true; // Generation doesn't match, so recreate. return false; }
Example 3
Source Project: CommunityMod File: ShipStorage.java License: GNU Lesser General Public License v2.1 | 5 votes |
public ShipStorage(BlockPos bp, World hostWorld) { super(hostWorld.getSaveHandler(), hostWorld.getWorldInfo(), hostWorld.provider, hostWorld.profiler, hostWorld.isRemote); blockMap = new HashMap<BlockPos, BlockStorage>(); offset = bp; tesrs = new ArrayList<TileEntity>(); host = hostWorld; }
Example 4
Source Project: Framez File: FakeWorldServer.java License: GNU General Public License v3.0 | 5 votes |
private FakeWorldServer(World world) { super(MinecraftServer.getServer(), new NonSavingHandler(), world.getWorldInfo().getWorldName(), world.provider.dimensionId, new WorldSettings(world.getWorldInfo()), world.theProfiler); DimensionManager.setWorld(world.provider.dimensionId, (WorldServer) world); chunkProvider = world.getChunkProvider(); }
Example 5
Source Project: YUNoMakeGoodMap File: VoidWorldBiomeProvider.java License: Apache License 2.0 | 4 votes |
public VoidWorldBiomeProvider(World world) { super(world.getWorldInfo()); this.world = world; }