Compare commits
2 commits
1131b22447
...
4472b68eca
Author | SHA1 | Date | |
---|---|---|---|
4472b68eca | |||
f351d614d6 |
2 changed files with 108 additions and 63 deletions
0
gradlew
vendored
Normal file → Executable file
0
gradlew
vendored
Normal file → Executable file
|
@ -52,6 +52,21 @@ public class EntityShockwave extends Entity {
|
||||||
public int revProgress;
|
public int revProgress;
|
||||||
public int radProgress;
|
public int radProgress;
|
||||||
|
|
||||||
|
private int iCounter = 0;
|
||||||
|
private boolean needsInit = true;
|
||||||
|
|
||||||
|
private int blastState = 0; // Not started
|
||||||
|
private int blastCount = 0;
|
||||||
|
|
||||||
|
private MutableBlockPos pos;
|
||||||
|
private MutableBlockPos pos2;
|
||||||
|
private MutableBlockPos pos3;
|
||||||
|
private MutableBlockPos pos4;
|
||||||
|
private MutableBlockPos pos5;
|
||||||
|
|
||||||
|
private double dist;
|
||||||
|
private double circum;
|
||||||
|
|
||||||
public EntityShockwave(World p_i1582_1_) {
|
public EntityShockwave(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
this.setSize(0, 0);
|
this.setSize(0, 0);
|
||||||
|
@ -88,52 +103,82 @@ public class EntityShockwave extends Entity {
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
|
|
||||||
if(!world.isRemote) {
|
if(!world.isRemote) {
|
||||||
MutableBlockPos pos = new BlockPos.MutableBlockPos();
|
if(needsInit) {
|
||||||
MutableBlockPos pos2 = new BlockPos.MutableBlockPos();
|
pos = new BlockPos.MutableBlockPos();
|
||||||
MutableBlockPos pos3 = new BlockPos.MutableBlockPos();
|
pos2 = new BlockPos.MutableBlockPos();
|
||||||
MutableBlockPos pos4 = new BlockPos.MutableBlockPos();
|
pos3 = new BlockPos.MutableBlockPos();
|
||||||
MutableBlockPos pos5 = new BlockPos.MutableBlockPos();
|
pos4 = new BlockPos.MutableBlockPos();
|
||||||
for(int i = 0; i < 512; i++) {
|
pos5 = new BlockPos.MutableBlockPos();
|
||||||
|
needsInit = false;
|
||||||
|
}
|
||||||
|
if(iCounter < 512*3) {
|
||||||
|
if(blastState == 0) { // Not started
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(radProgress * 0.5, 0, 0);
|
||||||
|
circum = radProgress * 2 * Math.PI * 2;
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(radProgress * 0.5, 0, 0);
|
///
|
||||||
double circum = radProgress * 2 * Math.PI * 2;
|
if(circum == 0)
|
||||||
|
circum = 1;
|
||||||
|
///
|
||||||
|
|
||||||
///
|
double part = 360D / circum;
|
||||||
if(circum == 0)
|
|
||||||
circum = 1;
|
|
||||||
///
|
|
||||||
|
|
||||||
double part = 360D / circum;
|
vec.rotateAroundY((float) (part * revProgress));
|
||||||
|
|
||||||
vec.rotateAroundY((float) (part * revProgress));
|
int x = (int) (posX + vec.xCoord);
|
||||||
|
int z = (int) (posZ + vec.zCoord);
|
||||||
|
|
||||||
int x = (int) (posX + vec.xCoord);
|
dist = radProgress * 100 / getScale() * 0.5;
|
||||||
int z = (int) (posZ + vec.zCoord);
|
pos.setPos(x, posY, z);
|
||||||
|
pos2.setPos(x-1, posY, z);
|
||||||
|
pos3.setPos(x+1, posY, z);
|
||||||
|
pos4.setPos(x, posY, z-1);
|
||||||
|
pos5.setPos(x, posY, z-1);
|
||||||
|
blastState = 1;
|
||||||
|
} else if(blastState == 1) {
|
||||||
|
switch(blastCount) {
|
||||||
|
case 0:
|
||||||
|
blast(pos, dist);
|
||||||
|
blastCount++;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
blast(pos2, dist);
|
||||||
|
blastCount++;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
blast(pos3, dist);
|
||||||
|
blastCount++;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
blast(pos4, dist);
|
||||||
|
blastCount++;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
blast(pos5, dist);
|
||||||
|
blastCount++;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
blastState = 2;
|
||||||
|
blastCount = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if(blastState == 2) {
|
||||||
|
revProgress++;
|
||||||
|
|
||||||
double dist = radProgress * 100 / getScale() * 0.5;
|
if(revProgress > circum) {
|
||||||
pos.setPos(x, posY, z);
|
revProgress = 0;
|
||||||
pos2.setPos(x-1, posY, z);
|
radProgress++;
|
||||||
pos3.setPos(x+1, posY, z);
|
}
|
||||||
pos4.setPos(x, posY, z-1);
|
|
||||||
pos5.setPos(x, posY, z-1);
|
|
||||||
blast(pos, dist);
|
|
||||||
blast(pos2, dist);
|
|
||||||
blast(pos3, dist);
|
|
||||||
blast(pos4, dist);
|
|
||||||
blast(pos5, dist);
|
|
||||||
|
|
||||||
revProgress++;
|
if(radProgress > getScale() * 2D) {
|
||||||
|
|
||||||
if(revProgress > circum) {
|
this.setDead();
|
||||||
revProgress = 0;
|
blastState = 4;
|
||||||
radProgress++;
|
}
|
||||||
}
|
blastState = 0;
|
||||||
|
}
|
||||||
if(radProgress > getScale() * 2D) {
|
|
||||||
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
iCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue