basic implementation done
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
|
||||
public class BiomeGenPocket extends BiomeGenBase
|
||||
{
|
||||
@@ -17,5 +19,11 @@ public class BiomeGenPocket extends BiomeGenBase
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCaveCreatureList.clear();
|
||||
this.spawnableMonsterList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
|
||||
this.spawnableCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
|
||||
|
||||
this.spawnableCaveCreatureList.add(new SpawnListEntry(MobObelisk.class, 1, 1, 1));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class EventHookContainer
|
||||
File dataDir = Minecraft.getMinecraft().mcDataDir;
|
||||
|
||||
event.manager.soundPoolSounds.addSound("mods/DimensionalDoors/sounds/Monolith.ogg", (mod_pocketDim.class.getResource("/mods/DimensionalDoors/sounds/Monolith.ogg")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimensionalDoors/sounds/wylkermaxcrack.wav", (mod_pocketDim.class.getResource("/mods/DimensionalDoors/sounds/wylkermaxcrack.wav")));
|
||||
event.manager.soundPoolSounds.addSound("mods/DimensionalDoors/sounds/wylkermaxcrack.ogg", (mod_pocketDim.class.getResource("/mods/DimensionalDoors/sounds/wylkermaxcrack.ogg")));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -410,6 +410,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
||||
@Override
|
||||
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
|
||||
{
|
||||
|
||||
BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
|
||||
return biomegenbase == null ? null : (biomegenbase == BiomeGenBase.swampland && par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.hasStructureAt(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : biomegenbase.getSpawnableList(par1EnumCreatureType));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
|
||||
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
@@ -11,14 +14,14 @@ import net.minecraft.world.gen.ChunkProviderGenerate;
|
||||
|
||||
public class pocketGenerator extends ChunkProviderGenerate implements IChunkProvider
|
||||
{
|
||||
private World world;
|
||||
private World worldObj;
|
||||
|
||||
public pocketGenerator(World par1World, long par2, boolean par4)
|
||||
{
|
||||
|
||||
super(par1World, par2, par4);
|
||||
// TODO Auto-generated constructor stub
|
||||
this.world=par1World;
|
||||
this.worldObj=par1World;
|
||||
}
|
||||
@Override
|
||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
||||
@@ -34,7 +37,7 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
||||
|
||||
byte[] var3 = new byte[32768];
|
||||
|
||||
Chunk var4 = new Chunk(this.world, var3, par1, par2);
|
||||
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
||||
|
||||
return var4;
|
||||
}
|
||||
@@ -63,7 +66,16 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
|
||||
int var4)
|
||||
{
|
||||
|
||||
DimData data = dimHelper.dimList.get(this.worldObj.provider.dimensionId);
|
||||
if(data!=null)
|
||||
{
|
||||
if(data.isDimRandomRift&&data.isPocket)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
return this.worldObj.getBiomeGenForCoords(var2, var3).getSpawnableList(var1);
|
||||
}
|
||||
}
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
package StevenDimDoors.mod_pocketDim.ticking;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityFlying;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.packet.Packet34EntityTeleport;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.pocketProvider;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class MobObelisk extends EntityFlying implements IMob
|
||||
{
|
||||
@@ -24,6 +27,7 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
float soundTime = 0;
|
||||
int aggro = 0;
|
||||
byte textureState = 0;
|
||||
boolean hasJumped= false;
|
||||
|
||||
int destX=0;
|
||||
int destY=0;
|
||||
@@ -32,7 +36,9 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
{
|
||||
super(par1World);
|
||||
this.texture="/mods/DimensionalDoors/textures/mobs/Monolith0.png";
|
||||
this.setSize(2F, 4.0F);
|
||||
this.setSize(2F, 8.0F);
|
||||
this.noClip=true;
|
||||
|
||||
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
@@ -45,21 +51,67 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||
{
|
||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||
entity.setPosition(x, y, z);
|
||||
}
|
||||
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Returns render size modifier
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public void onEntityUpdate()
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
|
||||
|
||||
this.texture="/mods/DimensionalDoors/textures/mobs/Monolith"+b0+".png";
|
||||
this.texture="/mods/DimensionalDoors/textures/mobs/Monolith"+b0+".png";
|
||||
if(!this.hasJumped&&!this.worldObj.isRemote)
|
||||
{
|
||||
int sanity=0;
|
||||
double jumpHeight=0;
|
||||
do
|
||||
{
|
||||
jumpHeight = this.posY+rand.nextInt(25);
|
||||
sanity++;
|
||||
}
|
||||
while(!this.worldObj.isAirBlock((int)this.posX,(int)jumpHeight+6 , (int)this.posZ)&&sanity<20);
|
||||
this.hasJumped=true;
|
||||
|
||||
this.setLocationAndAngles(this.posX,jumpHeight , this.posZ, this.rotationPitch, this.rotationYaw);
|
||||
PacketDispatcher.sendPacketToAllInDimension(new Packet34EntityTeleport(this), this.worldObj.provider.dimensionId);
|
||||
this.worldObj.updateEntity(this);
|
||||
}
|
||||
|
||||
super.onEntityUpdate();
|
||||
EntityPlayer entityPlayer = this.worldObj.getClosestPlayerToEntity(this, 20);
|
||||
|
||||
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
|
||||
{
|
||||
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
||||
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
||||
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
||||
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
EntityPlayer entityPlayer = this.worldObj.getClosestPlayerToEntity(this, 25);
|
||||
|
||||
if(entityPlayer != null)
|
||||
{
|
||||
@@ -75,19 +127,48 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
{
|
||||
if(this.worldObj.isRemote)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.playEntitySound("mods.DimensionalDoors.sounds.Monolith", entityPlayer, 1+this.textureState/2, 1, false);
|
||||
FMLClientHandler.instance().getClient().sndManager.playEntitySound("mods.DimensionalDoors.sounds.Monolith", this, 1, 1, false);
|
||||
}
|
||||
soundTime=1000;
|
||||
soundTime=100;
|
||||
}
|
||||
if(aggro<516)
|
||||
if(aggro<470)
|
||||
{
|
||||
aggro++;
|
||||
|
||||
if(aggro==500)
|
||||
if(rand.nextBoolean())
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("mods.DimensionalDoors.sounds.wylkermaxcrack", 10, 1);
|
||||
aggro++;
|
||||
}
|
||||
else if (rand.nextBoolean())
|
||||
{
|
||||
aggro++;
|
||||
aggro++;
|
||||
}
|
||||
else if (rand.nextBoolean())
|
||||
{
|
||||
aggro++;
|
||||
}
|
||||
|
||||
if(this.worldObj.provider instanceof pocketProvider)
|
||||
{
|
||||
aggro++;
|
||||
if(aggro==455)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("mods.DimensionalDoors.sounds.wylkermaxcrack", 12, 1);
|
||||
|
||||
}
|
||||
aggro++;
|
||||
if(aggro==455)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("mods.DimensionalDoors.sounds.wylkermaxcrack", 12, 1);
|
||||
|
||||
}
|
||||
}
|
||||
if(aggro>455&&aggro<460)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("mods.DimensionalDoors.sounds.wylkermaxcrack", 12, 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,9 +186,16 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
|
||||
|
||||
}
|
||||
else if(aggro>0)
|
||||
else
|
||||
{
|
||||
aggro--;
|
||||
if(this.worldObj.isRemote)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.stopEntitySound(this);
|
||||
}
|
||||
if(aggro>0)
|
||||
{
|
||||
aggro--;
|
||||
}
|
||||
}
|
||||
if(soundTime>0)
|
||||
{
|
||||
@@ -150,7 +238,7 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
}
|
||||
|
||||
|
||||
this.textureState= (byte) (this.aggro/50);
|
||||
this.textureState= (byte) (this.aggro/25);
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
|
||||
@@ -163,6 +251,16 @@ public class MobObelisk extends EntityFlying implements IMob
|
||||
|
||||
|
||||
}
|
||||
public boolean getCanSpawnHere()
|
||||
{
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
|
||||
|
||||
if(list.size()>2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
|
||||
@@ -38,8 +38,7 @@ public class ClientProxy extends CommonProxy
|
||||
|
||||
|
||||
|
||||
MinecraftForgeClient.preloadTexture(WARP_PNG);
|
||||
MinecraftForgeClient.preloadTexture(RIFT_PNG);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,13 +27,14 @@ public class ModelMobObelisk extends ModelBase
|
||||
textureWidth = 256;
|
||||
textureHeight = 256;
|
||||
|
||||
|
||||
wholemonolith = new ModelRenderer(this, 0, 0);
|
||||
wholemonolith.addBox(-32F, -72F, -8F, 32, 72, 8);
|
||||
wholemonolith.addBox(-48/2F,-108F/1.3F, -12/2F, 48, 108, 12);
|
||||
wholemonolith.setTextureSize(256, 256);
|
||||
wholemonolith.mirror = true;
|
||||
this.wholemonolith.rotationPointY=16;
|
||||
this.wholemonolith.rotationPointX=16;
|
||||
this.wholemonolith.rotationPointZ=4;
|
||||
this.wholemonolith.rotationPointY=0;
|
||||
this.wholemonolith.rotationPointX=0;
|
||||
this.wholemonolith.rotationPointZ=0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user