Fixed TE moving when jump
* Fixed: some TileEntities may be corrupted after jump * Entities of Jump, Star core and Sphere Gen is now invisible
This commit is contained in:
parent
b2b74833c5
commit
86e96a43ee
5 changed files with 41 additions and 13 deletions
22
client/ClientProxy.java
Normal file
22
client/ClientProxy.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package cr0s.WarpDrive.client;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cr0s.WarpDrive.CommonProxy;
|
||||
import cr0s.WarpDrive.FXBeam;
|
||||
import cr0s.WarpDrive.Vector3;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenderers()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy)
|
||||
{
|
||||
System.out.println("Rendering beam...");
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy));
|
||||
}
|
||||
}
|
|
@ -990,8 +990,6 @@ public class EntityJump extends Entity
|
|||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
newTileEntity.invalidate();
|
||||
}
|
||||
else if (blockID == WarpDriveConfig.i.GT_Machine)
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
else if (blockID == WarpDriveConfig.i.AS_Turbine)
|
||||
{
|
||||
if (oldnbt.hasKey("zhuYao"))
|
||||
|
@ -1004,19 +1002,13 @@ public class EntityJump extends Entity
|
|||
}
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTileEntity = targetWorld.getBlockTileEntity(newX, newY, newZ);
|
||||
if (newTileEntity == null)
|
||||
{
|
||||
System.out.println("[EJ] Error moving tileEntity! TE is null");
|
||||
return false;
|
||||
}
|
||||
newTileEntity.invalidate();
|
||||
newTileEntity.readFromNBT(oldnbt);
|
||||
}
|
||||
|
||||
if (newTileEntity == null)
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
|
||||
newTileEntity.worldObj = targetWorld;
|
||||
newTileEntity.validate();
|
||||
|
||||
worldObj.removeBlockTileEntity(oldX, oldY, oldZ);
|
||||
targetWorld.setBlockTileEntity(newX, newY, newZ, newTileEntity);
|
||||
}
|
||||
|
|
|
@ -265,4 +265,10 @@ System.out.println("ZLO EntitySphereGen THE FUCK create");
|
|||
c.isModified = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int pass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package cr0s.WarpDrive;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -162,4 +164,10 @@ public final class EntityStarCore extends Entity
|
|||
nbttagcompound.setInteger("z", this.zCoord);
|
||||
nbttagcompound.setInteger("radius", this.radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int pass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue