Skip to content

Commit

Permalink
Merge branch 'release/0.4.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
praecipitator committed May 27, 2017
2 parents d702f88 + 15a671f commit ffcdaf1
Show file tree
Hide file tree
Showing 32 changed files with 576 additions and 205 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ repositories {
}
}


apply plugin: 'forge'



version = "0.4.6"
group= "de.katzenpapst.amunra" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
version = "0.4.7"
group = "de.katzenpapst.amunra" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "AmunRa-GC"
def gc_version = "3.0.12.498"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -75,10 +75,10 @@ dependencies {
}
compile "com.mod-buildcraft:buildcraft:6.1.5:api"

compile files("libs/MicdoodleCore-Dev-1.7-3.0.12.495.jar")
compile files("libs/Galacticraft-API-1.7-3.0.12.495.jar")
compile files("libs/GalacticraftCore-Dev-1.7-3.0.12.495.jar")
compile files("libs/Galacticraft-Planets-Dev-1.7-3.0.12.495.jar")
compile files("libs/MicdoodleCore-Dev-1.7-${gc_version}.jar")
compile files("libs/Galacticraft-API-1.7-${gc_version}.jar")
compile files("libs/GalacticraftCore-Dev-${gc_version}.jar")
compile files("libs/Galacticraft-Planets-Dev-${gc_version}.jar")


}
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
=== 0.4.7 ===
- minimal GC version is build 498
- made the Artificial Gravity Generator work using the new events
- made an animated texture for the AGG, added particles when it's on
- made an animated texture for dark matter
- the Artificial Gravity Disruptor now has to be enabled (rightclick), and will work from any point in the inventory

=== 0.4.6 ===
- allowed rockets to be started from motherships
- fixed several issue with sky rendering (asteroid fields and rings should render properly now)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/katzenpapst/amunra/AmunRa.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class AmunRa
{
public static final String MODID = "GalacticraftAmunRa";
public static final String MODNAME = "Amun-Ra";
public static final String VERSION = "0.4.6";
public static final String VERSION = "0.4.7";

public static ARChannelHandler packetPipeline;

Expand Down Expand Up @@ -169,7 +169,7 @@ public void preInit(FMLPreInitializationEvent event)
ARItems.initItems();
// this works for entityLivingEvent...
MinecraftForge.EVENT_BUS.register(new EventHandlerAR());
// ...but not for onCrafting. Because FUCK YOU, that's why!
// ...but not for onCrafting.
FMLCommonHandler.instance().bus().register(new CraftingHandler());
GameRegistry.registerFuelHandler(new FurnaceHandler());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,12 @@ public boolean canReplace(World world, int x, int y, int z, int probablySide, It
}
return super.canReplace(world, x, y, z, probablySide, stack);
}

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
int meta = world.getBlockMetadata(x, y, z);
this.getSubBlock(meta).randomDisplayTick(world, x, y, z, rand);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package de.katzenpapst.amunra.block.machine;

import java.util.Random;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import de.katzenpapst.amunra.AmunRa;
import de.katzenpapst.amunra.GuiIds;
import de.katzenpapst.amunra.block.BlockMachineMeta;
import de.katzenpapst.amunra.block.SubBlockMachine;
import de.katzenpapst.amunra.helper.CoordHelper;
import de.katzenpapst.amunra.proxy.ARSidedProxy.ParticleType;
import de.katzenpapst.amunra.tile.TileEntityGravitation;
import micdoodle8.mods.galacticraft.api.vector.Vector3;
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
Expand Down Expand Up @@ -59,28 +64,6 @@ public IIcon getIcon(int side, int meta)
return this.backIcon;
}
return this.sideIcon;
/*
ForgeDirection sideDirection = CoordHelper.rotateForgeDirection(ForgeDirection.getOrientation(side), realMeta);
switch(sideDirection) {
case DOWN:
return this.sideIcon;
case EAST:
return this.sideIcon;
case NORTH:
return this.backIcon;
case SOUTH:
return this.blockIcon;
case UP:
return this.sideIcon;
case WEST:
return this.sideIcon;
case UNKNOWN:
default:
return this.sideIcon;
}
*/
}


Expand All @@ -102,4 +85,48 @@ public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer
return true;
}

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World par1World, int x, int y, int z, Random rand)
{
boolean test = true;
if (par1World.getTileEntity(x, y, z) instanceof TileEntityGravitation)
{
TileEntityGravitation tile = (TileEntityGravitation)par1World.getTileEntity(x, y, z);
if(tile.isRunning()) {
for (int particleCount = 0; particleCount < 10; particleCount++)
{
double x2 = x + rand.nextFloat();
double y2 = y + rand.nextFloat();
double z2 = z + rand.nextFloat();
double mX = 0.0D;
double mY = 0.0D;
double mZ = 0.0D;
int dir = rand.nextInt(2) * 2 - 1;
mX = 0;//(rand.nextFloat() - 0.5D) * 0.5D;
mY = (rand.nextFloat() - 0.5D) * 0.5D;
mZ = 0;//(rand.nextFloat() - 0.5D) * 0.5D;

final int var2 = par1World.getBlockMetadata(x, y, z);

if (var2 == 3 || var2 == 2)
{
x2 = x + 0.5D + 0.25D * dir;
mX = rand.nextFloat() * 2.0F * dir;
}
else
{
z2 = z + 0.5D + 0.25D * dir;
mZ = rand.nextFloat() * 2.0F * dir;
}

if(test) {
AmunRa.proxy.spawnParticles(ParticleType.PT_GRAVITY_DUST, par1World, new Vector3(x+0.5, y+0.5, z+0.5), new Vector3(mX, tile.getGravityForce(), mZ));
} else {
GalacticraftCore.proxy.spawnParticle("oxygen", new Vector3(x2, y2, z2), new Vector3(mX, mY, mZ), new Object[] { new Vector3(0.7D, 0.7D, 1.0D) });
}
}
}
}
}
}
104 changes: 104 additions & 0 deletions src/main/java/de/katzenpapst/amunra/client/fx/EntityFXGravityDust.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package de.katzenpapst.amunra.client.fx;

import micdoodle8.mods.galacticraft.api.vector.Vector3;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World;

public class EntityFXGravityDust extends EntityFX {

private final float portalParticleScale;
private final double portalPosX;
private final double portalPosY;
private final double portalPosZ;

public EntityFXGravityDust(World par1World, Vector3 position, Vector3 motion) {
super(par1World, position.x, position.y, position.z, motion.x, motion.y, motion.z);

// better position
double xDev = par1World.rand.nextGaussian() * 0.75;
double zDev = par1World.rand.nextGaussian() * 0.75;

position.x += xDev;
position.z += zDev;

if(motion.y < 0) {
// < 0 means downwards
position.y += 2;
}

double sqDist = xDev*xDev + zDev*zDev + 0.01;

double maxLength = 1.2;

this.setPosition(position.x, position.y, position.z);

this.motionX = 0;//motion.x;
this.motionY = motion.y;
this.motionZ = 0;// motion.z;
this.portalPosX = this.posX = position.x;
this.portalPosY = this.posY = position.y;
this.portalPosZ = this.posZ = position.z;
this.portalParticleScale = this.particleScale = (float) Math.min(0.06D/(sqDist), 0.1);
Vector3 color = new Vector3(0.4, 0.4, 0.4);
//Vector3 color = new Vector3(1.0, 0.4, 0.4);
this.particleRed = color.floatX();
this.particleGreen = color.floatY();
this.particleBlue = color.floatZ();
double g = Math.abs(motion.y);
double timeNeeded = maxLength/g;
this.particleMaxAge = (int) (Math.random() * 10.0D + timeNeeded);
this.noClip = true;
this.setParticleTextureIndex((int) (Math.random() * 8.0D));
}

@Override
public int getBrightnessForRender(float par1)
{
final int var2 = super.getBrightnessForRender(par1);
float var3 = (float) this.particleAge / (float) this.particleMaxAge;
var3 *= var3;
var3 *= var3;
final int var4 = var2 & 255;
int var5 = var2 >> 16 & 255;
var5 += (int) (var3 * 15.0F * 16.0F);

if (var5 > 240)
{
var5 = 240;
}

return var4 | var5 << 16;
}

/**
* Gets how bright this entity is.
*/
@Override
public float getBrightness(float par1)
{
final float var2 = super.getBrightness(par1);
float var3 = (float) this.particleAge / (float) this.particleMaxAge;
var3 = var3 * var3 * var3 * var3;
return var2 * (1.0F - var3) + var3;
}

/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;


this.moveEntity(this.motionX, this.motionY, this.motionZ);


if (this.particleAge++ >= this.particleMaxAge)
{
this.setDead();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class EntityFXMotehrshipIonFlame extends EntityFX {
public class EntityFXMothershipIonFlame extends EntityFX {

protected float smokeParticleScale;

public EntityFXMotehrshipIonFlame(
public EntityFXMothershipIonFlame(
World world,
Vector3 pos,
Vector3 motion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package de.katzenpapst.amunra.client.fx;

import java.util.List;

import org.lwjgl.opengl.GL11;

import micdoodle8.mods.galacticraft.api.vector.Vector3;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

Expand All @@ -21,7 +17,6 @@ public EntityFXMothershipJetFire(
Vector3 motion) {
super(world, pos.x, pos.y, pos.z, motion.x, motion.y, motion.z);

//setParticleTextureIndex(82); // same as happy villager
particleScale = 2.0F;
//setRBGColorF(0x88, 0x00, 0x88);

Expand Down Expand Up @@ -54,15 +49,6 @@ public void onUpdate()

if (this.particleAge++ >= this.particleMaxAge)
{
//AmunRa.proxy.spawnParticles(ParticleType.PT_MOTHERSHIP_JET_SMOKE, this.worldObj, new Vector3(posX, posY, posZ), new Vector3(this.motionX, this.motionY, this.motionZ).scale(5.0D));
/*
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();
return;
}
Expand All @@ -72,45 +58,10 @@ public void onUpdate()


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.boundingBox.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))
{
// not just fire, do some more
// or maybe do this in the tile entity instead
/*
var5.setFire(3);
GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_SET_ENTITY_FIRE, new Object[] { var5.getEntityId() }));
*/
}
}
}
}
}

@Override
Expand Down
Loading

0 comments on commit ffcdaf1

Please sign in to comment.