本文整理汇总了Java中micdoodle8.mods.galacticraft.core.util.WorldUtil类的典型用法代码示例。如果您正苦于以下问题:Java WorldUtil类的具体用法?Java WorldUtil怎么用?Java WorldUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldUtil类属于micdoodle8.mods.galacticraft.core.util包,在下文中一共展示了WorldUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jump
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
protected void jump()
{
this.motionY = 0.48D / WorldUtil.getGravityFactor(this);
if (this.motionY < 0.28D) this.motionY = 0.28D;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
示例2: onPlayerLogin
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent event)
{
ChunkLoadingCallback.onPlayerLogin(event.player);
if (event.player instanceof EntityPlayerMP)
{
EntityPlayerMP thePlayer = (EntityPlayerMP) event.player;
GCPlayerStats stats = GCPlayerStats.get(thePlayer);
SpaceStationWorldData.checkAllStations(thePlayer, stats);
GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_SPACESTATION_CLIENT_ID, new Object[] { WorldUtil.spaceStationDataToString(stats.spaceStationDimensionData) }), thePlayer);
SpaceRace raceForPlayer = SpaceRaceManager.getSpaceRaceFromPlayer(thePlayer.getGameProfile().getName());
if (raceForPlayer != null) SpaceRaceManager.sendSpaceRaceData(thePlayer, raceForPlayer);
}
if (event.player.worldObj.provider instanceof WorldProviderOrbit && event.player instanceof EntityPlayerMP)
{
((WorldProviderOrbit) event.player.worldObj.provider).sendPacketsToClient((EntityPlayerMP) event.player);
}
}
示例3: onConnectionReceived
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@SubscribeEvent
public void onConnectionReceived(ServerConnectionFromClientEvent event)
{
if (ConfigManagerCore.enableDebug)
{
Integer[] idList = (Integer[]) WorldUtil.getPlanetList().get(0);
String ids = "";
for (int j = 0; j < idList.length; j++)
{
ids+=idList[j].toString()+" ";
}
GCLog.info("Galacticraft server sending dimension IDs to connecting client: "+ ids);
}
event.manager.scheduleOutboundPacket(ConnectionPacket.createDimPacket(WorldUtil.getPlanetListInts()));
event.manager.scheduleOutboundPacket(ConnectionPacket.createSSPacket(WorldUtil.getSpaceStationListInts()));
event.manager.scheduleOutboundPacket(ConnectionPacket.createConfigPacket(ConfigManagerCore.getServerConfigOverride()));
}
示例4: jump
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
protected void jump()
{
this.motionY = 0.52D / WorldUtil.getGravityFactor(this);
if (this.motionY < 0.26D) this.motionY = 0.26D;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
示例5: jump
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
protected void jump()
{
this.motionY = 0.45D / WorldUtil.getGravityFactor(this);
if (this.motionY < 0.22D) this.motionY = 0.22D;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
示例6: jump
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
protected void jump()
{
this.motionY = 0.48D / WorldUtil.getGravityFactor(this);
if (this.motionY < 0.24D) this.motionY = 0.24D;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
示例7: jump
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
protected void jump()
{
this.motionY = 0.45D / WorldUtil.getGravityFactor(this);
if (this.motionY < 0.24D) this.motionY = 0.24D;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= MathHelper.sin(f) * 0.2F;
this.motionZ += MathHelper.cos(f) * 0.2F;
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
示例8: frequencyModulePlayer
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
/**
* Call this when a player wears a frequency module to check
* whether it has been linked with a Telemetry Unit.
*
* @param ItemStack The frequency module
* @param player
*/
public static void frequencyModulePlayer(ItemStack held, EntityPlayerMP player)
{
if (held == null) return;
NBTTagCompound fmData = held.stackTagCompound;
if (fmData != null && fmData.hasKey("teDim"))
{
int dim = fmData.getInteger("teDim");
int x = fmData.getInteger("teCoordX");
int y = fmData.getInteger("teCoordY");
int z = fmData.getInteger("teCoordZ");
WorldProvider wp = WorldUtil.getProviderForDimensionServer(dim);
//TODO
if (wp == null || wp.worldObj == null)
GCLog.debug("Frequency module worn: world provider is null. This is a bug. "+dim);
else
{
TileEntity te = wp.worldObj.getTileEntity(x, y, z);
if (te instanceof TileEntityTelemetry)
{
if (player == null)
((TileEntityTelemetry) te).removeTrackedEntity();
else
((TileEntityTelemetry) te).addTrackedEntity(player.getUniqueID());
}
}
}
}
示例9: onConnectionClosed
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@SubscribeEvent
public void onConnectionClosed(ClientDisconnectionFromServerEvent event)
{
if (ConnectionEvents.clientConnected)
{
ConnectionEvents.clientConnected = false;
WorldUtil.unregisterPlanets();
WorldUtil.unregisterSpaceStations();
ConfigManagerCore.restoreClientConfigOverrideable();
}
}
示例10: afterMoveEntityWithHeading
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@Override
public void afterMoveEntityWithHeading(float paramFloat1, float paramFloat2)
{
super.afterMoveEntityWithHeading(paramFloat1, paramFloat2);
if (Loader.isModLoaded("SmartMoving") && !this.player.capabilities.isFlying)
{
this.player.motionY += 0.080000000000000002D;
this.player.motionY -= WorldUtil.getGravityForEntity(this.player);
}
}
示例11: GCEntityPlayerMP
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
public GCEntityPlayerMP(MinecraftServer server, WorldServer world, GameProfile profile, ItemInWorldManager itemInWorldManager)
{
super(server, WorldUtil.getStartWorld(world), profile, itemInWorldManager);
if (this.worldObj != world)
{
GCPlayerStats.get(this).startAdventure(WorldUtil.getDimensionName(this.worldObj.provider));
}
}
示例12: serverStarting
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
event.registerServerCommand(new CommandSpaceStationAddOwner());
event.registerServerCommand(new CommandSpaceStationChangeOwner());
event.registerServerCommand(new CommandSpaceStationRemoveOwner());
event.registerServerCommand(new CommandPlanetTeleport());
event.registerServerCommand(new CommandKeepDim());
event.registerServerCommand(new CommandGCInv());
event.registerServerCommand(new CommandGCHelp());
event.registerServerCommand(new CommandGCEnergyUnits());
event.registerServerCommand(new CommandJoinSpaceRace());
WorldUtil.initialiseDimensionNames();
WorldUtil.registerSpaceStations(event.getServer().worldServerForDimension(0).getSaveHandler().getMapFileFromName("dummy").getParentFile());
ArrayList<CelestialBody> cBodyList = new ArrayList<CelestialBody>();
cBodyList.addAll(GalaxyRegistry.getRegisteredPlanets().values());
cBodyList.addAll(GalaxyRegistry.getRegisteredMoons().values());
for (CelestialBody body : cBodyList)
{
if (body.shouldAutoRegister())
{
if (!WorldUtil.registerPlanet(body.getDimensionID(), body.getReachable(), 0))
body.setUnreachable();
}
}
RecipeManagerGC.setConfigurableRecipes();
}
示例13: updateParamsFromParent
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
protected void updateParamsFromParent(boolean save) {
if(mothershipObj.isInTransit()) {
return;
}
CelestialBody parent = mothershipObj.getParent();
if(AstronomyHelper.isStar(parent)) {
dayLength = 0;
thermalLevel = AstronomyHelper.maxTemperature;
solarLevel = AstronomyHelper.maxSolarLevel;
} else {
thermalLevel = AstronomyHelper.getThermalLevel(parent);
solarLevel = AstronomyHelper.getSolarEnergyMultiplier(parent, false);
dayLength = 24000L;
if(parent.getReachable()) {
WorldProvider p = WorldUtil.getProviderForDimensionServer(parent.getDimensionID());
if(p != null && p instanceof WorldProviderSpace) {
// read stuff from the worldprovider
dayLength = ((WorldProviderSpace)p).getDayLength();
}
}
}
if(save) {
saveData(true);
}
}
示例14: getArrayOfChildren
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
/**
* Generates an array for usage in GuiCelestialSelection containing the given planet and all it's children
*
* @param playerBase
* @param body
* @return
*/
private static HashMap<String, Integer> getArrayOfChildren(EntityPlayerMP playerBase, CelestialBody body)
{
HashMap<String, Integer> result = new HashMap<String, Integer>();
if(body.getReachable()) {
int planetId = body.getDimensionID();
// add the body itself
result.put(body.getName(), planetId);
// seems like you can only have sats for reachable bodies
// try the sats
//List<Satellite> sats = GalaxyRegistry.getSatellitesForCelestialBody(body);
for (Integer element : WorldUtil.registeredSpaceStations.keySet()) {
final SpaceStationWorldData data = SpaceStationWorldData.getStationData(playerBase.worldObj, element, null);
if(data.getHomePlanet() == planetId) {
// try to get the body? I hope this works
CelestialBody celestialBody = WorldUtil.getReachableCelestialBodiesForDimensionID(element);
if(celestialBody == null) {
celestialBody = GalacticraftCore.satelliteSpaceStation;
}
// weird string?
// map.put(celestialBody.getName() + "$" + data.getOwner() + "$" + data.getSpaceStationName() + "$" + id + "$" + data.getHomePlanet(), id);
result.put(celestialBody.getName() + "$" + data.getOwner() + "$" + data.getSpaceStationName() + "$" + element + "$" + data.getHomePlanet(), element);
}
}
}
// now the motherships
MothershipWorldData msData = TickHandlerServer.mothershipData;
List<Mothership> msList = msData.getMothershipsForParent(body);
for(Mothership m: msList) {
result.put(m.getName(), m.getDimensionID());
}
return result;
}
示例15: getReachableCelestialBodiesForName
import micdoodle8.mods.galacticraft.core.util.WorldUtil; //导入依赖的package包/类
/**
* Replacement for WorldUtil.getReachableCelestialBodiesForName which works on motherships
* @param name
* @return
*/
public static CelestialBody getReachableCelestialBodiesForName(String name)
{
CelestialBody ms = TickHandlerServer.mothershipData.getByName(name);
if(ms != null) {
return ms;
}
return WorldUtil.getReachableCelestialBodiesForName(name);
}