use of micdoodle8.mods.galacticraft.api.vector.Vector3 in project Galacticraft by micdoodle8.
the class EntityCargoRocket method spawnParticles.
protected void spawnParticles(boolean launched) {
double sinPitch = Math.sin(this.rotationPitch / Constants.RADIANS_TO_DEGREES_D);
double x1 = 2 * Math.cos(this.rotationYaw / Constants.RADIANS_TO_DEGREES_D) * sinPitch;
double z1 = 2 * Math.sin(this.rotationYaw / Constants.RADIANS_TO_DEGREES_D) * sinPitch;
double y1 = 2 * Math.cos((this.rotationPitch - 180) / Constants.RADIANS_TO_DEGREES_D);
if (this.launchPhase == EnumLaunchPhase.LANDING.ordinal() && this.targetVec != null) {
double modifier = this.posY - this.targetVec.getY();
modifier = Math.max(modifier, 1.0);
x1 *= modifier / 60.0D;
y1 *= modifier / 60.0D;
z1 *= modifier / 60.0D;
}
final double y = this.prevPosY + (this.posY - this.prevPosY) - 0.4;
if (!this.isDead) {
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + 0.2 - this.rand.nextDouble() / 10 + x1, y, this.posZ + 0.2 - this.rand.nextDouble() / 10 + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX - 0.2 + this.rand.nextDouble() / 10 + x1, y, this.posZ + 0.2 - this.rand.nextDouble() / 10 + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX - 0.2 + this.rand.nextDouble() / 10 + x1, y, this.posZ - 0.2 + this.rand.nextDouble() / 10 + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + 0.2 - this.rand.nextDouble() / 10 + x1, y, this.posZ - 0.2 + this.rand.nextDouble() / 10 + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + x1, y, this.posZ + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + 0.2 + x1, y, this.posZ + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX - 0.2 + x1, y, this.posZ + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + x1, y, this.posZ + 0.2D + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
GalacticraftCore.proxy.spawnParticle(this.getLaunched() ? "launchFlameLaunched" : "launchFlameIdle", new Vector3(this.posX + x1, y, this.posZ - 0.2D + z1), new Vector3(x1, y1, z1), new Object[] { riddenByEntity });
}
}
use of micdoodle8.mods.galacticraft.api.vector.Vector3 in project Galacticraft by micdoodle8.
the class GalacticraftCore method init.
@EventHandler
public void init(FMLInitializationEvent event) {
GCBlocks.doOtherModsTorches();
GalacticraftCore.handler.registerItemChanges();
GalacticraftCore.galacticraftBlocksTab.setItemForTab(Item.getItemFromBlock(GCBlocks.machineBase2));
GalacticraftCore.galacticraftItemsTab.setItemForTab(GCItems.rocketTier1);
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
GCBlocks.finalizeSort();
GCItems.finalizeSort();
}
GalacticraftCore.proxy.init(event);
GalacticraftCore.packetPipeline = GalacticraftChannelHandler.init();
GalacticraftCore.solarSystemSol = new SolarSystem("sol", "milky_way").setMapPosition(new Vector3(0.0F, 0.0F, 0.0F));
Star starSol = (Star) new Star("sol").setParentSolarSystem(GalacticraftCore.solarSystemSol).setTierRequired(-1);
starSol.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png"));
GalacticraftCore.solarSystemSol.setMainStar(starSol);
GalacticraftCore.planetOverworld = (Planet) new Planet("overworld").setParentSolarSystem(GalacticraftCore.solarSystemSol).setRingColorRGB(0.1F, 0.9F, 0.6F).setPhaseShift(0.0F);
GalacticraftCore.planetOverworld.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/earth.png"));
GalacticraftCore.planetOverworld.setDimensionInfo(ConfigManagerCore.idDimensionOverworld, WorldProvider.class, false).setTierRequired(1);
GalacticraftCore.planetOverworld.atmosphereComponent(EnumAtmosphericGas.NITROGEN).atmosphereComponent(EnumAtmosphericGas.OXYGEN).atmosphereComponent(EnumAtmosphericGas.ARGON).atmosphereComponent(EnumAtmosphericGas.WATER);
GalacticraftCore.planetOverworld.addChecklistKeys("equip_parachute");
GalacticraftCore.moonMoon = (Moon) new Moon("moon").setParentPlanet(GalacticraftCore.planetOverworld).setRelativeSize(0.2667F).setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(13F, 13F)).setRelativeOrbitTime(1 / 0.01F);
GalacticraftCore.moonMoon.setDimensionInfo(ConfigManagerCore.idDimensionMoon, WorldProviderMoon.class).setTierRequired(1);
GalacticraftCore.moonMoon.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png"));
GalacticraftCore.moonMoon.setAtmosphere(new AtmosphereInfo(false, false, false, 0.0F, 0.0F, 0.0F));
GalacticraftCore.moonMoon.setBiomeInfo(BiomeGenBaseMoon.moonFlat);
GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedZombie.class, 8, 2, 3));
GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedSpider.class, 8, 2, 3));
GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedSkeleton.class, 8, 2, 3));
GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedCreeper.class, 8, 2, 3));
GalacticraftCore.moonMoon.addMobInfo(new SpawnListEntry(EntityEvolvedEnderman.class, 10, 1, 4));
GalacticraftCore.moonMoon.addChecklistKeys("equip_oxygen_suit");
// Satellites must always have a WorldProvider implementing IOrbitDimension
GalacticraftCore.satelliteSpaceStation = (Satellite) new Satellite("spacestation.overworld").setParentBody(GalacticraftCore.planetOverworld).setRelativeSize(0.2667F).setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(9F, 9F)).setRelativeOrbitTime(1 / 0.05F);
GalacticraftCore.satelliteSpaceStation.setDimensionInfo(ConfigManagerCore.idDimensionOverworldOrbit, ConfigManagerCore.idDimensionOverworldOrbitStatic, WorldProviderOverworldOrbit.class).setTierRequired(1);
GalacticraftCore.satelliteSpaceStation.setBodyIcon(new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/celestialbodies/space_station.png"));
GalacticraftCore.satelliteSpaceStation.setAtmosphere(new AtmosphereInfo(false, false, false, 0.0F, 0.1F, 0.02F));
GalacticraftCore.satelliteSpaceStation.addChecklistKeys("equip_oxygen_suit", "create_grapple");
ForgeChunkManager.setForcedChunkLoadingCallback(GalacticraftCore.instance, new ChunkLoadingCallback());
MinecraftForge.EVENT_BUS.register(new ConnectionEvents());
SchematicRegistry.registerSchematicRecipe(new SchematicRocketT1());
SchematicRegistry.registerSchematicRecipe(new SchematicMoonBuggy());
SchematicRegistry.registerSchematicRecipe(new SchematicAdd());
ChunkPowerHandler.initiate();
EnergyConfigHandler.initGas();
CompatibilityManager.registerMicroBlocks();
this.registerCreatures();
this.registerOtherEntities();
this.registerTileEntities();
GalaxyRegistry.registerSolarSystem(GalacticraftCore.solarSystemSol);
GalaxyRegistry.registerPlanet(GalacticraftCore.planetOverworld);
GalaxyRegistry.registerMoon(GalacticraftCore.moonMoon);
GalaxyRegistry.registerSatellite(GalacticraftCore.satelliteSpaceStation);
GalacticraftRegistry.registerProvider(ConfigManagerCore.idDimensionOverworldOrbit, WorldProviderOverworldOrbit.class, false, 0);
GalacticraftRegistry.registerProvider(ConfigManagerCore.idDimensionOverworldOrbitStatic, WorldProviderOverworldOrbit.class, true, 0);
GalacticraftRegistry.registerTeleportType(WorldProviderSurface.class, new TeleportTypeOverworld());
GalacticraftRegistry.registerTeleportType(WorldProviderOverworldOrbit.class, new TeleportTypeOrbit());
GalacticraftRegistry.registerTeleportType(WorldProviderMoon.class, new TeleportTypeMoon());
GalacticraftRegistry.registerRocketGui(WorldProviderOverworldOrbit.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/overworld_rocket_gui.png"));
GalacticraftRegistry.registerRocketGui(WorldProviderSurface.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/overworld_rocket_gui.png"));
GalacticraftRegistry.registerRocketGui(WorldProviderMoon.class, new ResourceLocation(Constants.ASSET_PREFIX, "textures/gui/moon_rocket_gui.png"));
GalacticraftRegistry.addDungeonLoot(1, new ItemStack(GCItems.schematic, 1, 0));
GalacticraftRegistry.addDungeonLoot(1, new ItemStack(GCItems.schematic, 1, 1));
if (ConfigManagerCore.enableCopperOreGen) {
GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 5, 24, 0, 75, 7), 4);
}
if (ConfigManagerCore.enableTinOreGen) {
GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 6, 22, 0, 60, 7), 4);
}
if (ConfigManagerCore.enableAluminumOreGen) {
GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 7, 18, 0, 45, 7), 4);
}
if (ConfigManagerCore.enableSiliconOreGen) {
GameRegistry.registerWorldGenerator(new OverworldGenerator(GCBlocks.basicBlock, 8, 3, 0, 25, 7), 4);
}
FMLInterModComms.sendMessage("OpenBlocks", "donateUrl", "http://www.patreon.com/micdoodle8");
registerCoreGameScreens();
GCFluids.registerLegacyFluids();
GCFluids.registerDispenserBehaviours();
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_MASK, EnumExtendedInventorySlot.MASK, GCItems.oxMask);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_GEAR, EnumExtendedInventorySlot.GEAR, GCItems.oxygenGear);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_LIGHT, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankLight);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_LIGHT, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankLight);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_MEDIUM, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankMedium);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_MEDIUM, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankMedium);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_HEAVY, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxTankHeavy);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_HEAVY, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxTankHeavy);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_INFINITE, EnumExtendedInventorySlot.LEFT_TANK, GCItems.oxygenCanisterInfinite);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_OXYGEN_TANK_INFINITE, EnumExtendedInventorySlot.RIGHT_TANK, GCItems.oxygenCanisterInfinite);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_PARACHUTE, EnumExtendedInventorySlot.PARACHUTE, GCItems.parachute);
GalacticraftRegistry.registerGear(Constants.GEAR_ID_FREQUENCY_MODULE, EnumExtendedInventorySlot.FREQUENCY_MODULE, new ItemStack(GCItems.basicItem, 1, 19));
GalacticraftCore.proxy.registerFluidTexture(GCFluids.fluidOil, new ResourceLocation(Constants.ASSET_PREFIX, "textures/misc/underoil.png"));
GalacticraftCore.proxy.registerFluidTexture(GCFluids.fluidFuel, new ResourceLocation(Constants.ASSET_PREFIX, "textures/misc/underfuel.png"));
// switch (this.getSlotIndex())
// {
// case 0:
// return itemstack.getItem() instanceof ItemOxygenMask;
// case 1:
// return itemstack.getItem() == GCItems.oxygenGear;
// case 2:
// case 3:
// return itemstack.getItem() instanceof ItemOxygenTank || itemstack.getItem() instanceof ItemCanisterOxygenInfinite;
// case 4:
// return itemstack.getItem() instanceof ItemParaChute;
// case 5:
// return itemstack.getItem() == GCItems.basicItem && itemstack.getItemDamage() == 19;
// case 6:
// return this.thermalArmorSlotValid(itemstack, 0);
// case 7:
// return this.thermalArmorSlotValid(itemstack, 1);
// case 8:
// return this.thermalArmorSlotValid(itemstack, 2);
// case 9:
// return this.thermalArmorSlotValid(itemstack, 3);
// case 10:
// return this.shieldControllerSlotValid(itemstack);
// }
}
use of micdoodle8.mods.galacticraft.api.vector.Vector3 in project Galacticraft by micdoodle8.
the class EntityFXLaunchFlame method onUpdate.
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
GalacticraftCore.proxy.spawnParticle(this.spawnSmokeShort ? "whiteSmokeLaunched" : "whiteSmokeIdle", new Vector3(this.posX, this.posY + this.rand.nextDouble() * 2, this.posZ), new Vector3(this.motionX, this.motionY, this.motionZ), new Object[] {});
GalacticraftCore.proxy.spawnParticle(this.spawnSmokeShort ? "whiteSmokeLargeLaunched" : "whiteSmokeLargeIdle", new Vector3(this.posX, this.posY + this.rand.nextDouble() * 2, this.posZ), new Vector3(this.motionX, this.motionY, this.motionZ), new Object[] {});
if (!this.spawnSmokeShort) {
GalacticraftCore.proxy.spawnParticle("whiteSmokeIdle", new Vector3(this.posX, this.posY + this.rand.nextDouble() * 2, this.posZ), new Vector3(this.motionX, this.motionY, this.motionZ), new Object[] {});
GalacticraftCore.proxy.spawnParticle("whiteSmokeLargeIdle", new Vector3(this.posX, this.posY + this.rand.nextDouble() * 2, this.posZ), new Vector3(this.motionX, this.motionY, this.motionZ), new Object[] {});
}
this.setDead();
}
this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge);
this.motionY += 0.001D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.particleGreen += 0.01F;
if (this.posY == this.prevPosY) {
this.motionX *= 1.1D;
this.motionZ *= 1.1D;
}
this.motionX *= 0.9599999785423279D;
this.motionY *= 0.9599999785423279D;
this.motionZ *= 0.9599999785423279D;
final List<?> var3 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(1.0D, 0.5D, 1.0D));
if (var3 != null) {
for (int var4 = 0; var4 < var3.size(); ++var4) {
final Entity var5 = (Entity) var3.get(var4);
if (var5 instanceof EntityLivingBase) {
if (!var5.isDead && !var5.isBurning() && !var5.equals(this.ridingEntity)) {
var5.setFire(3);
GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_SET_ENTITY_FIRE, GCCoreUtil.getDimensionID(var5.worldObj), new Object[] { var5.getEntityId() }));
}
}
}
}
}
use of micdoodle8.mods.galacticraft.api.vector.Vector3 in project Galacticraft by micdoodle8.
the class TeleportTypeMoon method getPlayerSpawnLocation.
@Override
public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) {
if (player != null) {
GCPlayerStats stats = GCPlayerStats.get(player);
double x = stats.getCoordsTeleportedFromX();
double z = stats.getCoordsTeleportedFromZ();
int limit = ConfigManagerCore.otherPlanetWorldBorders - 2;
if (limit > 20) {
if (x > limit) {
z *= limit / x;
x = limit;
} else if (x < -limit) {
z *= -limit / x;
x = -limit;
}
if (z > limit) {
x *= limit / z;
z = limit;
} else if (z < -limit) {
x *= -limit / z;
z = -limit;
}
}
return new Vector3(x, ConfigManagerCore.disableLander ? 250.0 : 900.0, z);
}
return null;
}
use of micdoodle8.mods.galacticraft.api.vector.Vector3 in project Galacticraft by micdoodle8.
the class TickHandlerClient method spawnLeakParticles.
private void spawnLeakParticles() {
Random rand = new Random();
for (int i = ClientProxyCore.leakTrace.size() - 1; i >= 1; i--) {
BlockVec3 curr = ClientProxyCore.leakTrace.get(i);
int nx = i - 2;
if (i > 2 && rand.nextInt(3) == 0)
nx--;
BlockVec3 vec;
if (i > 1)
vec = ClientProxyCore.leakTrace.get(nx).clone();
else {
vec = curr.clone().translate(0, -2, 0);
}
Vector3 mot = new Vector3(vec.subtract(curr));
Vector3 rnd = new Vector3(rand.nextDouble() / 2 - 0.25, rand.nextDouble() / 2 - 0.25, rand.nextDouble() / 2 - 0.25);
GalacticraftCore.proxy.spawnParticle("oxygen", curr.midPoint().add(rnd), mot, new Object[] { new Vector3(0.7D, 0.7D, 1.0D) });
}
}
Aggregations