mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 18:55:06 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
a314fccd1b
commit
8f026dad8f
161 files changed
+14073
-12846
No files matched your search
@@ -1,9 +1,5 @@
|
||||
package team.chisel.entity;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.GeneralChiselClient;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import team.chisel.utils.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -11,98 +7,99 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.GeneralChiselClient;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class EntityBallOMoss extends EntityThrowable {
|
||||
|
||||
public EntityBallOMoss(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
public EntityBallOMoss(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityBallOMoss(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
public EntityBallOMoss(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
|
||||
public EntityBallOMoss(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
public EntityBallOMoss(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
|
||||
setDead();
|
||||
setDead();
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.playSound(x, y, z, Chisel.MOD_ID + ":random.squash", 1.0f, 1.0f, false);
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.playSound(x, y, z, Chisel.MOD_ID + ":random.squash", 1.0f, 1.0f, false);
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
GeneralChiselClient.spawnBallOMossFX(worldObj, posX, posY, posZ);
|
||||
for (int i = 0; i < 32; i++) GeneralChiselClient.spawnBallOMossFX(worldObj, posX, posY, posZ);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int radius = 5;
|
||||
int falloff = 3;
|
||||
int radius = 5;
|
||||
int falloff = 3;
|
||||
|
||||
for (int xx = -radius; xx < radius; xx++) {
|
||||
for (int yy = -radius; yy < radius; yy++) {
|
||||
for (int zz = -radius; zz < radius; zz++) {
|
||||
double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz);
|
||||
for (int xx = -radius; xx < radius; xx++) {
|
||||
for (int yy = -radius; yy < radius; yy++) {
|
||||
for (int zz = -radius; zz < radius; zz++) {
|
||||
double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz);
|
||||
|
||||
if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2))
|
||||
continue;
|
||||
if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) continue;
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
turnToMoss(worldObj, x + xx, y + yy, z + zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!worldObj.isRemote) turnToMoss(worldObj, x + xx, y + yy, z + zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void turnToMoss(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block resBlock = block;
|
||||
int resMeta = meta;
|
||||
public static void turnToMoss(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block resBlock = block;
|
||||
int resMeta = meta;
|
||||
|
||||
if (block.equals(Blocks.cobblestone)) {
|
||||
resBlock = Blocks.mossy_cobblestone;
|
||||
} else if (block.equals(Blocks.cobblestone_wall) && meta == 0) {
|
||||
resMeta = 1;
|
||||
} else if (block.equals(ChiselBlocks.cobblestone)) {
|
||||
resBlock = ChiselBlocks.mossy_cobblestone;
|
||||
} else if (block.equals(ChiselBlocks.templeblock)) {
|
||||
resBlock = ChiselBlocks.mossy_templeblock;
|
||||
} else if (block.equals(Blocks.stonebrick)) {
|
||||
resMeta = 1;
|
||||
}
|
||||
if (block.equals(Blocks.cobblestone)) {
|
||||
resBlock = Blocks.mossy_cobblestone;
|
||||
} else if (block.equals(Blocks.cobblestone_wall) && meta == 0) {
|
||||
resMeta = 1;
|
||||
} else if (block.equals(ChiselBlocks.cobblestone)) {
|
||||
resBlock = ChiselBlocks.mossy_cobblestone;
|
||||
} else if (block.equals(ChiselBlocks.templeblock)) {
|
||||
resBlock = ChiselBlocks.mossy_templeblock;
|
||||
} else if (block.equals(Blocks.stonebrick)) {
|
||||
resMeta = 1;
|
||||
}
|
||||
|
||||
if (resBlock.equals(block) && resMeta == meta)
|
||||
return;
|
||||
world.setBlock(x, y, z, resBlock, resMeta, 3);
|
||||
}
|
||||
if (resBlock.equals(block) && resMeta == meta) return;
|
||||
world.setBlock(x, y, z, resBlock, resMeta, 3);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,9 @@ import net.minecraft.world.World;
|
||||
|
||||
public class EntityChiselSnowman extends EntitySnowman {
|
||||
|
||||
public EntityChiselSnowman(World world) {
|
||||
super(world);
|
||||
}
|
||||
public EntityChiselSnowman(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
// No special features just needed to get around the hardcoding
|
||||
// No special features just needed to get around the hardcoding
|
||||
}
|
||||
@@ -2,110 +2,115 @@ package team.chisel.entity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class EntityCloudInABottle extends EntityThrowable {
|
||||
|
||||
Random rand = new Random();
|
||||
Random rand = new Random();
|
||||
|
||||
public EntityCloudInABottle(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
public EntityCloudInABottle(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
|
||||
public EntityCloudInABottle(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
public EntityCloudInABottle(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
if (worldObj.isRemote)
|
||||
return;
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
if (worldObj.isRemote) return;
|
||||
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
|
||||
generate(worldObj, rand, x, y, z, 40);
|
||||
generate(worldObj, rand, x, y, z, 40);
|
||||
|
||||
worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 2);
|
||||
setDead();
|
||||
}
|
||||
worldObj.playAuxSFX(
|
||||
2002,
|
||||
(int) Math.round(this.posX),
|
||||
(int) Math.round(this.posY),
|
||||
(int) Math.round(this.posZ),
|
||||
2);
|
||||
setDead();
|
||||
}
|
||||
|
||||
public boolean generate(World world, Random random, int gx, int gy, int gz, int numberOfBlocks) {
|
||||
int X[] = new int[9];
|
||||
int Y[] = new int[9];
|
||||
int Z[] = new int[9];
|
||||
public boolean generate(World world, Random random, int gx, int gy, int gz, int numberOfBlocks) {
|
||||
int X[] = new int[9];
|
||||
int Y[] = new int[9];
|
||||
int Z[] = new int[9];
|
||||
|
||||
for (int dir = 0; dir < 9; dir++) {
|
||||
X[dir] = gx;
|
||||
Y[dir] = gy;
|
||||
Z[dir] = gz;
|
||||
}
|
||||
int count = 0;
|
||||
while (count < numberOfBlocks) {
|
||||
for (int dir = 0; dir < 9; dir++) {
|
||||
if (count >= numberOfBlocks)
|
||||
break;
|
||||
for (int dir = 0; dir < 9; dir++) {
|
||||
X[dir] = gx;
|
||||
Y[dir] = gy;
|
||||
Z[dir] = gz;
|
||||
}
|
||||
int count = 0;
|
||||
while (count < numberOfBlocks) {
|
||||
for (int dir = 0; dir < 9; dir++) {
|
||||
if (count >= numberOfBlocks) break;
|
||||
|
||||
int dx = dir % 3 - 1;
|
||||
int dz = dir / 3 - 1;
|
||||
int dx = dir % 3 - 1;
|
||||
int dz = dir / 3 - 1;
|
||||
|
||||
if (dx == 0 && dz == 0)
|
||||
continue;
|
||||
if (dx == 0 && dz == 0) continue;
|
||||
|
||||
X[dir] += random.nextInt(3) - 1 + dx;
|
||||
Z[dir] += random.nextInt(3) - 1 + dz;
|
||||
Y[dir] += random.nextInt(2) * (random.nextInt(3) - 1);
|
||||
X[dir] += random.nextInt(3) - 1 + dx;
|
||||
Z[dir] += random.nextInt(3) - 1 + dz;
|
||||
Y[dir] += random.nextInt(2) * (random.nextInt(3) - 1);
|
||||
|
||||
int x = X[dir];
|
||||
int y = Y[dir];
|
||||
int z = Z[dir];
|
||||
int x = X[dir];
|
||||
int y = Y[dir];
|
||||
int z = Z[dir];
|
||||
|
||||
for (int j2 = x; j2 < x + random.nextInt(4) + 1; j2++) {
|
||||
for (int k2 = y; k2 < y + random.nextInt(1) + 2; k2++) {
|
||||
for (int l2 = z; l2 < z + random.nextInt(4) + 1; l2++) {
|
||||
if (world.getBlock(j2, k2, l2).isAir(world, j2, k2, l2) && Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z) < 4 * 1 + random.nextInt(2)) {
|
||||
world.setBlock(j2, k2, l2, ChiselBlocks.cloud);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int j2 = x; j2 < x + random.nextInt(4) + 1; j2++) {
|
||||
for (int k2 = y; k2 < y + random.nextInt(1) + 2; k2++) {
|
||||
for (int l2 = z; l2 < z + random.nextInt(4) + 1; l2++) {
|
||||
if (world.getBlock(j2, k2, l2).isAir(world, j2, k2, l2)
|
||||
&& Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z)
|
||||
< 4 * 1 + random.nextInt(2)) {
|
||||
world.setBlock(j2, k2, l2, ChiselBlocks.cloud);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// System.out.println("Created " + count + " cloud blocks.");
|
||||
// System.out.println("Created " + count + " cloud blocks.");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package team.chisel.entity;
|
||||
|
||||
import team.chisel.utils.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -8,96 +7,95 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class EntitySmashingRock extends EntityThrowable {
|
||||
|
||||
public EntitySmashingRock(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
public EntitySmashingRock(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntitySmashingRock(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
public EntitySmashingRock(World par1World, EntityLivingBase par2EntityLiving) {
|
||||
super(par1World, par2EntityLiving);
|
||||
}
|
||||
|
||||
public EntitySmashingRock(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
public EntitySmashingRock(World par1World, double x, double y, double z) {
|
||||
super(par1World, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition movingobjectposition) {
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
switch (movingobjectposition.sideHit) {
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
break;
|
||||
}
|
||||
|
||||
setDead();
|
||||
setDead();
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false);
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false);
|
||||
|
||||
// for(int i = 0; i < 32; i++)
|
||||
// GeneralChiselClient.spawn
|
||||
// for(int i = 0; i < 32; i++)
|
||||
// GeneralChiselClient.spawn
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int radius = 5;
|
||||
int falloff = 3;
|
||||
int radius = 5;
|
||||
int falloff = 3;
|
||||
|
||||
for (int xx = -radius; xx < radius; xx++) {
|
||||
for (int yy = -radius; yy < radius; yy++) {
|
||||
for (int zz = -radius; zz < radius; zz++) {
|
||||
double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz);
|
||||
for (int xx = -radius; xx < radius; xx++) {
|
||||
for (int yy = -radius; yy < radius; yy++) {
|
||||
for (int zz = -radius; zz < radius; zz++) {
|
||||
double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz);
|
||||
|
||||
if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2))
|
||||
continue;
|
||||
if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) continue;
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
smash(worldObj, x + xx, y + yy, z + zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!worldObj.isRemote) smash(worldObj, x + xx, y + yy, z + zz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void smash(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block resBlock = block;
|
||||
int resMeta = meta;
|
||||
public static void smash(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block resBlock = block;
|
||||
int resMeta = meta;
|
||||
|
||||
if (block.equals(Blocks.stone)) {
|
||||
resBlock = Blocks.cobblestone;
|
||||
} else if (block.equals(Blocks.stonebrick) && meta == 0) {
|
||||
resMeta = 2;
|
||||
} else if (block.equals(Blocks.cobblestone)) {
|
||||
resBlock = Blocks.gravel;
|
||||
} else if (block.equals(Blocks.gravel)) {
|
||||
resBlock = Blocks.sand;
|
||||
}
|
||||
if (block.equals(Blocks.stone)) {
|
||||
resBlock = Blocks.cobblestone;
|
||||
} else if (block.equals(Blocks.stonebrick) && meta == 0) {
|
||||
resMeta = 2;
|
||||
} else if (block.equals(Blocks.cobblestone)) {
|
||||
resBlock = Blocks.gravel;
|
||||
} else if (block.equals(Blocks.gravel)) {
|
||||
resBlock = Blocks.sand;
|
||||
}
|
||||
|
||||
if (resBlock.equals(block) && resMeta == meta)
|
||||
return;
|
||||
world.setBlock(x, y, z, resBlock, resMeta, 3);
|
||||
}
|
||||
if (resBlock.equals(block) && resMeta == meta) return;
|
||||
world.setBlock(x, y, z, resBlock, resMeta, 3);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,123 +15,123 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityBallOMossFX extends EntityFX {
|
||||
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
|
||||
float u0, u1, v0, v1;
|
||||
IIcon icon;
|
||||
IIcon iconPlus = new IIcon() {
|
||||
float u0, u1, v0, v1;
|
||||
IIcon icon;
|
||||
IIcon iconPlus = new IIcon() {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconWidth() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconWidth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconHeight() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinU() {
|
||||
return u0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinU() {
|
||||
return u0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxU() {
|
||||
return u1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxU() {
|
||||
return u1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedU(double d0) {
|
||||
return (float) (u0 + d0 * (u1 - u0) / 16.0f);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedU(double d0) {
|
||||
return (float) (u0 + d0 * (u1 - u0) / 16.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinV() {
|
||||
return v0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinV() {
|
||||
return v0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxV() {
|
||||
return v1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxV() {
|
||||
return v1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedV(double d0) {
|
||||
return (float) (v0 + d0 * (v1 - v0) / 16.0f);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedV(double d0) {
|
||||
return (float) (v0 + d0 * (v1 - v0) / 16.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getIconName() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getIconName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
public EntityBallOMossFX(World world, double x, double y, double z) {
|
||||
super(world, x, y + 0.5, z, 0, 0, 0);
|
||||
public EntityBallOMossFX(World world, double x, double y, double z) {
|
||||
super(world, x, y + 0.5, z, 0, 0, 0);
|
||||
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.4 + 0.4 * General.rand.nextDouble();
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.4 + 0.4 * General.rand.nextDouble();
|
||||
|
||||
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
|
||||
if (General.rand.nextInt(10) == 0)
|
||||
particleMaxAge += General.rand.nextDouble() * 40.0;
|
||||
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
|
||||
if (General.rand.nextInt(10) == 0) particleMaxAge += General.rand.nextDouble() * 40.0;
|
||||
|
||||
motionX = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
motionY = (General.rand.nextDouble() * 0.5) * 0.7;
|
||||
motionZ = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
particleGravity = 2.0f;
|
||||
motionX = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
motionY = (General.rand.nextDouble() * 0.5) * 0.7;
|
||||
motionZ = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
particleGravity = 2.0f;
|
||||
|
||||
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
|
||||
icon = ChiselItems.ballomoss.getIconFromDamage(0);
|
||||
float width = 4.0f + General.rand.nextFloat() * 8.0f;
|
||||
float uu = General.rand.nextFloat() * (16.0f - width);
|
||||
float vv = General.rand.nextFloat() * (16.0f - width);
|
||||
u0 = icon.getInterpolatedU(uu);
|
||||
u1 = icon.getInterpolatedU(uu + width);
|
||||
v0 = icon.getInterpolatedV(vv);
|
||||
v1 = icon.getInterpolatedV(vv + width);
|
||||
icon = ChiselItems.ballomoss.getIconFromDamage(0);
|
||||
float width = 4.0f + General.rand.nextFloat() * 8.0f;
|
||||
float uu = General.rand.nextFloat() * (16.0f - width);
|
||||
float vv = General.rand.nextFloat() * (16.0f - width);
|
||||
u0 = icon.getInterpolatedU(uu);
|
||||
u1 = icon.getInterpolatedU(uu + width);
|
||||
v0 = icon.getInterpolatedV(vv);
|
||||
v1 = icon.getInterpolatedV(vv + width);
|
||||
|
||||
setParticleIcon(iconPlus);
|
||||
}
|
||||
setParticleIcon(iconPlus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 2;
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
double remaining = particleMaxAge - particleAge;
|
||||
double remaining = particleMaxAge - particleAge;
|
||||
|
||||
if (remaining < 5) {
|
||||
particleAlpha = (float) (remaining / 5.0);
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
}
|
||||
if (remaining < 5) {
|
||||
particleAlpha = (float) (remaining / 5.0);
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,60 +1,59 @@
|
||||
package team.chisel.entity.fx;
|
||||
|
||||
import team.chisel.block.BlockGrimstone;
|
||||
import team.chisel.utils.General;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.block.BlockGrimstone;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class EntityGrimstoneFX extends EntityFX {
|
||||
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
|
||||
public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
noClip = true;
|
||||
noClip = true;
|
||||
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
if (particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
if (particleAge < fadetime) particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge) particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else particleAlpha = 1.0f;
|
||||
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +1,59 @@
|
||||
package team.chisel.entity.fx;
|
||||
|
||||
import team.chisel.block.BlockHolystone;
|
||||
import team.chisel.utils.General;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.block.BlockHolystone;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class EntityHolystoneFX extends EntityFX {
|
||||
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
|
||||
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
noClip = true;
|
||||
noClip = true;
|
||||
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
if (particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
if (particleAge < fadetime) particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge) particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else particleAlpha = 1.0f;
|
||||
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,107 +11,109 @@ import team.chisel.utils.General;
|
||||
|
||||
public class EntitySnakestoneObsidianFX extends EntityFX {
|
||||
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
|
||||
public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) {
|
||||
super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0);
|
||||
public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) {
|
||||
super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0);
|
||||
|
||||
block = b;
|
||||
block = b;
|
||||
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.04 + 0.04 * General.rand.nextDouble();
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.04 + 0.04 * General.rand.nextDouble();
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
|
||||
|
||||
tx = x + General.rand.nextDouble();
|
||||
ty = y + General.rand.nextDouble();
|
||||
tz = z + General.rand.nextDouble();
|
||||
switch (General.rand.nextInt(6)) {
|
||||
case 0:
|
||||
tx = x;
|
||||
break;
|
||||
case 1:
|
||||
tx = x + 1;
|
||||
break;
|
||||
case 2:
|
||||
ty = y;
|
||||
break;
|
||||
case 3:
|
||||
ty = y + 1;
|
||||
break;
|
||||
case 4:
|
||||
tz = z;
|
||||
break;
|
||||
case 5:
|
||||
tz = z + 1;
|
||||
break;
|
||||
}
|
||||
tx = x + General.rand.nextDouble();
|
||||
ty = y + General.rand.nextDouble();
|
||||
tz = z + General.rand.nextDouble();
|
||||
switch (General.rand.nextInt(6)) {
|
||||
case 0:
|
||||
tx = x;
|
||||
break;
|
||||
case 1:
|
||||
tx = x + 1;
|
||||
break;
|
||||
case 2:
|
||||
ty = y;
|
||||
break;
|
||||
case 3:
|
||||
ty = y + 1;
|
||||
break;
|
||||
case 4:
|
||||
tz = z;
|
||||
break;
|
||||
case 5:
|
||||
tz = z + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
double dx = (tx - posX) * 3;
|
||||
double dy = (ty - posY) * 3;
|
||||
double dz = (tz - posZ) * 3;
|
||||
double dx = (tx - posX) * 3;
|
||||
double dy = (ty - posY) * 3;
|
||||
double dz = (tz - posZ) * 3;
|
||||
|
||||
setPosition(posX + dx, posY + dy, posZ + dz);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
setPosition(posX + dx, posY + dy, posZ + dz);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
noClip = true;
|
||||
noClip = true;
|
||||
|
||||
setParticleIcon(BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]);
|
||||
}
|
||||
setParticleIcon(
|
||||
BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
double dx = tx - posX;
|
||||
double dy = ty - posY;
|
||||
double dz = tz - posZ;
|
||||
double dx = tx - posX;
|
||||
double dy = ty - posY;
|
||||
double dz = tz - posZ;
|
||||
|
||||
double distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if (distance == 0) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
if (distance < 0.4) {
|
||||
particleAlpha = (float) (distance / 0.4);
|
||||
} else if (particleAge < 20) {
|
||||
particleAlpha = 1.0f * particleAge / 20;
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
double distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if (distance == 0) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
if (distance < 0.4) {
|
||||
particleAlpha = (float) (distance / 0.4);
|
||||
} else if (particleAge < 20) {
|
||||
particleAlpha = 1.0f * particleAge / 20;
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
|
||||
if (distance < speed) {
|
||||
speed = distance;
|
||||
}
|
||||
if (distance < speed) {
|
||||
speed = distance;
|
||||
}
|
||||
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
double px = posX + dx / distance * speed;
|
||||
double py = posY + dy / distance * speed;
|
||||
double pz = posZ + dz / distance * speed;
|
||||
double px = posX + dx / distance * speed;
|
||||
double py = posY + dy / distance * speed;
|
||||
double pz = posZ + dz / distance * speed;
|
||||
|
||||
setPosition(px, py, pz);
|
||||
}
|
||||
setPosition(px, py, pz);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user