Fixed Repo Goofyness
This commit is contained in:
parent
ed77f096c2
commit
465449abf2
4 changed files with 127 additions and 119 deletions
|
@ -601,8 +601,10 @@ public class DDTeleporter
|
|||
}
|
||||
|
||||
BaseItemDoor.placeDoorBlock(destWorld, link.destination().getX(), link.destination().getY()-1, link.destination().getZ(),link.getDestinationOrientation(), door);
|
||||
|
||||
TileEntity doorDestTE = ((BaseDimDoor)door).initDoorTE(destWorld, link.destination().getX(), link.destination().getY(), link.destination().getZ());
|
||||
|
||||
|
||||
if(doorDestTE instanceof TileEntityDimDoor)
|
||||
{
|
||||
TileEntityDimDoor.class.cast(doorDestTE).hasGennedPair=true;
|
||||
|
|
|
@ -27,16 +27,25 @@ import StevenDimDoors.mod_pocketDim.world.PocketProvider;
|
|||
|
||||
public class MobMonolith extends EntityFlying implements IMob
|
||||
{
|
||||
|
||||
float soundTime = 0;
|
||||
public int aggro = 0;
|
||||
byte textureState = 0;
|
||||
float entityCollisionReduction = 100;
|
||||
float scaleFactor = 0;
|
||||
int aggroMax;
|
||||
int destX = 0; // unused fields?
|
||||
int destY = 0;
|
||||
int destZ = 0;
|
||||
private float soundTime = 0;
|
||||
private byte textureState = 0;
|
||||
private float scaleFactor = 0;
|
||||
private int aggroMax;
|
||||
|
||||
private static DDProperties properties = null;
|
||||
|
||||
public MobMonolith(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(3F, 9.0F);
|
||||
this.noClip=true;
|
||||
this.scaleFactor = (float) ((rand.nextDouble()/2)+1);
|
||||
this.aggroMax = rand.nextInt(245)+200;
|
||||
|
||||
if (properties == null)
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void damageEntity(DamageSource par1DamageSource, float par2)
|
||||
|
@ -49,19 +58,6 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
{
|
||||
return false;
|
||||
}
|
||||
public MobMonolith(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
this.setSize(3F, 9.0F);
|
||||
this.noClip=true;
|
||||
this.scaleFactor= (float) ((rand.nextDouble()/2)+1);
|
||||
this.aggroMax=rand.nextInt(245)+200;
|
||||
|
||||
if (properties == null)
|
||||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
private static DDProperties properties = null;
|
||||
|
||||
@Override
|
||||
public boolean canDespawn()
|
||||
|
@ -245,13 +241,13 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
||||
{
|
||||
if(!(par1DamageSource == DamageSource.inWall))
|
||||
if (par1DamageSource == DamageSource.inWall)
|
||||
{
|
||||
this.aggro=400;
|
||||
this.posY = posY + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.posY=posY+1;
|
||||
this.aggro = this.aggroMax;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
|
@ -162,11 +161,6 @@ public class TileEntityRift extends TileEntity
|
|||
EntityEnderman enderman = new EntityEnderman(worldObj);
|
||||
enderman.setLocationAndAngles(xCoord + 0.5, yCoord - 1, zCoord + 0.5, 5, 6);
|
||||
worldObj.spawnEntityInWorld(enderman);
|
||||
EntityPlayer player = this.worldObj.getClosestPlayerToEntity(enderman, 50);
|
||||
if(player!=null)
|
||||
{
|
||||
enderman.setTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL12;
|
|||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
|
@ -32,8 +33,23 @@ public class RenderMobObelisk extends RenderLiving
|
|||
|
||||
public void doRenderLiving(EntityLiving entity, double x, double y, double z, float par8, float par9)
|
||||
{
|
||||
int noiseFactor = (int) (50-Math.log(MobMonolith.class.cast(entity).aggro));
|
||||
this.render(entity, x+entity.worldObj.rand.nextGaussian()/noiseFactor, y+entity.worldObj.rand.nextGaussian()/noiseFactor, z+entity.worldObj.rand.nextGaussian()/noiseFactor, par8, par9);
|
||||
final float minScaling = 0;
|
||||
final float maxScaling = 0.1f;
|
||||
final int maxAggroLevel = 500;
|
||||
MobMonolith monolith = ((MobMonolith) entity);
|
||||
|
||||
// Use linear interpolation to scale how much jitter we want for our given aggro level
|
||||
float aggroScaling = minScaling + monolith.aggro * (maxScaling - minScaling) / maxAggroLevel;
|
||||
|
||||
// Calculate jitter - include entity ID to give Monoliths individual jitters
|
||||
float time = ((Minecraft.getSystemTime() + 0xF1234568 * monolith.entityId) % 200000) / 50.0F;
|
||||
// We use random constants here on purpose just to get different wave forms
|
||||
double xJitter = aggroScaling * Math.sin(1.1f * time) * Math.sin(0.8f * time);
|
||||
double yJitter = aggroScaling * Math.sin(1.2f * time) * Math.sin(0.9f * time);
|
||||
double zJitter = aggroScaling * Math.sin(1.3f * time) * Math.sin(0.7f * time);
|
||||
|
||||
// Render with jitter
|
||||
this.render(entity, x + xJitter, y + yJitter, z + zJitter, par8, par9);
|
||||
this.func_110827_b(entity, x, y, z, par8, par9);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue