Lots of fixes.
I also played around with fluids, and added something thats for BR. Its not permanent here.
This commit is contained in:
@@ -274,8 +274,6 @@ public class DDTeleporter
|
||||
{
|
||||
throw new IllegalArgumentException("destination cannot be null.");
|
||||
}
|
||||
|
||||
|
||||
//This beautiful teleport method is based off of xCompWiz's teleport function.
|
||||
|
||||
WorldServer oldWorld = (WorldServer) entity.worldObj;
|
||||
@@ -372,6 +370,10 @@ public class DDTeleporter
|
||||
NBTTagCompound entityNBT = new NBTTagCompound();
|
||||
entity.isDead = false;
|
||||
entity.writeMountToNBT(entityNBT);
|
||||
if(entityNBT.hasNoTags())
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
entity.isDead = true;
|
||||
entity = EntityList.createEntityFromNBT(entityNBT, newWorld);
|
||||
|
||||
@@ -411,6 +413,7 @@ public class DDTeleporter
|
||||
// Let's try doing this down here in case this is what's killing NEI.
|
||||
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
||||
|
||||
|
||||
}
|
||||
DDTeleporter.placeInPortal(entity, newWorld, destination, properties, checkOrientation);
|
||||
return entity;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import StevenDimDoors.experimental.LiquidCorium;
|
||||
import StevenDimDoors.experimental.LiquidCoriumBlock;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWallPerm;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDoorGold;
|
||||
@@ -76,6 +78,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -84,6 +87,8 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
@Mod(modid = mod_pocketDim.modid, name = "Dimensional Doors", version = mod_pocketDim.version)
|
||||
|
||||
@@ -138,6 +143,9 @@ public class mod_pocketDim
|
||||
public static MonolithSpawner spawner; //Added this field temporarily. Will be refactored out later.
|
||||
public static GatewayGenerator riftGen;
|
||||
public static PlayerTracker tracker;
|
||||
|
||||
public static Block coriumBlock;
|
||||
public static Fluid coriumFluid;
|
||||
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@@ -232,7 +240,7 @@ public class mod_pocketDim
|
||||
DimensionManager.registerProviderType(properties.PocketProviderID, PocketProvider.class, false);
|
||||
DimensionManager.registerProviderType(properties.LimboProviderID, LimboProvider.class, false);
|
||||
DimensionManager.registerDimension(properties.LimboDimensionID, properties.LimboProviderID);
|
||||
|
||||
|
||||
LanguageRegistry.addName(goldDoor, "Golden Door");
|
||||
LanguageRegistry.addName(goldDimDoor, "Golden Dimensional Door");
|
||||
LanguageRegistry.addName(transientDoor , "transientDoor");
|
||||
@@ -282,8 +290,16 @@ public class mod_pocketDim
|
||||
DungeonHelper.initialize();
|
||||
this.riftGen.initGateways();
|
||||
|
||||
coriumFluid = new LiquidCorium("Corium").setDensity(1000).setTemperature(3473).setDensity(9400).setLuminosity(6).setRarity(EnumRarity.rare);
|
||||
coriumBlock = new LiquidCoriumBlock(900, coriumFluid, Material.lava).setQuantaPerBlock(16).setTickRate(20).setTickRandomly(true).setUnlocalizedName("Corium");
|
||||
FluidRegistry.registerFluid(coriumFluid);
|
||||
GameRegistry.registerBlock(coriumBlock,"Corium");
|
||||
LanguageRegistry.addName(coriumBlock, "Corium");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Register loot chests
|
||||
DDLoot.registerInfo(properties);
|
||||
proxy.loadTextures();
|
||||
|
||||
@@ -2,6 +2,8 @@ package StevenDimDoors.mod_pocketDim.ticking;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityFlying;
|
||||
@@ -29,7 +31,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
||||
float soundTime = 0;
|
||||
int aggro = 0;
|
||||
byte textureState = 0;
|
||||
|
||||
float entityCollisionReduction = 100;
|
||||
float scaleFactor = 0;
|
||||
int aggroMax;
|
||||
int destX = 0; // unused fields?
|
||||
@@ -99,6 +101,39 @@ public class MobMonolith extends EntityFlying implements IMob
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
public boolean isClipping()
|
||||
{
|
||||
|
||||
int i = MathHelper.floor_double(this.boundingBox.minX);
|
||||
int j = MathHelper.floor_double(this.boundingBox.maxX + 1.0D);
|
||||
int k = MathHelper.floor_double(this.boundingBox.minY);
|
||||
int l = MathHelper.floor_double(this.boundingBox.maxY + 1.0D);
|
||||
int i1 = MathHelper.floor_double(this.boundingBox.minZ);
|
||||
int j1 = MathHelper.floor_double(this.boundingBox.maxZ + 1.0D);
|
||||
|
||||
for (int k1 = i; k1 < j; ++k1)
|
||||
{
|
||||
for (int l1 = k; l1 < l; ++l1)
|
||||
{
|
||||
for (int i2 = i1; i2 < j1; ++i2)
|
||||
{
|
||||
if(!this.worldObj.isAirBlock(k1, l1, i2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isEntityAlive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityUpdate()
|
||||
@@ -107,12 +142,11 @@ public class MobMonolith extends EntityFlying implements IMob
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
|
||||
super.onEntityUpdate();
|
||||
|
||||
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
|
||||
if(this.isClipping())
|
||||
{
|
||||
this.setDead();
|
||||
this.moveEntity(0, .1, 0);
|
||||
}
|
||||
|
||||
EntityPlayer entityPlayer = this.worldObj.getClosestPlayerToEntity(this, 30);
|
||||
|
||||
@@ -129,8 +129,8 @@ public class MonolithSpawner implements IRegularTickReceiver {
|
||||
}
|
||||
while (!pocket.isAirBlock(x,jumpHeight+6 , z)&&jumpSanity<20);
|
||||
|
||||
Entity monolith = new MobMonolith(pocket);
|
||||
monolith.setLocationAndAngles(x, jumpHeight, z, 1, 1);
|
||||
MobMonolith monolith = new MobMonolith(pocket);
|
||||
monolith.setLocationAndAngles(x, jumpHeight-(5-monolith.getRenderSizeModifier()*5), z, 1, 1);
|
||||
pocket.spawnEntityInWorld(monolith);
|
||||
didSpawn = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user