mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 04:32:39 +00:00
Fix Defaults / Syncing
This commit is contained in:
1 parent
c339e5edbc
commit
67237e794f
9 files changed
+219
-265
No files matched your search
@@ -68,7 +68,7 @@ public class EntityAbilityBeam extends EntityAbilityProjectile {
|
||||
private static final int DW_CHARGING = 20;
|
||||
|
||||
// Debug logging
|
||||
private static final boolean DEBUG_LOGGING = true;
|
||||
private static final boolean DEBUG_LOGGING = false;
|
||||
|
||||
public EntityAbilityBeam(World world) {
|
||||
super(world);
|
||||
@@ -560,12 +560,10 @@ public class EntityAbilityBeam extends EntityAbilityProjectile {
|
||||
|
||||
Vec3 currentPos = Vec3.createVectorHelper(prevHeadWorldX, prevHeadWorldY, prevHeadWorldZ);
|
||||
Vec3 nextPos = Vec3.createVectorHelper(headX, headY, headZ);
|
||||
MovingObjectPosition blockHit = worldObj.rayTraceBlocks(currentPos, nextPos);
|
||||
// Use full raytrace that doesn't stop at liquids and checks all blocks
|
||||
MovingObjectPosition blockHit = worldObj.func_147447_a(currentPos, nextPos, false, true, false);
|
||||
|
||||
if (blockHit != null && blockHit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
if (DEBUG_LOGGING) {
|
||||
LogWriter.info("[Beam] DEAD: Block collision at tick " + ticksExisted);
|
||||
}
|
||||
hasHit = true;
|
||||
if (explosive) {
|
||||
posX = blockHit.hitVec.xCoord;
|
||||
|
||||
@@ -413,11 +413,15 @@ public class EntityAbilityDisc extends EntityAbilityProjectile {
|
||||
private void checkBlockCollision() {
|
||||
Vec3 currentPos = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
Vec3 nextPos = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
MovingObjectPosition blockHit = worldObj.rayTraceBlocks(currentPos, nextPos);
|
||||
// Use full raytrace that doesn't stop at liquids and checks all blocks
|
||||
MovingObjectPosition blockHit = worldObj.func_147447_a(currentPos, nextPos, false, true, false);
|
||||
|
||||
if (blockHit != null && blockHit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
hasHit = true;
|
||||
if (explosive) {
|
||||
posX = blockHit.hitVec.xCoord;
|
||||
posY = blockHit.hitVec.yCoord;
|
||||
posZ = blockHit.hitVec.zCoord;
|
||||
doExplosion();
|
||||
}
|
||||
this.setDead();
|
||||
|
||||
@@ -163,7 +163,8 @@ public class EntityAbilityLaser extends EntityAbilityProjectile {
|
||||
private void checkBlockCollision() {
|
||||
Vec3 start = Vec3.createVectorHelper(startX, startY, startZ);
|
||||
Vec3 end = Vec3.createVectorHelper(endX, endY, endZ);
|
||||
MovingObjectPosition blockHit = worldObj.rayTraceBlocks(start, end);
|
||||
// Use full raytrace that doesn't stop at liquids and checks all blocks
|
||||
MovingObjectPosition blockHit = worldObj.func_147447_a(start, end, false, true, false);
|
||||
|
||||
if (blockHit != null && blockHit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
// Laser stops at block
|
||||
|
||||
@@ -298,11 +298,15 @@ public class EntityAbilityOrb extends EntityAbilityProjectile {
|
||||
private void checkBlockCollision() {
|
||||
Vec3 currentPos = Vec3.createVectorHelper(posX, posY, posZ);
|
||||
Vec3 nextPos = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
MovingObjectPosition blockHit = worldObj.rayTraceBlocks(currentPos, nextPos);
|
||||
// Use full raytrace that doesn't stop at liquids and checks all blocks
|
||||
MovingObjectPosition blockHit = worldObj.func_147447_a(currentPos, nextPos, false, true, false);
|
||||
|
||||
if (blockHit != null && blockHit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
hasHit = true;
|
||||
if (explosive) {
|
||||
posX = blockHit.hitVec.xCoord;
|
||||
posY = blockHit.hitVec.yCoord;
|
||||
posZ = blockHit.hitVec.zCoord;
|
||||
doExplosion();
|
||||
}
|
||||
this.setDead();
|
||||
|
||||
@@ -215,9 +215,6 @@ public abstract class EntityAbilityProjectile extends Entity implements IEntityA
|
||||
|
||||
// Check lifespan using world time (survives chunk unload/reload)
|
||||
if (deathWorldTime > 0 && worldObj.getTotalWorldTime() >= deathWorldTime) {
|
||||
if (!worldObj.isRemote) {
|
||||
noppes.npcs.LogWriter.info("[Projectile:" + this.getClass().getSimpleName() + "] DEAD: Lifetime exceeded. worldTime=" + worldObj.getTotalWorldTime() + " deathTime=" + deathWorldTime);
|
||||
}
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
@@ -229,9 +226,6 @@ public abstract class EntityAbilityProjectile extends Entity implements IEntityA
|
||||
}
|
||||
|
||||
if (hasHit) {
|
||||
if (!worldObj.isRemote) {
|
||||
noppes.npcs.LogWriter.info("[Projectile:" + this.getClass().getSimpleName() + "] DEAD: hasHit=true at tick " + ticksExisted);
|
||||
}
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user