Merge branch '1.6.2-code' of github.com:StevenRS11/DimDoors
Conflicts: StevenDimDoors/mod_pocketDim/CraftingManager.java StevenDimDoors/mod_pocketDim/EventHookContainer.java StevenDimDoors/mod_pocketDim/blocks/BaseDimDoor.java StevenDimDoors/mod_pocketDim/blocks/BlockDimWall.java StevenDimDoors/mod_pocketDim/blocks/BlockDimWallPerm.java StevenDimDoors/mod_pocketDim/blocks/BlockDoorGold.java StevenDimDoors/mod_pocketDim/blocks/BlockGoldDimDoor.java StevenDimDoors/mod_pocketDim/blocks/BlockLimbo.java StevenDimDoors/mod_pocketDim/blocks/BlockRift.java StevenDimDoors/mod_pocketDim/blocks/TransTrapdoor.java StevenDimDoors/mod_pocketDim/commands/CommandCreateDungeonRift.java StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java StevenDimDoors/mod_pocketDim/commands/CommandDeleteAllLinks.java StevenDimDoors/mod_pocketDim/commands/CommandDeleteRifts.java StevenDimDoors/mod_pocketDim/commands/CommandExportDungeon.java StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java StevenDimDoors/mod_pocketDim/commands/CommandTeleportPlayer.java StevenDimDoors/mod_pocketDim/commands/DDCommandBase.java StevenDimDoors/mod_pocketDim/core/DDTeleporter.java StevenDimDoors/mod_pocketDim/core/NewDimData.java StevenDimDoors/mod_pocketDim/core/PocketManager.java StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java StevenDimDoors/mod_pocketDim/items/ItemBlockDimWall.java StevenDimDoors/mod_pocketDim/items/ItemRiftBlade.java StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java StevenDimDoors/mod_pocketDim/mod_pocketDim.java StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java StevenDimDoors/mod_pocketDim/tileentities/TileEntityDimDoorGold.java StevenDimDoors/mod_pocketDim/watcher/ClientLinkData.java StevenDimDoors/mod_pocketDim/world/CustomSkyProvider.java StevenDimDoors/mod_pocketDim/world/PocketBuilder.java StevenDimDoors/mod_pocketDimClient/RenderDimDoor.java StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java StevenDimDoors/mod_pocketDimClient/RenderTransTrapdoor.java build.xml
This commit is contained in:
commit
2388be2681
202 changed files with 1284 additions and 1289 deletions
StevenDimDoors
mod_pocketDim
BlankTeleporter.javaCloudRenderBlank.javaConnectionHandler.javaCraftingManager.javaEventHookContainer.javaObjectSaveInputStream.javaPacketConstants.javaPoint3D.java
blocks
BaseDimDoor.javaBlockDimWall.javaBlockDimWallPerm.javaBlockDoorGold.javaBlockGoldDimDoor.javaBlockLimbo.javaBlockRift.javaDimensionalDoor.javaTransTrapdoor.javaTransientDoor.javaWarpDoor.java
commands
CommandCreateDungeonRift.javaCommandCreatePocket.javaCommandDeleteAllLinks.javaCommandDeleteRifts.javaCommandExportDungeon.javaCommandResetDungeons.javaCommandTeleportPlayer.javaDDCommandBase.java
core
dungeon
helpers
items
BaseItemDoor.javaItemBlockDimWall.javaItemGoldDimDoor.javaItemGoldDoor.javaItemRiftBlade.javaItemRiftSignature.javaItemStabilizedRiftSignature.javaItemStableFabric.javaItemWorldThread.javaitemRiftRemover.java
mod_pocketDim.javasaving
BlacklistProcessor.javaDDSaveHandler.javaDimDataProcessor.javaPackedDungeonData.javaPackedLinkData.java
schematic
ticking
tileentities
util
watcher
world
mod_pocketDimClient
resources/assets/dimdoors
|
@ -29,7 +29,7 @@ public class BlankTeleporter extends Teleporter
|
|||
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.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||
entity.setPosition(x, y, z);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class CloudRenderBlank extends IRenderHandler
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void render(float partialTicks, WorldClient world, Minecraft mc)
|
||||
{
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.network.packet.NetHandler;
|
|||
import net.minecraft.network.packet.Packet1Login;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import cpw.mods.fml.common.network.IConnectionHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
@ -36,6 +37,28 @@ public class ConnectionHandler implements IConnectionHandler
|
|||
{
|
||||
//This shouldn't happen...
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler,MinecraftServer server, INetworkManager manager)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionClosed(INetworkManager manager)
|
||||
{
|
||||
if(PocketManager.isConnected)
|
||||
{
|
||||
PocketManager.unload();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -64,4 +87,16 @@ public class ConnectionHandler implements IConnectionHandler
|
|||
//Send information about all the registered dimensions and links to the client
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -98,8 +98,8 @@ public class CraftingManager
|
|||
{
|
||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 1), new Object[]
|
||||
{
|
||||
"yyy", "yxy", "yyy", 'x', coreCraftingItem, 'y', mod_pocketDim.itemWorldThread
|
||||
});
|
||||
"yyy", "yxy", "yyy", 'x', coreCraftingItem, 'y', mod_pocketDim.itemWorldThread
|
||||
});
|
||||
}
|
||||
|
||||
if (properties.CraftingStabilizedRiftSignatureAllowed)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import paulscode.sound.SoundSystem;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.audio.SoundPool;
|
||||
import net.minecraft.client.audio.SoundPoolEntry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -36,15 +38,15 @@ public class EventHookContainer
|
|||
@ForgeSubscribe
|
||||
public void onSoundLoad(SoundLoadEvent event)
|
||||
{
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/rift.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftStart.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftEnd.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftClose.ogg");
|
||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/riftDoor.ogg");
|
||||
event.manager.soundPoolMusic.addSound("mods/DimDoors/sfx/creepy.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":monk.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":crack.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":tearing.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":rift.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftStart.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftEnd.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftClose.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid+":riftDoor.ogg");
|
||||
event.manager.addMusic(mod_pocketDim.modid+":creepy.ogg");
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -93,6 +95,7 @@ public class EventHookContainer
|
|||
{
|
||||
player.inventory.clearInventory(-1, -1);
|
||||
}
|
||||
|
||||
ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(player.worldObj.rand);
|
||||
Point4D destination = new Point4D((int) (coords.posX+entity.posX), coords.posY, (int) (coords.posZ+entity.posZ ), mod_pocketDim.properties.LimboDimensionID);
|
||||
DDTeleporter.teleportEntity(player, destination, false);
|
||||
|
@ -114,17 +117,24 @@ public class EventHookContainer
|
|||
|
||||
public void playMusicForDim(World world)
|
||||
{
|
||||
if(world.isRemote&&world.provider instanceof LimboProvider)
|
||||
if(world.isRemote)
|
||||
{
|
||||
SoundSystem sndSystem = FMLClientHandler.instance().getClient().sndManager.sndSystem;
|
||||
sndSystem.stop("BgMusic");
|
||||
SoundPoolEntry soundPoolEntry = FMLClientHandler.instance().getClient().sndManager.soundPoolMusic.getRandomSoundFromSoundPool("mods.DimDoors.sfx.creepy");
|
||||
sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
||||
sndSystem.play("LimboMusic");
|
||||
}
|
||||
else if(world.isRemote && !(world.provider instanceof LimboProvider))
|
||||
{
|
||||
FMLClientHandler.instance().getClient().sndManager.sndSystem.stop("LimboMusic");
|
||||
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
|
||||
|
||||
if(world.provider instanceof LimboProvider)
|
||||
{
|
||||
sndManager.sndSystem.stop("BgMusic");
|
||||
SoundPoolEntry soundPoolEntry = sndManager.soundPoolMusic.getRandomSoundFromSoundPool(mod_pocketDim.modid+":creepy");
|
||||
if(soundPoolEntry!=null)
|
||||
{
|
||||
sndManager.sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
||||
sndManager.sndSystem.play("LimboMusic");
|
||||
}
|
||||
}
|
||||
else if(!(world.provider instanceof LimboProvider))
|
||||
{
|
||||
sndManager.sndSystem.stop("LimboMusic");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InvalidClassException;
|
||||
|
@ -6,7 +7,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectStreamClass;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ObjectSaveInputStream extends ObjectInputStream {
|
||||
|
||||
// private static Logger logger = LoggerFactory.getLogger(ObjectSaveInputStream.class);
|
||||
|
@ -18,7 +19,7 @@ public class ObjectSaveInputStream extends ObjectInputStream {
|
|||
@Override
|
||||
protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException {
|
||||
ObjectStreamClass resultClassDescriptor = super.readClassDescriptor(); // initially streams descriptor
|
||||
Class localClass; // the class in the local JVM that this descriptor represents.
|
||||
Class<?> localClass; // the class in the local JVM that this descriptor represents.
|
||||
try {
|
||||
localClass = Class.forName(resultClassDescriptor.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
@ -33,7 +34,7 @@ public class ObjectSaveInputStream extends ObjectInputStream {
|
|||
final StringBuffer s = new StringBuffer("Overriding serialized class version mismatch: ");
|
||||
s.append("local serialVersionUID = ").append(localSUID);
|
||||
s.append(" stream serialVersionUID = ").append(streamSUID);
|
||||
Exception e = new InvalidClassException(s.toString());
|
||||
Exception e = new InvalidClassException(s.toString());
|
||||
// logger.error("Potentially Fatal Deserialization Operation.", e);
|
||||
resultClassDescriptor = localClassDescriptor; // Use local class descriptor for deserialization
|
||||
}
|
||||
|
|
|
@ -11,4 +11,6 @@ public class PacketConstants
|
|||
public static final byte DELETE_DIM_PACKET_ID = 3;
|
||||
public static final byte CREATE_LINK_PACKET_ID = 4;
|
||||
public static final byte DELETE_LINK_PACKET_ID = 5;
|
||||
public static final byte CLIENT_LOGIN_DIM_REGISTER = 6;
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ public class Point3D implements Serializable {
|
|||
return this.z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point3D clone()
|
||||
{
|
||||
return new Point3D(x, y, z);
|
||||
|
@ -75,6 +76,7 @@ public class Point3D implements Serializable {
|
|||
return (this.x == other.x && this.y == other.y && this.z == other.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
return equals((Point3D) other);
|
||||
|
|
|
@ -6,12 +6,10 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
@ -22,12 +20,12 @@ import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEntityProvider
|
||||
{
|
||||
protected final DDProperties properties;
|
||||
|
@ -40,13 +38,15 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom");
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
||||
|
@ -64,6 +64,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
this.enterDimDoor(world, x, y, z, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
|
||||
|
@ -77,7 +78,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
shouldOpen = false;
|
||||
if (!world.isRemote && world.getBlockId(x, y-1, z) == this.blockID)
|
||||
{
|
||||
int var12 = (int) (MathHelper.floor_double((double)((player.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
||||
int var12 = MathHelper.floor_double((player.rotationYaw+90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (world.getBlockMetadata(x, y-1, z) == var12)
|
||||
{
|
||||
|
@ -87,7 +88,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
}
|
||||
if (!world.isRemote && world.getBlockId(x, y+1, z) == this.blockID)
|
||||
{
|
||||
int var12 = (int) (MathHelper.floor_double((double)((player.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
||||
int var12 = MathHelper.floor_double((player.rotationYaw+90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||
if(world.getBlockMetadata(x, y, z)==var12)
|
||||
{
|
||||
var12 = BlockRotator.transformMetadata(var12, 1, this.blockID);
|
||||
|
@ -144,6 +145,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
/**
|
||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
|
@ -175,6 +177,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
TileEntityDimDoor tile = (TileEntityDimDoor) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
|
@ -386,7 +389,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
if (canUse && entity instanceof EntityPlayer)
|
||||
{
|
||||
// Dont check for non-player entites
|
||||
canUse = isEntityFacingDoor(metadata, (EntityLiving) entity);
|
||||
canUse = isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||
}
|
||||
if (canUse)
|
||||
{
|
||||
|
@ -418,12 +421,12 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
return (metadata & 4) != 0;
|
||||
}
|
||||
|
||||
protected static boolean isEntityFacingDoor(int metadata, EntityLiving entity)
|
||||
protected static boolean isEntityFacingDoor(int metadata, EntityLivingBase entity)
|
||||
{
|
||||
// Although any entity has the proper fields for this check,
|
||||
// we should only apply it to living entities since things
|
||||
// like Minecarts might come in backwards.
|
||||
int direction = (int) (MathHelper.floor_double((double) ((entity.rotationYaw + 90) * 4.0F / 360.0F) + 0.5D) & 3);
|
||||
int direction = MathHelper.floor_double((entity.rotationYaw + 90) * 4.0F / 360.0F + 0.5D) & 3;
|
||||
return ((metadata & 3) == direction);
|
||||
}
|
||||
}
|
|
@ -57,10 +57,11 @@ public class BlockDimWall extends Block
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5) + "Perm");
|
||||
this.blockIcon[0] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
this.blockIcon[1] = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName() + "Perm");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -77,6 +78,7 @@ public class BlockDimWall extends Block
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int unknown, CreativeTabs tab, List subItems)
|
||||
|
@ -86,14 +88,17 @@ public class BlockDimWall extends Block
|
|||
subItems.add(new ItemStack(this, 1, ix));
|
||||
}
|
||||
}
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
protected boolean canSilkHarvest()
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -101,7 +106,8 @@ public class BlockDimWall extends Block
|
|||
/**
|
||||
* replaces the block clicked with the held block, instead of placing the block on top of it. Shift click to disable.
|
||||
*/
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
//Check if the metadata value is 0 -- we don't want the user to replace Ancient Fabric
|
||||
if (entityPlayer.getCurrentEquippedItem() != null && world.getBlockMetadata(x, y, z) == 0)
|
||||
|
|
|
@ -30,21 +30,25 @@ public class BlockDimWallPerm extends Block
|
|||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||
|
||||
/**
|
||||
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
||||
*/
|
||||
@Override
|
||||
public void onEntityWalking(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if (!world.isRemote && world.provider.dimensionId == properties.LimboDimensionID)
|
||||
|
|
|
@ -17,6 +17,7 @@ public class BlockDoorGold extends BlockDoor
|
|||
{
|
||||
|
||||
private Icon blockIconBottom;
|
||||
@SuppressWarnings("unused") // ??
|
||||
private DDProperties properties;
|
||||
|
||||
public BlockDoorGold(int par1, Material par2Material,DDProperties properties)
|
||||
|
@ -26,22 +27,25 @@ public class BlockDoorGold extends BlockDoor
|
|||
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5)+"_bottom");
|
||||
}
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_top");
|
||||
this.blockIconBottom = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName()+"_bottom");
|
||||
}
|
||||
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2)
|
||||
{
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
|
||||
public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BlockGoldDimDoor extends BaseDimDoor
|
||||
{
|
||||
|
||||
public BlockGoldDimDoor(int blockID, Material material,
|
||||
DDProperties properties) {
|
||||
super(blockID, material, properties);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,9 +37,9 @@ public class BlockGoldDimDoor extends BaseDimDoor implements IDimDoor
|
|||
}
|
||||
@Override
|
||||
public int getDrops()
|
||||
{
|
||||
{
|
||||
return mod_pocketDim.itemGoldDoor.itemID;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
|
|
|
@ -40,7 +40,7 @@ public class BlockLimbo extends Block
|
|||
@Override
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
||||
this.blockIcon = iconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BlockRift extends BlockContainer
|
|||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
||||
|
@ -313,10 +313,10 @@ public class BlockRift extends BlockContainer
|
|||
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
||||
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
||||
|
||||
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
|
||||
Xoffset= ((0.25F/(1+Math.abs(xChange))));
|
||||
|
||||
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
|
||||
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
||||
Yoffset= ((0.25F/(1+Math.abs(yChange))));
|
||||
Zoffset= ((0.25F/(1+Math.abs(zChange))));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DimensionalDoor extends BaseDimDoor
|
||||
{
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.block.ITileEntityProvider;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
|
@ -17,9 +16,9 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityTransTrapdoor;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntityProvider
|
||||
{
|
||||
|
||||
|
@ -32,7 +31,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().substring(5));
|
||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
}
|
||||
|
||||
//Teleports the player to the exit link of that dimension, assuming it is a pocket
|
||||
|
@ -65,6 +64,7 @@ public class TransTrapdoor extends BlockTrapDoor implements IDimDoor, ITileEntit
|
|||
this.updateAttachedTile(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
TileEntityTransTrapdoor tile = (TileEntityTransTrapdoor) world.getBlockTileEntity(x, y, z);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package StevenDimDoors.mod_pocketDim.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class TransientDoor extends BaseDimDoor
|
||||
{
|
||||
public TransientDoor(int blockID, Material material, DDProperties properties)
|
||||
|
@ -37,10 +37,10 @@ public class TransientDoor extends BaseDimDoor
|
|||
{
|
||||
boolean canUse = true;
|
||||
int metadata = world.getBlockMetadata(x, y - 1, z);
|
||||
if (canUse && entity instanceof EntityLiving)
|
||||
if (canUse && entity instanceof EntityPlayer)
|
||||
{
|
||||
// Don't check for non-living entities since it might not work right
|
||||
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLiving) entity);
|
||||
canUse = BaseDimDoor.isEntityFacingDoor(metadata, (EntityLivingBase) entity);
|
||||
}
|
||||
if (canUse)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class WarpDoor extends BaseDimDoor
|
||||
{
|
||||
public WarpDoor(int blockID, Material material, DDProperties properties)
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
|
@ -14,6 +9,13 @@ import StevenDimDoors.mod_pocketDim.dungeon.DungeonData;
|
|||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandCreateDungeonRift extends DDCommandBase
|
||||
{
|
||||
private static CommandCreateDungeonRift instance = null;
|
||||
|
@ -62,9 +64,9 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
Collection<String> dungeonNames = dungeonHelper.getDungeonNames();
|
||||
for (String name : dungeonNames)
|
||||
{
|
||||
sender.addChatMessage(name);
|
||||
sendChat(sender,(name));
|
||||
}
|
||||
sender.addChatMessage("");
|
||||
sendChat(sender,(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -73,7 +75,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
int x = MathHelper.floor_double(sender.posX);
|
||||
int y = MathHelper.floor_double(sender.posY);
|
||||
int z = MathHelper.floor_double (sender.posZ);
|
||||
int orientation = MathHelper.floor_double((double) ((sender.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
int orientation = MathHelper.floor_double((sender.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
|
||||
if (command[0].equals("random"))
|
||||
{
|
||||
|
@ -82,7 +84,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
|
||||
sender.addChatMessage("Created a rift to a random dungeon.");
|
||||
sendChat(sender,("Created a rift to a random dungeon."));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -92,17 +94,17 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||
result = findDungeonByPartialName(command[0], dungeonHelper.getUntaggedDungeons());
|
||||
}
|
||||
//Check if we found any matches
|
||||
if (result != null)
|
||||
{
|
||||
//Create a rift to our selected dungeon and notify the player
|
||||
//TODO currently crashes, need to create the dimension first
|
||||
dimension = PocketManager.getDimensionData(sender.worldObj);
|
||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
||||
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
sender.addChatMessage("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ").");
|
||||
}
|
||||
if (result != null)
|
||||
{
|
||||
//Create a rift to our selected dungeon and notify the player
|
||||
//TODO currently crashes, need to create the dimension first
|
||||
dimension = PocketManager.getDimensionData(sender.worldObj);
|
||||
link = dimension.createLink(x, y + 1, z, LinkTypes.DUNGEON,orientation);
|
||||
PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result);
|
||||
|
||||
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID,0,3);
|
||||
sendChat(sender,("Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ")."));
|
||||
}
|
||||
else
|
||||
{
|
||||
//No matches!
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CommandCreatePocket extends DDCommandBase
|
|||
DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
||||
|
||||
//Notify the player
|
||||
sender.addChatMessage("Created a door to a pocket dimension. Please build your dungeon there.");
|
||||
sendChat(sender,("Created a door to a pocket dimension. Please build your dungeon there."));
|
||||
}
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandDeleteAllLinks extends DDCommandBase
|
||||
{
|
||||
private static CommandDeleteAllLinks instance = null;
|
||||
|
@ -47,7 +48,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||
{
|
||||
targetDim=0;
|
||||
shouldGo=false;
|
||||
sender.addChatMessage("Error-Invalid argument, delete_all_links <targetDimID>");
|
||||
sendChat(sender, ("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||
}
|
||||
|
||||
if(shouldGo)
|
||||
|
@ -65,7 +66,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||
|
||||
linksRemoved++;
|
||||
}
|
||||
sender.addChatMessage("Removed " + linksRemoved + " links.");
|
||||
sendChat(sender,("Removed " + linksRemoved + " links."));
|
||||
|
||||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
|
|
|
@ -10,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandDeleteRifts extends DDCommandBase
|
||||
{
|
||||
private static CommandDeleteRifts instance = null;
|
||||
|
@ -47,7 +48,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||
{
|
||||
targetDim=0;
|
||||
shouldGo=false;
|
||||
sender.addChatMessage("Error-Invalid argument, delete_all_links <targetDimID>");
|
||||
sendChat(sender,("Error-Invalid argument, delete_all_links <targetDimID>"));
|
||||
}
|
||||
|
||||
if(shouldGo)
|
||||
|
@ -67,7 +68,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||
dim.deleteLink(link);
|
||||
}
|
||||
}
|
||||
sender.addChatMessage("Removed " + linksRemoved + " rifts.");
|
||||
sendChat(sender,("Removed " + linksRemoved + " rifts."));
|
||||
|
||||
}
|
||||
return DDCommandResult.SUCCESS; //TEMPORARY HACK
|
||||
|
|
|
@ -140,7 +140,7 @@ public class CommandExportDungeon extends DDCommandBase
|
|||
String exportPath = properties.CustomSchematicDirectory + File.separator + name + ".schematic";
|
||||
if (dungeonHelper.exportDungeon(player.worldObj, x, y, z, exportPath))
|
||||
{
|
||||
player.addChatMessage("Saved dungeon schematic in " + exportPath);
|
||||
sendChat(player,("Saved dungeon schematic in " + exportPath));
|
||||
dungeonHelper.registerDungeon(exportPath, dungeonHelper.getDungeonPack("ruins"), false, true);
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CommandResetDungeons extends DDCommandBase
|
||||
{
|
||||
private static CommandResetDungeons instance = null;
|
||||
|
@ -90,7 +91,7 @@ public class CommandResetDungeons extends DDCommandBase
|
|||
//TODO- for some reason the parent field of loaded dimenions get reset to null if I call .setParentToRoot() before I delete the pockets.
|
||||
//TODO implement blackList
|
||||
//Notify the user of the results
|
||||
sender.addChatMessage("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset.");
|
||||
sendChat(sender,("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset."));
|
||||
return DDCommandResult.SUCCESS;
|
||||
}
|
||||
}
|
|
@ -1,24 +1,16 @@
|
|||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.BlankTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
|
||||
public class CommandTeleportPlayer extends DDCommandBase
|
||||
{
|
||||
private static CommandTeleportPlayer instance = null;
|
||||
|
@ -48,7 +40,7 @@ public class CommandTeleportPlayer extends DDCommandBase
|
|||
@Override
|
||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||
{
|
||||
List dimensionIDs = Arrays.asList(DimensionManager.getStaticDimensionIDs()); //Gets list of all registered dimensions, regardless if loaded or not
|
||||
List<Integer> dimensionIDs = Arrays.asList(DimensionManager.getStaticDimensionIDs()); //Gets list of all registered dimensions, regardless if loaded or not
|
||||
EntityPlayer targetPlayer = sender;
|
||||
int dimDestinationID = sender.worldObj.provider.dimensionId;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.commands;
|
|||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
|
||||
/*
|
||||
|
@ -32,6 +33,7 @@ public abstract class DDCommandBase extends CommandBase
|
|||
*/
|
||||
protected abstract DDCommandResult processCommand(EntityPlayer sender, String[] command);
|
||||
|
||||
@Override
|
||||
public final String getCommandName()
|
||||
{
|
||||
return name;
|
||||
|
@ -49,6 +51,7 @@ public abstract class DDCommandBase extends CommandBase
|
|||
* Method invoked by the server to execute a command. The call is forwarded to a derived class
|
||||
* to provide the sending player directly.
|
||||
*/
|
||||
@Override
|
||||
public final void processCommand(ICommandSender sender, String[] command)
|
||||
{
|
||||
//Forward the command
|
||||
|
@ -63,10 +66,10 @@ public abstract class DDCommandBase extends CommandBase
|
|||
//Send the argument formats for this command
|
||||
for (String format : formats)
|
||||
{
|
||||
player.addChatMessage("Usage: " + name + " " + format);
|
||||
sendChat(player,("Usage: " + name + " " + format));
|
||||
}
|
||||
}
|
||||
player.addChatMessage(result.getMessage());
|
||||
sendChat(player,(result.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.entity.EntityList;
|
|||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||
import net.minecraft.network.packet.Packet43Experience;
|
||||
|
@ -23,8 +22,6 @@ import net.minecraftforge.common.DimensionManager;
|
|||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockRift;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||
|
@ -34,6 +31,7 @@ import StevenDimDoors.mod_pocketDim.util.Point4D;
|
|||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DDTeleporter
|
||||
{
|
||||
private static final Random random = new Random();
|
||||
|
@ -235,7 +233,7 @@ public class DDTeleporter
|
|||
private static 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.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||
entity.setPosition(x, y, z);
|
||||
}
|
||||
|
@ -304,7 +302,7 @@ public class DDTeleporter
|
|||
}
|
||||
else
|
||||
{
|
||||
newWorld = (WorldServer) oldWorld;
|
||||
newWorld = oldWorld;
|
||||
}
|
||||
|
||||
|
||||
|
@ -327,6 +325,7 @@ public class DDTeleporter
|
|||
// the last non-sleeping player leaves the Overworld
|
||||
// for a pocket dimension, causing all sleeping players
|
||||
// to remain asleep instead of progressing to day.
|
||||
((WorldServer)entity.worldObj).getPlayerManager().removePlayer(player);
|
||||
oldWorld.removePlayerEntityDangerously(player);
|
||||
player.isDead = false;
|
||||
|
||||
|
@ -399,7 +398,6 @@ public class DDTeleporter
|
|||
if (player != null)
|
||||
{
|
||||
newWorld.getChunkProvider().loadChunk(MathHelper.floor_double(entity.posX) >> 4, MathHelper.floor_double(entity.posZ) >> 4);
|
||||
|
||||
// Tell Forge we're moving its players so everyone else knows.
|
||||
// Let's try doing this down here in case this is what's killing NEI.
|
||||
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
||||
|
|
|
@ -14,6 +14,7 @@ import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonPack;
|
|||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class NewDimData
|
||||
{
|
||||
private static class InnerDimLink extends DimLink
|
||||
|
@ -244,7 +245,6 @@ public abstract class NewDimData
|
|||
{
|
||||
return Math.abs(i) + Math.abs(j) + Math.abs(k);
|
||||
}
|
||||
|
||||
public DimLink createLink(int x, int y, int z, int linkType,int orientation)
|
||||
{
|
||||
return createLink(new Point4D(x, y, z, id), linkType,orientation);
|
||||
|
@ -333,7 +333,11 @@ public abstract class NewDimData
|
|||
{
|
||||
linkList.remove(target);
|
||||
//Raise deletion event
|
||||
linkWatcher.onDeleted(target.source);
|
||||
//TODO why is source null here?
|
||||
if(target.source!=null)
|
||||
{
|
||||
linkWatcher.onDeleted(target.source);
|
||||
}
|
||||
target.clear();
|
||||
}
|
||||
return (target != null);
|
||||
|
|
|
@ -36,6 +36,7 @@ import StevenDimDoors.mod_pocketDim.watcher.UpdateWatcherProxy;
|
|||
* This class regulates all the operations involving the storage and manipulation of dimensions. It handles saving dim data, teleporting the player, and
|
||||
* creating/registering new dimensions as well as loading old dimensions on startup
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PocketManager
|
||||
{
|
||||
private static class InnerDimData extends NewDimData implements IPackable<PackedDimData>
|
||||
|
@ -154,24 +155,24 @@ public class PocketManager
|
|||
}
|
||||
}
|
||||
|
||||
private static class ClientLinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.CLIENT_SIDE,link.orientation);
|
||||
}
|
||||
private static class ClientLinkWatcher implements IUpdateWatcher<ClientLinkData>
|
||||
{
|
||||
@Override
|
||||
public void onCreated(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.createLink(source.getX(), source.getY(), source.getZ(), LinkTypes.CLIENT_SIDE,link.orientation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleted(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.deleteLink(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onDeleted(ClientLinkData link)
|
||||
{
|
||||
Point4D source = link.point;
|
||||
NewDimData dimension = getDimensionData(source.getDimension());
|
||||
dimension.deleteLink(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClientDimWatcher implements IUpdateWatcher<ClientDimData>
|
||||
{
|
||||
|
@ -276,6 +277,7 @@ public class PocketManager
|
|||
dimData.parent=dimData;
|
||||
dimData.isFilled=packedData.IsFilled;
|
||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||
|
||||
PocketManager.rootDimensions.add(dimData);
|
||||
}
|
||||
else
|
||||
|
@ -284,6 +286,7 @@ public class PocketManager
|
|||
dimData = new InnerDimData(packedData.ID, test,true, packedData.IsDungeon, linkWatcher);
|
||||
dimData.isFilled=packedData.IsFilled;
|
||||
dimData.origin = new Point4D(packedData.Origin.getX(),packedData.Origin.getY(),packedData.Origin.getZ(),packedData.ID);
|
||||
|
||||
dimData.root=PocketManager.getDimensionData(packedData.RootID);
|
||||
|
||||
if(packedData.DungeonData!=null)
|
||||
|
@ -596,8 +599,7 @@ public class PocketManager
|
|||
|
||||
public static void unload()
|
||||
{
|
||||
System.out.println("Dimensional Doors unloading...");
|
||||
|
||||
System.out.println("Unloading Pocket Dimensions...");
|
||||
if (!isLoaded)
|
||||
{
|
||||
throw new IllegalStateException("Pocket dimensions have already been unloaded!");
|
||||
|
@ -685,9 +687,10 @@ public class PocketManager
|
|||
}
|
||||
public static void readPacket(DataInputStream input) throws IOException
|
||||
{
|
||||
//TODO- figure out why this is getting called so frequently
|
||||
if (isLoaded)
|
||||
{
|
||||
throw new IllegalStateException("Pocket dimensions have already been loaded!");
|
||||
return;
|
||||
}
|
||||
if (isLoading)
|
||||
{
|
||||
|
@ -696,8 +699,12 @@ public class PocketManager
|
|||
// Load compacted client-side dimension data
|
||||
load();
|
||||
Compactor.readDimensions(input, new DimRegistrationCallback());
|
||||
isConnected = true;
|
||||
|
||||
// Register pocket dimensions
|
||||
DDProperties properties = DDProperties.instance();
|
||||
|
||||
isLoaded = true;
|
||||
isLoading = false;
|
||||
isConnected = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ public class DungeonSchematic extends Schematic {
|
|||
|
||||
public static DungeonSchematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
||||
{
|
||||
// TODO: fix resource leak
|
||||
return readFromStream(new FileInputStream(schematicFile));
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||
|
||||
public DungeonPackConfigReader() { }
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Override
|
||||
public DungeonPackConfig readFromStream(InputStream inputStream) throws ConfigurationProcessingException
|
||||
{
|
||||
|
@ -206,6 +207,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||
|
||||
private class DungeonTypeProcessor implements ILineProcessor
|
||||
{
|
||||
@Override
|
||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
List<String> typeNames = config.getTypeNames();
|
||||
|
@ -229,6 +231,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||
|
||||
private class DungeonSettingsParser implements ILineProcessor
|
||||
{
|
||||
@Override
|
||||
public void process(String line, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
//The various settings that we support will be hardcoded here.
|
||||
|
@ -295,6 +298,7 @@ public class DungeonPackConfigReader extends BaseConfigurationProcessor<DungeonP
|
|||
|
||||
private class RuleDefinitionParser implements ILineProcessor
|
||||
{
|
||||
@Override
|
||||
public void process(String definition, DungeonPackConfig config) throws ConfigurationProcessingException
|
||||
{
|
||||
String[] ruleParts;
|
||||
|
|
|
@ -17,7 +17,7 @@ public class BlockRotationHelper
|
|||
{
|
||||
HashMap<Integer,HashMap<Integer, Integer>> orientation0 = new HashMap<Integer,HashMap<Integer, Integer>>();
|
||||
|
||||
HashMap<Integer,Integer> stairs0 = new HashMap();
|
||||
HashMap<Integer,Integer> stairs0 = new HashMap<Integer,Integer>();
|
||||
|
||||
stairs0.put(0, 2);
|
||||
stairs0.put(1, 3);
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
package StevenDimDoors.mod_pocketDim.helpers;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -8,41 +15,29 @@ import net.minecraftforge.common.DimensionManager;
|
|||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.tileentities.TileEntityDimDoorGold;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
|
||||
|
||||
public class ChunkLoaderHelper implements LoadingCallback
|
||||
{
|
||||
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
int goldDimDoorX = ticket.getModData().getInteger("goldDimDoorX");
|
||||
int goldDimDoorY = ticket.getModData().getInteger("goldDimDoorY");
|
||||
int goldDimDoorZ = ticket.getModData().getInteger("goldDimDoorZ");
|
||||
if(world.getBlockId(goldDimDoorX, goldDimDoorY, goldDimDoorZ)!=mod_pocketDim.properties.GoldDimDoorID)
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
IChunkLoader tile = (IChunkLoader) world.getBlockTileEntity(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
tile.forceChunkLoading(ticket,goldDimDoorX,goldDimDoorZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
int goldDimDoorX = ticket.getModData().getInteger("goldDimDoorX");
|
||||
int goldDimDoorY = ticket.getModData().getInteger("goldDimDoorY");
|
||||
int goldDimDoorZ = ticket.getModData().getInteger("goldDimDoorZ");
|
||||
if(world.getBlockId(goldDimDoorX, goldDimDoorY, goldDimDoorZ)!=mod_pocketDim.properties.GoldDimDoorID)
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
IChunkLoader tile = (IChunkLoader) world.getBlockTileEntity(goldDimDoorX, goldDimDoorY, goldDimDoorZ);
|
||||
tile.forceChunkLoading(ticket,goldDimDoorX,goldDimDoorZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadChunkForcedWorlds(FMLServerStartingEvent event)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
|||
public class Compactor
|
||||
{
|
||||
|
||||
@SuppressWarnings("unused") // ?
|
||||
private static class DimComparator implements Comparator<NewDimData>
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -140,7 +140,11 @@ public class DungeonHelper
|
|||
config.setName(name);
|
||||
return config;
|
||||
}
|
||||
catch (ConfigurationProcessingException e)
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
System.err.println("Could not find a dungeon pack config file: " + configPath);
|
||||
}
|
||||
catch (Exception e) // handles IOException and ConfigurationProcessingException
|
||||
{
|
||||
System.err.println(e.getMessage());
|
||||
if (e.getCause() != null)
|
||||
|
@ -148,10 +152,6 @@ public class DungeonHelper
|
|||
System.err.println(e.getCause());
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
System.err.println("Could not find a dungeon pack config file: " + configPath);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -442,6 +442,7 @@ public class DungeonHelper
|
|||
System.out.println("Registering bundled dungeon pack: " + name);
|
||||
|
||||
InputStream listStream = this.getClass().getResourceAsStream(listPath);
|
||||
// chance of leak?
|
||||
if (listStream == null)
|
||||
{
|
||||
System.err.println("Unable to open list of bundled dungeon schematics for " + name);
|
||||
|
|
|
@ -29,6 +29,7 @@ public abstract class BaseItemDoor extends ItemDoor
|
|||
properties = DDProperties.instance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
|
@ -59,7 +60,7 @@ public abstract class BaseItemDoor extends ItemDoor
|
|||
player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack) &&
|
||||
(!requireLink || PocketManager.getLink(x, y + 1, z, world) != null)&&stack.stackSize>0)
|
||||
{
|
||||
int orientation = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
placeDoorBlock(world, x, y, z, orientation, doorBlock);
|
||||
|
||||
if (!player.capabilities.isCreativeMode && reduceStack)
|
||||
|
|
|
@ -15,7 +15,8 @@ public class ItemBlockDimWall extends ItemBlock
|
|||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("tile.", ""));
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -12,53 +12,47 @@ import net.minecraft.world.World;
|
|||
|
||||
public class ItemGoldDoor extends ItemDoor
|
||||
{
|
||||
|
||||
public ItemGoldDoor(int par1, Material par2Material)
|
||||
{
|
||||
super(par1, par2Material);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (par7 != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++par5;
|
||||
Block block = mod_pocketDim.goldDoor;
|
||||
|
||||
|
||||
|
||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
||||
--par1ItemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
{
|
||||
if (par7 != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
++par5;
|
||||
Block block = mod_pocketDim.goldDoor;
|
||||
|
||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
if (!block.canPlaceBlockAt(par3World, par4, par5, par6))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i1 = MathHelper.floor_double((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
placeDoorBlock(par3World, par4, par5, par6, i1, block);
|
||||
--par1ItemStack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
|
@ -24,6 +23,7 @@ import net.minecraft.world.World;
|
|||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import com.google.common.collect.Multimap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -91,9 +91,9 @@ public class ItemRiftBlade extends ItemSword
|
|||
float var4 = 1.0F;
|
||||
float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
|
||||
float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
|
||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
|
||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
|
||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
|
||||
double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * var4;
|
||||
double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * var4 + 1.62D - par2EntityPlayer.yOffset;
|
||||
double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * var4;
|
||||
Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
|
||||
float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
|
||||
float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
|
||||
|
@ -106,13 +106,13 @@ public class ItemRiftBlade extends ItemSword
|
|||
{
|
||||
var21 = 7;
|
||||
}
|
||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
||||
Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21);
|
||||
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
|
||||
}
|
||||
|
||||
private boolean teleportToEntity(ItemStack item, Entity par1Entity, EntityPlayer holder)
|
||||
{
|
||||
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + (double)(holder.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
|
||||
Vec3 var2 = holder.worldObj.getWorldVec3Pool().getVecFromPool(holder.posX - par1Entity.posX, holder.boundingBox.minY + holder.height / 2.0F - par1Entity.posY + par1Entity.getEyeHeight(), holder.posZ - par1Entity.posZ);
|
||||
|
||||
double cooef =( var2.lengthVector()-2.5)/var2.lengthVector();
|
||||
var2.xCoord*=cooef;
|
||||
|
@ -147,13 +147,13 @@ public class ItemRiftBlade extends ItemSword
|
|||
if (!world.isRemote)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<EntityLiving> list = (List<EntityLiving>) world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX-8,player.posY-8, player.posZ-8, player.posX+8,player.posY+8, player.posZ+8));
|
||||
List<EntityLiving> list = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX-8,player.posY-8, player.posZ-8, player.posX+8,player.posY+8, player.posZ+8));
|
||||
list.remove(player);
|
||||
|
||||
for (EntityLiving ent : list)
|
||||
{
|
||||
Vec3 var3 = player.getLook(1.0F).normalize();
|
||||
Vec3 var4 = player.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - player.posX, ent.boundingBox.minY + (double)((ent.height) / 2.0F) - ( player.posY + (double) player.getEyeHeight()), ent.posZ - player.posZ);
|
||||
Vec3 var4 = player.worldObj.getWorldVec3Pool().getVecFromPool(ent.posX - player.posX, ent.boundingBox.minY + (ent.height) / 2.0F - ( player.posY + player.getEyeHeight()), ent.posZ - player.posZ);
|
||||
double var5 = var4.lengthVector();
|
||||
var4 = var4.normalize();
|
||||
double var7 = var3.dotProduct(var4);
|
||||
|
@ -178,13 +178,13 @@ public class ItemRiftBlade extends ItemSword
|
|||
if (player.canPlayerEdit(x, y, z, hit.sideHit, stack) &&
|
||||
player.canPlayerEdit(x, y + 1, z, hit.sideHit, stack))
|
||||
{
|
||||
int orientation = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
|
||||
if (BaseItemDoor.canPlace(world, x, y, z) &&
|
||||
BaseItemDoor.canPlace(world, x, y - 1, z))
|
||||
{
|
||||
ItemDimensionalDoor.placeDoorBlock(world, x, y - 1, z, orientation, mod_pocketDim.transientDoor);
|
||||
player.worldObj.playSoundAtEntity(player,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
|
||||
player.worldObj.playSoundAtEntity(player,mod_pocketDim.modid+":riftDoor", 0.6f, 1);
|
||||
stack.damageItem(3, player);
|
||||
return stack;
|
||||
}
|
||||
|
@ -218,6 +218,7 @@ public class ItemRiftBlade extends ItemSword
|
|||
/**
|
||||
* allows items to add custom lines of information to the mouseover description
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
|
|
|
@ -98,15 +98,15 @@ public class ItemRiftSignature extends Item
|
|||
stack.stackSize--;
|
||||
}
|
||||
clearSource(stack);
|
||||
player.addChatMessage("Rift Created");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
||||
mod_pocketDim.sendChat(player,("Rift Created"));
|
||||
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftEnd", 0.6f, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//The link signature has not been used. Store its current target as the first location.
|
||||
setSource(stack, x, adjustedY, z,orientation, PocketManager.getDimensionData(world));
|
||||
player.addChatMessage("Location Stored in Rift Signature");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
||||
mod_pocketDim.sendChat(player,("Location Stored in Rift Signature"));
|
||||
world.playSoundAtEntity(player,mod_pocketDim.modid+":riftStart", 0.6f, 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||
super(itemID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
|
@ -49,14 +50,17 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||
int adjustedY = adjustYForSpecialBlocks(world,x,y,z);
|
||||
|
||||
// Check if the Stabilized Rift Signature has been initialized
|
||||
int orientation = MathHelper.floor_double((double) ((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
int orientation = MathHelper.floor_double((player.rotationYaw + 180.0F) * 4.0F / 360.0F - 0.5D) & 3;
|
||||
if (source != null)
|
||||
{
|
||||
// Yes, it's initialized. Check if the player is in creative
|
||||
// or if the player can pay an Ender Pearl to create a rift.
|
||||
if (!player.capabilities.isCreativeMode && !player.inventory.hasItem(Item.enderPearl.itemID))
|
||||
{
|
||||
player.addChatMessage("You don't have any Ender Pearls!");
|
||||
mod_pocketDim.sendChat(player,"You don't have any Ender Pearls!");
|
||||
// I won't do this, but this is the chance to localize chat
|
||||
// messages sent to the player; look at ChatMessageComponent
|
||||
// and how MFR does it with items like the safari net launcher
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -86,14 +90,14 @@ public class ItemStabilizedRiftSignature extends ItemRiftSignature
|
|||
{
|
||||
player.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
||||
}
|
||||
player.addChatMessage("Rift Created");
|
||||
mod_pocketDim.sendChat(player,"Rift Created");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftEnd", 0.6f, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//The link signature has not been used. Store its current target as the first location.
|
||||
setSource(stack, x, adjustedY, z, orientation, PocketManager.getDimensionData(world));
|
||||
player.addChatMessage("Location Stored in Rift Signature");
|
||||
mod_pocketDim.sendChat(player,"Location Stored in Rift Signature");
|
||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftStart", 0.6f, 1);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -12,6 +12,7 @@ public class ItemStableFabric extends Item
|
|||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
|
|
|
@ -12,6 +12,7 @@ public class ItemWorldThread extends Item
|
|||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||
|
|
|
@ -29,6 +29,7 @@ public class itemRiftRemover extends Item
|
|||
this.setMaxDamage(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
|
@ -114,7 +115,7 @@ public class itemRiftRemover extends Item
|
|||
{
|
||||
stack.damageItem(1, player);
|
||||
}
|
||||
player.worldObj.playSoundAtEntity(player, "mods.DimDoors.sfx.riftClose", 0.8f, 1);
|
||||
player.worldObj.playSoundAtEntity(player, mod_pocketDim.modid+":riftClose", 0.8f, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWallPerm;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDoorGold;
|
||||
|
@ -62,13 +49,10 @@ import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
|||
import StevenDimDoors.mod_pocketDim.world.PocketProvider;
|
||||
import StevenDimDoors.mod_pocketDimClient.ClientPacketHandler;
|
||||
import StevenDimDoors.mod_pocketDimClient.ClientTickHandler;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.Mod.ServerStarting;
|
||||
import cpw.mods.fml.common.Mod.ServerStopping;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
|
@ -83,6 +67,22 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
|||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
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.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
@Mod(modid = mod_pocketDim.modid, name = "Dimensional Doors", version = mod_pocketDim.version)
|
||||
|
||||
|
@ -91,11 +91,10 @@ clientPacketHandlerSpec =
|
|||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ClientPacketHandler.class),
|
||||
serverPacketHandlerSpec =
|
||||
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
|
||||
|
||||
public class mod_pocketDim
|
||||
{
|
||||
public static final String version = "$VERSION$";
|
||||
public static final String modid = "DimDoors";
|
||||
public static final String modid = "dimdoors";
|
||||
|
||||
//need to clean up
|
||||
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
|
||||
|
@ -103,7 +102,7 @@ public class mod_pocketDim
|
|||
|
||||
@Instance("PocketDimensions")
|
||||
public static mod_pocketDim instance = new mod_pocketDim();
|
||||
|
||||
|
||||
public static Block transientDoor;
|
||||
public static Block warpDoor;
|
||||
public static Block goldDoor;
|
||||
|
@ -128,53 +127,56 @@ public class mod_pocketDim
|
|||
public static Item itemStableFabric;
|
||||
public static Item itemChaosDoor;
|
||||
public static Item itemStabilizedLinkSignature;
|
||||
|
||||
|
||||
public static BiomeGenBase limboBiome;
|
||||
public static BiomeGenBase pocketBiome;
|
||||
|
||||
|
||||
public static boolean isPlayerWearingGoogles = false;
|
||||
|
||||
public static DDProperties properties;
|
||||
public static MonolithSpawner spawner; //Added this field temporarily. Will be refactored out later.
|
||||
public static GatewayGenerator riftGen;
|
||||
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(mod_pocketDim.itemDimDoor, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslatedTabLabel()
|
||||
{
|
||||
return "Dimensional Doors";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@PreInit
|
||||
public static CreativeTabs dimDoorsCreativeTab = new CreativeTabs("dimDoorsCreativeTab")
|
||||
{
|
||||
@Override
|
||||
public ItemStack getIconItemStack()
|
||||
{
|
||||
return new ItemStack(mod_pocketDim.itemDimDoor, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslatedTabLabel()
|
||||
{
|
||||
return "Dimensional Doors";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPreInitialization(FMLPreInitializationEvent event)
|
||||
{
|
||||
this.instance = this;
|
||||
instance = this;
|
||||
//This should be the FIRST thing that gets done.
|
||||
properties = DDProperties.initialize(event.getSuggestedConfigurationFile());
|
||||
String path = event.getSuggestedConfigurationFile().getAbsolutePath().replace(modid, "DimDoors");
|
||||
|
||||
properties = DDProperties.initialize(new File(path));
|
||||
|
||||
//Now do other stuff
|
||||
MinecraftForge.EVENT_BUS.register(new EventHookContainer(properties));
|
||||
|
||||
|
||||
riftGen = new GatewayGenerator(properties);
|
||||
}
|
||||
|
||||
@Init
|
||||
@SuppressWarnings("unused")
|
||||
@EventHandler
|
||||
public void onInitialization(FMLInitializationEvent event)
|
||||
{
|
||||
CommonTickHandler commonTickHandler = new CommonTickHandler();
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
TickRegistry.registerTickHandler(commonTickHandler, Side.SERVER);
|
||||
|
||||
|
||||
//MonolithSpawner should be initialized before any provider instances are created
|
||||
//Register the other regular tick receivers as well
|
||||
spawner = new MonolithSpawner(commonTickHandler, properties);
|
||||
|
@ -193,7 +195,7 @@ public class mod_pocketDim
|
|||
unstableDoor = (new UnstableDoor(properties.UnstableDoorID, Material.iron, properties).setHardness(.2F).setUnlocalizedName("chaosDoor").setLightValue(.0F) );
|
||||
dimensionalDoor = (DimensionalDoor) (new DimensionalDoor(properties.DimensionalDoorID, Material.iron, properties).setHardness(1.0F).setResistance(2000.0F) .setUnlocalizedName("dimDoor"));
|
||||
transTrapdoor = (TransTrapdoor) (new TransTrapdoor(properties.TransTrapdoorID, Material.wood).setHardness(1.0F) .setUnlocalizedName("dimHatch"));
|
||||
|
||||
|
||||
itemGoldDimDoor = (new ItemGoldDimDoor(properties.GoldDimDoorItemID, Material.iron)).setUnlocalizedName("itemGoldDimDoor");
|
||||
itemGoldDoor = (new ItemGoldDoor(properties.GoldDoorID, Material.wood)).setUnlocalizedName("itemGoldDoor");
|
||||
itemDimDoor = (new ItemDimensionalDoor(properties.DimensionalDoorItemID, Material.iron)).setUnlocalizedName("itemDimDoor");
|
||||
|
@ -206,7 +208,7 @@ public class mod_pocketDim
|
|||
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig");
|
||||
itemWorldThread = (new ItemWorldThread(properties.ItemWorldThreadID)).setUnlocalizedName("itemWorldThread");
|
||||
|
||||
|
||||
|
||||
mod_pocketDim.limboBiome= (new BiomeGenLimbo(properties.LimboBiomeID));
|
||||
mod_pocketDim.pocketBiome= (new BiomeGenPocket(properties.PocketBiomeID));
|
||||
|
||||
|
@ -222,7 +224,7 @@ public class mod_pocketDim
|
|||
GameRegistry.registerBlock(transTrapdoor,"Transdimensional Trapdoor");
|
||||
GameRegistry.registerBlock(blockDimWallPerm, "Fabric of RealityPerm");
|
||||
GameRegistry.registerBlock(transientDoor, "transientDoor");
|
||||
|
||||
|
||||
GameRegistry.registerBlock(blockDimWall, ItemBlockDimWall.class, "Fabric of Reality");
|
||||
|
||||
DimensionManager.registerProviderType(properties.PocketProviderID, PocketProvider.class, false);
|
||||
|
@ -240,7 +242,7 @@ public class mod_pocketDim
|
|||
LanguageRegistry.addName(blockDimWallPerm , "Eternal Fabric");
|
||||
LanguageRegistry.addName(dimensionalDoor, "Dimensional Door");
|
||||
LanguageRegistry.addName(transTrapdoor, "Transdimensional Trapdoor");
|
||||
|
||||
|
||||
LanguageRegistry.addName(itemExitDoor, "Warp Door");
|
||||
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
||||
LanguageRegistry.addName(itemGoldDoor, "Golden Door");
|
||||
|
@ -253,16 +255,16 @@ public class mod_pocketDim
|
|||
LanguageRegistry.addName(itemRiftBlade , "Rift Blade");
|
||||
LanguageRegistry.addName(itemWorldThread, "World Thread");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add names for multiblock inventory item
|
||||
*/
|
||||
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 0), "Fabric of Reality");
|
||||
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 1), "Ancient Fabric");
|
||||
|
||||
|
||||
|
||||
LanguageRegistry.instance().addStringLocalization("itemGroup.dimDoorsCustomTab", "en_US", "Dimensional Doors Items");
|
||||
|
||||
|
||||
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
||||
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
||||
GameRegistry.registerTileEntity(TileEntityTransTrapdoor.class, "TileEntityDimHatch");
|
||||
|
@ -276,20 +278,20 @@ public class mod_pocketDim
|
|||
|
||||
CraftingManager.registerRecipies();
|
||||
DungeonHelper.initialize();
|
||||
|
||||
|
||||
proxy.loadTextures();
|
||||
proxy.registerRenderers();
|
||||
}
|
||||
|
||||
|
||||
@PostInit
|
||||
@EventHandler
|
||||
public void onPostInitialization(FMLPostInitializationEvent event)
|
||||
{
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, new ChunkLoaderHelper());
|
||||
//Register loot chests
|
||||
DDLoot.registerInfo();
|
||||
}
|
||||
@ServerStopping
|
||||
@EventHandler
|
||||
public void onServerStopping(FMLServerStoppingEvent event)
|
||||
{
|
||||
try
|
||||
|
@ -302,12 +304,12 @@ public class mod_pocketDim
|
|||
}
|
||||
}
|
||||
|
||||
@ServerStarting
|
||||
@EventHandler
|
||||
public void onServerStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
|
||||
|
||||
//TODO- load dims with forced chunks on server startup here
|
||||
|
||||
|
||||
CommandResetDungeons.instance().register(event);
|
||||
CommandCreateDungeonRift.instance().register(event);
|
||||
CommandDeleteAllLinks.instance().register(event);
|
||||
|
@ -318,7 +320,7 @@ public class mod_pocketDim
|
|||
//CommandPruneDimensions.instance().register(event);
|
||||
CommandCreatePocket.instance().register(event);
|
||||
CommandTeleportPlayer.instance().register(event);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
ChunkLoaderHelper.loadChunkForcedWorlds(event);
|
||||
|
@ -328,4 +330,12 @@ public class mod_pocketDim
|
|||
System.out.println("Loading chunkloaders failed");
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendChat(EntityPlayer player, String message)
|
||||
{
|
||||
ChatMessageComponent cmp = new ChatMessageComponent();
|
||||
cmp.addText(message);
|
||||
player.sendChatToPlayer(cmp);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ public class BlacklistProcessor extends BaseConfigurationProcessor<List<Integer>
|
|||
{
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||
List<Integer> data = this.createBlacklistFromJson(reader);
|
||||
reader.close();
|
||||
return data;
|
||||
}
|
||||
catch (IOException e)
|
||||
|
|
|
@ -144,6 +144,7 @@ public class DDSaveHandler
|
|||
linkType = LinkTypes.NORMAL;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
DimLink link = data.createLink(packedLink.source, linkType, packedLink.orientation);
|
||||
Point4D destination = packedLink.tail.destination;
|
||||
if(destination!=null)
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
package StevenDimDoors.mod_pocketDim.saving;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.util.BaseConfigurationProcessor;
|
||||
|
@ -33,6 +27,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
{
|
||||
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||
PackedDimData data = this.createDImDataFromJson(reader);
|
||||
reader.close();
|
||||
return data;
|
||||
}
|
||||
catch (IOException e)
|
||||
|
@ -92,7 +87,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
reader.beginObject();
|
||||
|
||||
reader.nextName();
|
||||
if(reader.nextLong()!=PackedDimData.SAVE_DATA_VERSION_ID)
|
||||
if (reader.nextLong() != PackedDimData.SAVE_DATA_VERSION_ID)
|
||||
{
|
||||
throw new IOException("Save data version mismatch");
|
||||
}
|
||||
|
@ -182,7 +177,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
List<Integer> list = new ArrayList<Integer>();
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
list.add(reader.nextInt());
|
||||
|
||||
|
@ -197,7 +192,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek()!= JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
list.add(createLinkDataFromJson(reader));
|
||||
}
|
||||
|
@ -230,7 +225,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
reader.nextName();
|
||||
reader.beginArray();
|
||||
|
||||
while(reader.peek() != JsonToken.END_ARRAY)
|
||||
while (reader.peek() != JsonToken.END_ARRAY)
|
||||
{
|
||||
children.add(this.createPointFromJson(reader));
|
||||
}
|
||||
|
@ -250,6 +245,7 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
String DungeonPackName;
|
||||
|
||||
reader.beginObject();
|
||||
@SuppressWarnings("unused")
|
||||
JsonToken test = reader.peek();
|
||||
|
||||
if(reader.peek() == JsonToken.END_OBJECT)
|
||||
|
@ -283,13 +279,14 @@ public class DimDataProcessor extends BaseConfigurationProcessor<PackedDimData>
|
|||
}
|
||||
private PackedLinkTail createLinkTailFromJson(JsonReader reader) throws IOException
|
||||
{
|
||||
Point4D destination=null;
|
||||
Point4D destination = null;
|
||||
int linkType;
|
||||
reader.beginObject();
|
||||
reader.nextName();
|
||||
|
||||
JsonToken test =reader.peek();
|
||||
if(reader.peek()==JsonToken.BEGIN_OBJECT)
|
||||
@SuppressWarnings("unused")
|
||||
JsonToken test = reader.peek();
|
||||
if (reader.peek() == JsonToken.BEGIN_OBJECT)
|
||||
{
|
||||
destination = this.createPoint4DFromJson(reader);
|
||||
reader.nextName();
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package StevenDimDoors.mod_pocketDim.saving;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.dungeon.pack.DungeonType;
|
||||
|
||||
public class PackedDungeonData
|
||||
{
|
||||
|
||||
public final int Weight;
|
||||
public final boolean IsOpen;
|
||||
public final boolean IsInternal;
|
||||
|
@ -23,7 +20,4 @@ public class PackedDungeonData
|
|||
this.DungeonTypeName=dungeonTypeName;
|
||||
this.DungeonPackName=dungeonPackName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package StevenDimDoors.mod_pocketDim.saving;
|
|||
import java.util.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
|
||||
public class PackedLinkData
|
||||
|
|
|
@ -47,6 +47,7 @@ public class CompactBoundsOperation extends WorldOperation
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean finish()
|
||||
{
|
||||
if (minX == Integer.MAX_VALUE)
|
||||
|
|
|
@ -118,6 +118,7 @@ public class Schematic {
|
|||
|
||||
public static Schematic readFromFile(File schematicFile) throws FileNotFoundException, InvalidSchematicException
|
||||
{
|
||||
// TODO: fix resource leaks here
|
||||
return readFromStream(new FileInputStream(schematicFile));
|
||||
}
|
||||
|
||||
|
@ -329,7 +330,7 @@ public class Schematic {
|
|||
{
|
||||
//Used when the result of this function will be passed outside this class.
|
||||
//Avoids exposing the private field to external modifications.
|
||||
schematicTag.setTag("TileEntities", (NBTTagList) tileEntities.copy());
|
||||
schematicTag.setTag("TileEntities", tileEntities.copy());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -48,6 +48,7 @@ public class SchematicFilter {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return name;
|
||||
|
|
|
@ -2,10 +2,10 @@ package StevenDimDoors.mod_pocketDim.ticking;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityFlying;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -14,6 +14,7 @@ import net.minecraft.util.ChunkCoordinates;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.DDTeleporter;
|
||||
|
@ -30,10 +31,21 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
|
||||
float scaleFactor = 0;
|
||||
int aggroMax;
|
||||
int destX=0;
|
||||
int destY=0;
|
||||
int destZ=0;
|
||||
int destX = 0; // unused fields?
|
||||
int destY = 0;
|
||||
int destZ = 0;
|
||||
|
||||
@Override
|
||||
protected void damageEntity(DamageSource par1DamageSource, float par2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public MobMonolith(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
|
@ -67,6 +79,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRenderSizeModifier()
|
||||
{
|
||||
return this.scaleFactor;
|
||||
|
@ -75,11 +88,12 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
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.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||
entity.setPosition(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
|
@ -107,7 +121,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
{
|
||||
if(this.soundTime<=0)
|
||||
{
|
||||
this.playSound("mods.DimDoors.sfx.monk", 1F, 1F);
|
||||
this.playSound(mod_pocketDim.modid+":monk", 1F, 1F);
|
||||
this.soundTime=100;
|
||||
}
|
||||
|
||||
|
@ -134,29 +148,29 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
}
|
||||
if (aggro>430&&this.soundTime<100)
|
||||
{
|
||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,"mods.DimDoors.sfx.tearing",2F, 1F);
|
||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,mod_pocketDim.modid+":tearing",2F, 1F);
|
||||
this.soundTime=100;
|
||||
}
|
||||
if (aggro>445&&this.soundTime<200)
|
||||
{
|
||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,"mods.DimDoors.sfx.tearing",5F, 1F);
|
||||
this.worldObj.playSoundEffect(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ,mod_pocketDim.modid+":tearing",5F, 1F);
|
||||
this.soundTime=200;
|
||||
}
|
||||
}
|
||||
else if (!this.worldObj.isRemote && !entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
ChunkCoordinates coords = LimboProvider.getLimboSkySpawn(entityPlayer.worldObj.rand);
|
||||
Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID);
|
||||
DDTeleporter.teleportEntity(entityPlayer, destination, false);
|
||||
|
||||
this.aggro = 0;
|
||||
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1);
|
||||
Point4D destination = new Point4D((int) (coords.posX+entityPlayer.posX), coords.posY, (int) (coords.posZ+entityPlayer.posZ ), mod_pocketDim.properties.LimboDimensionID);
|
||||
DDTeleporter.teleportEntity(entityPlayer, destination, false);
|
||||
|
||||
this.aggro = 0;
|
||||
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,mod_pocketDim.modid+":crack",13, 1);
|
||||
}
|
||||
if (!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5) != null) || this.aggro > 300)
|
||||
{
|
||||
for (int i = 0; i < -1+this.textureState/2; ++i)
|
||||
{
|
||||
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * this.width, entityPlayer.posY + this.rand.nextDouble() * entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -201,34 +215,20 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
return par1EntityPlayer.canEntityBeSeen(this);
|
||||
}
|
||||
|
||||
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
|
||||
{
|
||||
double d4 = (par1 - this.posX) / par7;
|
||||
double d5 = (par3 - this.posY) / par7;
|
||||
double d6 = (par5 - this.posZ) / par7;
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
|
||||
|
||||
for (int i = 1; (double)i < par7; ++i)
|
||||
{
|
||||
axisalignedbb.offset(d4, d5, d6);
|
||||
|
||||
if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
||||
{
|
||||
if(!(par1DamageSource==DamageSource.inWall))
|
||||
if(!(par1DamageSource == DamageSource.inWall))
|
||||
{
|
||||
this.aggro=400;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.posY=posY+1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void faceEntity(Entity par1Entity, float par2, float par3)
|
||||
{
|
||||
double d0 = par1Entity.posX - this.posX;
|
||||
|
@ -238,14 +238,14 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
if (par1Entity instanceof EntityLiving)
|
||||
{
|
||||
EntityLiving entityliving = (EntityLiving)par1Entity;
|
||||
d2 = entityliving.posY + (double)entityliving.getEyeHeight() - (this.posY + (double)this.getEyeHeight());
|
||||
d2 = entityliving.posY + entityliving.getEyeHeight() - (this.posY + this.getEyeHeight());
|
||||
}
|
||||
else
|
||||
{
|
||||
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + (double)this.getEyeHeight());
|
||||
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + this.getEyeHeight());
|
||||
}
|
||||
|
||||
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
||||
double d3 = MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
||||
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
|
||||
this.rotationPitch = f3;
|
||||
|
@ -256,28 +256,13 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
this.renderYawOffset=this.rotationYaw;
|
||||
}
|
||||
|
||||
private float updateRotation(float par1, float par2, float par3)
|
||||
{
|
||||
float f3 = MathHelper.wrapAngleTo180_float(par2 - par1);
|
||||
|
||||
if (f3 > par3)
|
||||
{
|
||||
f3 = par3;
|
||||
}
|
||||
|
||||
if (f3 < -par3)
|
||||
{
|
||||
f3 = -par3;
|
||||
}
|
||||
|
||||
return par1 + f3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotationYawHead()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(par1NBTTagCompound);
|
||||
|
@ -298,9 +283,11 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
this.textureState = par1NBTTagCompound.getByte("textureState");
|
||||
this.scaleFactor = par1NBTTagCompound.getFloat("scaleFactor");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere()
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
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(this.worldObj.provider.dimensionId==DDProperties.instance().LimboDimensionID)
|
||||
|
@ -313,11 +300,19 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||
}
|
||||
else if(this.worldObj.provider instanceof PocketProvider)
|
||||
{
|
||||
if(list.size()>5||this.worldObj.canBlockSeeTheSky((int)this.posX, (int)this.posY, (int)this.posZ))
|
||||
if (list.size() > 5 ||
|
||||
this.worldObj.canBlockSeeTheSky((int)this.posX, (int)this.posY, (int)this.posZ))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
||||
return this.worldObj.checkNoEntityCollision(this.boundingBox) &&
|
||||
this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() &&
|
||||
!this.worldObj.isAnyLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public DataWatcher getDataWatcher()
|
||||
{
|
||||
return this.dataWatcher;
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ public class RiftRegenerator implements IRegularTickReceiver {
|
|||
regenerateRiftsInAllWorlds();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void regenerateRiftsInAllWorlds()
|
||||
{
|
||||
//Regenerate rifts that have been replaced (not permanently removed) by players
|
||||
|
@ -40,7 +41,7 @@ public class RiftRegenerator implements IRegularTickReceiver {
|
|||
{
|
||||
for (int count = 0; count < RIFTS_REGENERATED_PER_DIMENSION; count++)
|
||||
{
|
||||
DimLink link = dimension.getRandomLink();
|
||||
DimLink link = dimension.getRandomLink();
|
||||
Point4D source = link.source();
|
||||
if (!mod_pocketDim.blockRift.isBlockImmune(world, source.getX(), source.getY(), source.getZ())&& world.getChunkProvider().chunkExists(source.getX() >> 4, source.getZ() >> 4))
|
||||
{
|
||||
|
|
|
@ -1,78 +1,57 @@
|
|||
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityDimDoor extends TileEntity
|
||||
|
||||
{
|
||||
public boolean openOrClosed;
|
||||
public int orientation;
|
||||
public boolean hasExit;
|
||||
public boolean isDungeonChainLink;
|
||||
public boolean hasGennedPair=false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger(("Size"));
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
@Override
|
||||
public void updateEntity() { }
|
||||
|
||||
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
@SuppressWarnings("unused") // ???
|
||||
int i = nbt.getInteger(("Size"));
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
|
||||
}
|
||||
catch (Exception e) // ???
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
|
||||
nbt.setBoolean("hasGennedPair", hasGennedPair);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
@SuppressWarnings("unused") // ?????
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
nbt.setBoolean("hasGennedPair", hasGennedPair);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||
|
||||
import java.awt.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.IChunkLoader;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.world.PocketBuilder;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
|
@ -13,129 +17,116 @@ import net.minecraftforge.common.ForgeChunkManager.Type;
|
|||
|
||||
public class TileEntityDimDoorGold extends TileEntityDimDoor implements IChunkLoader
|
||||
{
|
||||
|
||||
private Ticket chunkTicket;
|
||||
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{ // every tick?
|
||||
if (PocketManager.getDimensionData(this.worldObj) != null &&
|
||||
PocketManager.getDimensionData(this.worldObj).isPocketDimension() &&
|
||||
!this.worldObj.isRemote)
|
||||
{
|
||||
if(PocketManager.getLink(this.xCoord,this.yCoord,this.zCoord,this.worldObj)==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.chunkTicket == null)
|
||||
{
|
||||
if(chunkTicket == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||
forceChunkLoading(chunkTicket,this.xCoord,this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceChunkLoading(Ticket chunkTicket,int x,int z)
|
||||
{
|
||||
Point4D origin = PocketManager.getDimensionData(this.worldObj).origin();
|
||||
int orientation = PocketManager.getDimensionData(this.worldObj).orientation();
|
||||
|
||||
int xOffset=0;
|
||||
int zOffset=0;
|
||||
|
||||
switch(orientation)
|
||||
{
|
||||
case 0:
|
||||
xOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
break;
|
||||
case 1:
|
||||
zOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
xOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
zOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
break;
|
||||
}
|
||||
for(int chunkX = -1; chunkX<2;chunkX++)
|
||||
{
|
||||
for(int chunkZ = -1; chunkZ<2;chunkZ++)
|
||||
{
|
||||
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((origin.getX()+xOffset >> 4)+chunkX, (origin.getZ()+zOffset >> 4)+chunkZ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(chunkTicket);
|
||||
super.invalidate();
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{ // every tick?
|
||||
if (PocketManager.getDimensionData(this.worldObj) != null &&
|
||||
PocketManager.getDimensionData(this.worldObj).isPocketDimension() &&
|
||||
!this.worldObj.isRemote)
|
||||
{
|
||||
if(PocketManager.getLink(this.xCoord,this.yCoord,this.zCoord,this.worldObj)==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.chunkTicket == null)
|
||||
{
|
||||
chunkTicket = ForgeChunkManager.requestTicket(mod_pocketDim.instance, worldObj, Type.NORMAL);
|
||||
if(chunkTicket == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
chunkTicket.getModData().setInteger("goldDimDoorX", xCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorY", yCoord);
|
||||
chunkTicket.getModData().setInteger("goldDimDoorZ", zCoord);
|
||||
forceChunkLoading(chunkTicket,this.xCoord,this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceChunkLoading(Ticket chunkTicket,int x,int z)
|
||||
{
|
||||
Point4D origin = PocketManager.getDimensionData(this.worldObj).origin();
|
||||
int orientation = PocketManager.getDimensionData(this.worldObj).orientation();
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
int i = nbt.getInteger(("Size"));
|
||||
int xOffset=0;
|
||||
int zOffset=0;
|
||||
|
||||
switch(orientation)
|
||||
{
|
||||
case 0:
|
||||
xOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
break;
|
||||
case 1:
|
||||
zOffset = PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
break;
|
||||
case 2:
|
||||
xOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
|
||||
break;
|
||||
case 3:
|
||||
zOffset = -PocketBuilder.DEFAULT_POCKET_SIZE/2;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
for(int chunkX = -1; chunkX<2;chunkX++)
|
||||
{
|
||||
for(int chunkZ = -1; chunkZ<2;chunkZ++)
|
||||
{
|
||||
ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair((origin.getX()+xOffset >> 4)+chunkX, (origin.getZ()+zOffset >> 4)+chunkZ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
ForgeChunkManager.releaseTicket(chunkTicket);
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{ // this and write both call user, and super saves/reads all the same data. why override at all?
|
||||
super.readFromNBT(nbt);
|
||||
@SuppressWarnings("unused") // ???
|
||||
int i = nbt.getInteger(("Size"));
|
||||
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
this.openOrClosed = nbt.getBoolean("openOrClosed");
|
||||
this.orientation = nbt.getInteger("orientation");
|
||||
this.hasExit = nbt.getBoolean("hasExit");
|
||||
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
|
||||
}
|
||||
catch (Exception e) // ???
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
@SuppressWarnings("unused") // ?????
|
||||
int i = 0;
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setBoolean("openOrClosed", this.openOrClosed);
|
||||
nbt.setBoolean("hasExit", this.hasExit);
|
||||
nbt.setInteger("orientation", this.orientation);
|
||||
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,12 @@ public class TileEntityRift extends TileEntity
|
|||
public int age = 0;
|
||||
|
||||
public HashMap<Integer, double[]> renderingCenters = new HashMap<Integer, double[]>();
|
||||
@SuppressWarnings("deprecation")
|
||||
public DimLink nearestRiftData;
|
||||
public int spawnedEndermenID=0;
|
||||
DataWatcher watcher = new DataWatcher();
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
//Invalidate this tile entity if it shouldn't exist
|
||||
|
@ -92,6 +94,7 @@ public class TileEntityRift extends TileEntity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
|
@ -143,7 +146,7 @@ public class TileEntityRift extends TileEntity
|
|||
if (random.nextInt(30) == 0)
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Entity> list = (List<Entity>) worldObj.getEntitiesWithinAABB(EntityEnderman.class,
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABB(EntityEnderman.class,
|
||||
AxisAlignedBB.getBoundingBox(xCoord - 9, yCoord - 3, zCoord - 9, xCoord + 9, yCoord + 3, zCoord + 9));
|
||||
|
||||
if (list.isEmpty())
|
||||
|
@ -183,7 +186,10 @@ public class TileEntityRift extends TileEntity
|
|||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
if (dimension.getLink(xCoord, yCoord, zCoord) != null)
|
||||
{
|
||||
dimension.deleteLink(xCoord, yCoord, zCoord);
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
dimension.deleteLink(xCoord, yCoord, zCoord);
|
||||
}
|
||||
worldObj.playSound(xCoord, yCoord, zCoord, "mods.DimDoors.sfx.riftClose", (float) .7, 1, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package StevenDimDoors.mod_pocketDim.tileentities;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityTransTrapdoor extends TileEntity
|
||||
{
|
||||
|
|
|
@ -2,8 +2,8 @@ package StevenDimDoors.mod_pocketDim.util;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
|
@ -21,14 +21,17 @@ public abstract class BaseConfigurationProcessor<T>
|
|||
return true;
|
||||
}
|
||||
|
||||
public T readFromFile(String path) throws FileNotFoundException, ConfigurationProcessingException
|
||||
public T readFromFile(String path) throws ConfigurationProcessingException, IOException
|
||||
{
|
||||
return readFromFile(new File(path));
|
||||
}
|
||||
|
||||
public T readFromFile(File file) throws FileNotFoundException, ConfigurationProcessingException
|
||||
public T readFromFile(File file) throws ConfigurationProcessingException, IOException
|
||||
{
|
||||
return readFromStream(new FileInputStream(file));
|
||||
FileInputStream t = new FileInputStream(file);
|
||||
T ret = readFromStream(t);
|
||||
t.close();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public T readFromResource(String resourcePath) throws ConfigurationProcessingException
|
||||
|
@ -38,12 +41,14 @@ public abstract class BaseConfigurationProcessor<T>
|
|||
|
||||
public abstract T readFromStream(InputStream inputStream) throws ConfigurationProcessingException;
|
||||
|
||||
public void writeToFile(File file, T data) throws FileNotFoundException, ConfigurationProcessingException
|
||||
public void writeToFile(File file, T data) throws ConfigurationProcessingException, IOException
|
||||
{
|
||||
writeToStream(new FileOutputStream(file), data);
|
||||
FileOutputStream t = new FileOutputStream(file);
|
||||
writeToStream(t, data);
|
||||
t.close();
|
||||
}
|
||||
|
||||
public void writeToFile(String path, T data) throws FileNotFoundException, ConfigurationProcessingException
|
||||
public void writeToFile(String path, T data) throws ConfigurationProcessingException, IOException
|
||||
{
|
||||
writeToFile(new File(path), data);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ public class WeightedContainer<T> extends WeightedRandomItem {
|
|||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeightedContainer<T> clone()
|
||||
{
|
||||
return new WeightedContainer<T>(data, itemWeight);
|
||||
|
|
|
@ -9,30 +9,30 @@ import StevenDimDoors.mod_pocketDim.util.Point4D;
|
|||
|
||||
public class ClientLinkData
|
||||
{
|
||||
public Point4D point;
|
||||
public int orientation;
|
||||
|
||||
public ClientLinkData(DimLink link)
|
||||
{
|
||||
this.point= link.source();
|
||||
this.orientation=link.orientation();
|
||||
}
|
||||
|
||||
public ClientLinkData(Point4D point, int orientation)
|
||||
{
|
||||
this.point = point;
|
||||
this.orientation=orientation;
|
||||
}
|
||||
|
||||
public void write(DataOutputStream output) throws IOException
|
||||
{
|
||||
Point4D.write(point, output);
|
||||
output.writeInt(orientation);
|
||||
}
|
||||
|
||||
public static ClientLinkData read(DataInputStream input) throws IOException
|
||||
{
|
||||
return new ClientLinkData(Point4D.read(input), input.readInt());
|
||||
}
|
||||
|
||||
public Point4D point;
|
||||
public int orientation;
|
||||
|
||||
public ClientLinkData(DimLink link)
|
||||
{
|
||||
this.point= link.source();
|
||||
this.orientation=link.orientation();
|
||||
}
|
||||
|
||||
public ClientLinkData(Point4D point, int orientation)
|
||||
{
|
||||
this.point = point;
|
||||
this.orientation=orientation;
|
||||
}
|
||||
|
||||
public void write(DataOutputStream output) throws IOException
|
||||
{
|
||||
Point4D.write(point, output);
|
||||
output.writeInt(orientation);
|
||||
}
|
||||
|
||||
public static ClientLinkData read(DataInputStream input) throws IOException
|
||||
{
|
||||
return new ClientLinkData(Point4D.read(input), input.readInt());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ public class BiomeGenLimbo extends BiomeGenBase
|
|||
|
||||
}
|
||||
|
||||
public float getSpawningChance()
|
||||
@Override
|
||||
public float getSpawningChance()
|
||||
{
|
||||
return 0.00001F;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ public class CustomCaveGen extends MapGenBase
|
|||
*/
|
||||
protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
|
||||
{
|
||||
double var19 = (double)(par3 * 16 + 8);
|
||||
double var21 = (double)(par4 * 16 + 8);
|
||||
double var19 = par3 * 16 + 8;
|
||||
double var21 = par4 * 16 + 8;
|
||||
float var23 = 0.0F;
|
||||
float var24 = 0.0F;
|
||||
Random var25 = new Random(par1);
|
||||
|
@ -55,13 +55,13 @@ public class CustomCaveGen extends MapGenBase
|
|||
|
||||
for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15)
|
||||
{
|
||||
double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F);
|
||||
double var29 = 1.5D + MathHelper.sin(par15 * (float)Math.PI / par16) * par12 * 1.0F;
|
||||
double var31 = var29 * par17;
|
||||
float var33 = MathHelper.cos(par14);
|
||||
float var34 = MathHelper.sin(par14);
|
||||
par6 += (double)(MathHelper.cos(par13) * var33);
|
||||
par8 += (double)var34;
|
||||
par10 += (double)(MathHelper.sin(par13) * var33);
|
||||
par6 += MathHelper.cos(par13) * var33;
|
||||
par8 += var34;
|
||||
par10 += MathHelper.sin(par13) * var33;
|
||||
|
||||
if (var28)
|
||||
{
|
||||
|
@ -90,8 +90,8 @@ public class CustomCaveGen extends MapGenBase
|
|||
{
|
||||
double var35 = par6 - var19;
|
||||
double var37 = par10 - var21;
|
||||
double var39 = (double)(par16 - par15);
|
||||
double var41 = (double)(par12 + 2.0F + 16.0F);
|
||||
double var39 = par16 - par15;
|
||||
double var41 = par12 + 2.0F + 16.0F;
|
||||
|
||||
if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41)
|
||||
{
|
||||
|
@ -169,11 +169,11 @@ public class CustomCaveGen extends MapGenBase
|
|||
{
|
||||
for (var42 = var55; var42 < var36; ++var42)
|
||||
{
|
||||
double var59 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29;
|
||||
double var59 = (var42 + par3 * 16 + 0.5D - par6) / var29;
|
||||
|
||||
for (var45 = var56; var45 < var40; ++var45)
|
||||
{
|
||||
double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29;
|
||||
double var46 = (var45 + par4 * 16 + 0.5D - par10) / var29;
|
||||
int var48 = (var42 * 16 + var45) * 128 + var38;
|
||||
boolean var49 = false;
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class CustomCaveGen extends MapGenBase
|
|||
{
|
||||
for (int var50 = var38 - 1; var50 >= var57; --var50)
|
||||
{
|
||||
double var51 = ((double)var50 + 0.5D - par8) / var31;
|
||||
double var51 = (var50 + 0.5D - par8) / var31;
|
||||
|
||||
if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D)
|
||||
{
|
||||
|
@ -229,7 +229,8 @@ public class CustomCaveGen extends MapGenBase
|
|||
/**
|
||||
* Recursively called by generate() (generate) and optionally by itself.
|
||||
*/
|
||||
protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
|
||||
@Override
|
||||
protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
|
||||
{
|
||||
int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
|
||||
|
||||
|
@ -240,9 +241,9 @@ public class CustomCaveGen extends MapGenBase
|
|||
|
||||
for (int var8 = 0; var8 < var7; ++var8)
|
||||
{
|
||||
double var9 = (double)(par2 * 16 + this.rand.nextInt(16));
|
||||
double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8);
|
||||
double var13 = (double)(par3 * 16 + this.rand.nextInt(16));
|
||||
double var9 = par2 * 16 + this.rand.nextInt(16);
|
||||
double var11 = this.rand.nextInt(this.rand.nextInt(120) + 8);
|
||||
double var13 = par3 * 16 + this.rand.nextInt(16);
|
||||
int var15 = 1;
|
||||
|
||||
if (this.rand.nextInt(4) == 0)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -9,23 +8,25 @@ import net.minecraft.client.renderer.GLAllocation;
|
|||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public class CustomSkyProvider extends IRenderHandler
|
||||
{
|
||||
|
||||
|
||||
int starGLCallList;
|
||||
int glSkyList;
|
||||
int glSkyList2;
|
||||
|
||||
|
||||
public String getMoonRenderPath()
|
||||
private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png");
|
||||
|
||||
|
||||
public ResourceLocation getMoonRenderPath()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getSunRenderPath()
|
||||
|
||||
public ResourceLocation getSunRenderPath()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -34,200 +35,199 @@ public class CustomSkyProvider extends IRenderHandler
|
|||
@Override
|
||||
public void render(float par1, WorldClient world, Minecraft mc)
|
||||
{
|
||||
|
||||
|
||||
starGLCallList = GLAllocation.generateDisplayLists(3);
|
||||
glSkyList = this.starGLCallList + 1;
|
||||
glSkyList2 = this.starGLCallList + 2;
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDepthMask(false);
|
||||
mc.renderEngine.bindTexture(new ResourceLocation("/misc/tunnel.png"));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, par1);
|
||||
float f1 = (float)vec3.xCoord;
|
||||
float f2 = (float)vec3.yCoord;
|
||||
float f3 = (float)vec3.zCoord;
|
||||
float f4;
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDepthMask(false);
|
||||
mc.renderEngine.bindTexture((locationEndSkyPng));
|
||||
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
float f5 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
|
||||
float f6 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
|
||||
f4 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
|
||||
f1 = f5;
|
||||
f2 = f6;
|
||||
f3 = f4;
|
||||
}
|
||||
if (mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, par1);
|
||||
float f1 = (float)vec3.xCoord;
|
||||
float f2 = (float)vec3.yCoord;
|
||||
float f3 = (float)vec3.zCoord;
|
||||
float f4;
|
||||
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
Tessellator tessellator1 = Tessellator.instance;
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
GL11.glCallList(this.glSkyList);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(par1), par1);
|
||||
float f7;
|
||||
float f8;
|
||||
float f9;
|
||||
float f10;
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
float f5 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
|
||||
float f6 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
|
||||
f4 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
|
||||
f1 = f5;
|
||||
f2 = f6;
|
||||
f3 = f4;
|
||||
}
|
||||
|
||||
if (afloat != null)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(par1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
f4 = afloat[0];
|
||||
f7 = afloat[1];
|
||||
f8 = afloat[2];
|
||||
float f11;
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
Tessellator tessellator1 = Tessellator.instance;
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
GL11.glCallList(this.glSkyList);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(par1), par1);
|
||||
float f7;
|
||||
float f8;
|
||||
float f9;
|
||||
float f10;
|
||||
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
f9 = (f4 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
|
||||
f10 = (f4 * 30.0F + f7 * 70.0F) / 100.0F;
|
||||
f11 = (f4 * 30.0F + f8 * 70.0F) / 100.0F;
|
||||
f4 = f9;
|
||||
f7 = f10;
|
||||
f8 = f11;
|
||||
}
|
||||
if (afloat != null)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(MathHelper.sin(world.getCelestialAngleRadians(par1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
|
||||
f4 = afloat[0];
|
||||
f7 = afloat[1];
|
||||
f8 = afloat[2];
|
||||
float f11;
|
||||
|
||||
tessellator1.startDrawing(6);
|
||||
tessellator1.setColorRGBA_F(f4, f7, f8, afloat[3]);
|
||||
tessellator1.addVertex(0.0D, 100.0D, 0.0D);
|
||||
byte b0 = 16;
|
||||
tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F);
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
f9 = (f4 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F;
|
||||
f10 = (f4 * 30.0F + f7 * 70.0F) / 100.0F;
|
||||
f11 = (f4 * 30.0F + f8 * 70.0F) / 100.0F;
|
||||
f4 = f9;
|
||||
f7 = f10;
|
||||
f8 = f11;
|
||||
}
|
||||
|
||||
for (int j = 0; j <= b0; ++j)
|
||||
{
|
||||
f11 = (float)j * (float)Math.PI * 2.0F / (float)b0;
|
||||
float f12 = MathHelper.sin(f11);
|
||||
float f13 = MathHelper.cos(f11);
|
||||
tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3]));
|
||||
}
|
||||
tessellator1.startDrawing(6);
|
||||
tessellator1.setColorRGBA_F(f4, f7, f8, afloat[3]);
|
||||
tessellator1.addVertex(0.0D, 100.0D, 0.0D);
|
||||
byte b0 = 16;
|
||||
tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F);
|
||||
|
||||
tessellator1.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
for (int j = 0; j <= b0; ++j)
|
||||
{
|
||||
f11 = j * (float)Math.PI * 2.0F / b0;
|
||||
float f12 = MathHelper.sin(f11);
|
||||
float f13 = MathHelper.cos(f11);
|
||||
tessellator1.addVertex(f12 * 120.0F, f13 * 120.0F, -f13 * 40.0F * afloat[3]);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glPushMatrix();
|
||||
f4 = 1.0F - world.getRainStrength(par1);
|
||||
f7 = 0.0F;
|
||||
f8 = 0.0F;
|
||||
f9 = 0.0F;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f4);
|
||||
GL11.glTranslatef(f7, f8, f9);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
f10 = 30.0F;
|
||||
mc.renderEngine.bindTexture(new ResourceLocation(this.getSunRenderPath()));
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D);
|
||||
tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D);
|
||||
tessellator1.draw();
|
||||
f10 = 20.0F;
|
||||
mc.renderEngine.bindTexture(new ResourceLocation(this.getMoonRenderPath()));
|
||||
int k = world.getMoonPhase();
|
||||
int l = k % 4;
|
||||
int i1 = k / 4 % 2;
|
||||
float f14 = (float)(l + 0) ;
|
||||
float f15 = (float)(i1 + 0);
|
||||
float f16 = (float)(l + 1) ;
|
||||
float f17 = (float)(i1 + 1);
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17);
|
||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17);
|
||||
tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15);
|
||||
tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15);
|
||||
tessellator1.draw();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
float f18 = world.getStarBrightness(par1) * f4;
|
||||
tessellator1.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
if (f18 > 0.0F)
|
||||
{
|
||||
GL11.glColor4f(f18, f18, f18, f18);
|
||||
GL11.glCallList(this.starGLCallList);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glPushMatrix();
|
||||
f4 = 1.0F - world.getRainStrength(par1);
|
||||
f7 = 0.0F;
|
||||
f8 = 0.0F;
|
||||
f9 = 0.0F;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, f4);
|
||||
GL11.glTranslatef(f7, f8, f9);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
f10 = 30.0F;
|
||||
mc.renderEngine.bindTexture(this.getSunRenderPath());
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((-f10), 100.0D, (-f10), 0.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV(f10, 100.0D, (-f10), 1.0D, 0.0D);
|
||||
tessellator1.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D);
|
||||
tessellator1.addVertexWithUV((-f10), 100.0D, f10, 0.0D, 1.0D);
|
||||
tessellator1.draw();
|
||||
f10 = 20.0F;
|
||||
mc.renderEngine.bindTexture(this.getMoonRenderPath());
|
||||
int k = world.getMoonPhase();
|
||||
int l = k % 4;
|
||||
int i1 = k / 4 % 2;
|
||||
float f14 = l + 0 ;
|
||||
float f15 = i1 + 0;
|
||||
float f16 = l + 1 ;
|
||||
float f17 = i1 + 1;
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.addVertexWithUV((-f10), -100.0D, f10, f16, f17);
|
||||
tessellator1.addVertexWithUV(f10, -100.0D, f10, f14, f17);
|
||||
tessellator1.addVertexWithUV(f10, -100.0D, (-f10), f14, f15);
|
||||
tessellator1.addVertexWithUV((-f10), -100.0D, (-f10), f16, f15);
|
||||
tessellator1.draw();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
float f18 = world.getStarBrightness(par1) * f4;
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(0.0F, 0.0F, 0.0F);
|
||||
double d0 = mc.thePlayer.getPosition(par1).yCoord - world.getHorizon();
|
||||
if (f18 > 0.0F)
|
||||
{
|
||||
GL11.glColor4f(f18, f18, f18, f18);
|
||||
GL11.glCallList(this.starGLCallList);
|
||||
}
|
||||
|
||||
if (d0 < 0.0D)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 12.0F, 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
f8 = 1.0F;
|
||||
f9 = -((float)(d0 + 65.0D));
|
||||
f10 = -f8;
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.setColorRGBA_I(0, 255);
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f9, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8));
|
||||
tessellator1.addVertex((double)(-f8), (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)f8);
|
||||
tessellator1.addVertex((double)f8, (double)f10, (double)(-f8));
|
||||
tessellator1.draw();
|
||||
}
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_FOG);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(0.0F, 0.0F, 0.0F);
|
||||
double d0 = mc.thePlayer.getPosition(par1).yCoord - world.getHorizon();
|
||||
|
||||
if (world.provider.isSkyColored())
|
||||
{
|
||||
GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
}
|
||||
if (d0 < 0.0D)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 12.0F, 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
f8 = 1.0F;
|
||||
f9 = -((float)(d0 + 65.0D));
|
||||
f10 = -f8;
|
||||
tessellator1.startDrawingQuads();
|
||||
tessellator1.setColorRGBA_I(0, 255);
|
||||
tessellator1.addVertex((-f8), f9, f8);
|
||||
tessellator1.addVertex(f8, f9, f8);
|
||||
tessellator1.addVertex(f8, f10, f8);
|
||||
tessellator1.addVertex((-f8), f10, f8);
|
||||
tessellator1.addVertex((-f8), f10, (-f8));
|
||||
tessellator1.addVertex(f8, f10, (-f8));
|
||||
tessellator1.addVertex(f8, f9, (-f8));
|
||||
tessellator1.addVertex((-f8), f9, (-f8));
|
||||
tessellator1.addVertex(f8, f10, (-f8));
|
||||
tessellator1.addVertex(f8, f10, f8);
|
||||
tessellator1.addVertex(f8, f9, f8);
|
||||
tessellator1.addVertex(f8, f9, (-f8));
|
||||
tessellator1.addVertex((-f8), f9, (-f8));
|
||||
tessellator1.addVertex((-f8), f9, f8);
|
||||
tessellator1.addVertex((-f8), f10, f8);
|
||||
tessellator1.addVertex((-f8), f10, (-f8));
|
||||
tessellator1.addVertex((-f8), f10, (-f8));
|
||||
tessellator1.addVertex((-f8), f10, f8);
|
||||
tessellator1.addVertex(f8, f10, f8);
|
||||
tessellator1.addVertex(f8, f10, (-f8));
|
||||
tessellator1.draw();
|
||||
}
|
||||
|
||||
if (world.provider.isSkyColored())
|
||||
{
|
||||
GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glColor3f(f1, f2, f3);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, -((float)(d0 - 16.0D)), 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, -((float)(d0 - 16.0D)), 0.0F);
|
||||
GL11.glCallList(this.glSkyList2);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -60,6 +60,7 @@ public class GatewayGenerator implements IWorldGenerator
|
|||
int attempts;
|
||||
int correction;
|
||||
boolean valid;
|
||||
@SuppressWarnings("deprecation")
|
||||
DimLink link;
|
||||
NewDimData dimension;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraftforge.event.terraingen.ChunkProviderEvent;
|
|||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||
|
||||
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
|
||||
public class LimboGenerator extends ChunkProviderGenerate
|
||||
{
|
||||
private static Random rand;
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
public Chunk provideChunk(int chunkX, int chunkZ)
|
||||
{
|
||||
//TODO: Wtf? Why do you reinitialize the seed when we already initialized it in the constructor?! ~SenseiKiwi
|
||||
LimboGenerator.rand.setSeed((long) chunkX * 341873128712L + (long) chunkZ * 132897987541L);
|
||||
LimboGenerator.rand.setSeed(chunkX * 341873128712L + chunkZ * 132897987541L);
|
||||
byte[] var3 = new byte[32768];
|
||||
this.generateTerrain(chunkX, chunkZ, var3);
|
||||
Chunk var4 = new Chunk(this.worldObj, var3, chunkX, chunkZ);
|
||||
|
@ -178,7 +178,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
{
|
||||
for (int var9 = -2; var9 <= 2; ++var9)
|
||||
{
|
||||
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
|
||||
float var10 = 10.0F / MathHelper.sqrt_float(var8 * var8 + var9 * var9 + 0.2F);
|
||||
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
||||
}
|
||||
}
|
||||
|
@ -191,8 +191,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
||||
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||
boolean var43 = false;
|
||||
boolean var42 = false;
|
||||
|
||||
int var12 = 0;
|
||||
int var13 = 0;
|
||||
|
||||
|
@ -204,7 +203,6 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
float var17 = 0.0F;
|
||||
float var18 = 0.0F;
|
||||
byte var19 = 2;
|
||||
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
|
||||
|
||||
for (int var21 = -var19; var21 <= var19; ++var21)
|
||||
{
|
||||
|
@ -260,13 +258,13 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
|
||||
for (int var46 = 0; var46 < par6; ++var46)
|
||||
{
|
||||
double var48 = (double)var17;
|
||||
double var26 = (double)var16;
|
||||
double var48 = var17;
|
||||
double var26 = var16;
|
||||
var48 += var47 * 0.2D;
|
||||
var48 = var48 * (double)par6 / 16.0D;
|
||||
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
|
||||
var48 = var48 * par6 / 16.0D;
|
||||
double var28 = par6 / 2.0D + var48 * 4.0D;
|
||||
double var30 = 0.0D;
|
||||
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
||||
double var32 = (var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
||||
|
||||
if (var32 < 0.0D)
|
||||
{
|
||||
|
@ -294,7 +292,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
|
||||
if (var46 > par6 - 4)
|
||||
{
|
||||
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
|
||||
double var40 = (var46 - (par6 - 4)) / 3.0F;
|
||||
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
||||
}
|
||||
|
||||
|
@ -306,6 +304,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||
|
||||
return par1ArrayOfDouble;
|
||||
}
|
||||
@Override
|
||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
||||
{
|
||||
byte var4 = 4;
|
||||
|
|
|
@ -37,6 +37,7 @@ public class LimboProvider extends WorldProvider
|
|||
this.properties = mod_pocketDim.properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IRenderHandler getSkyRenderer()
|
||||
{
|
||||
|
@ -55,11 +56,13 @@ public class LimboProvider extends WorldProvider
|
|||
return mod_pocketDim.limboBiome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRespawnHere()
|
||||
{
|
||||
return properties.HardcoreLimboEnabled && properties.LimboEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockHighHumidity(int x, int y, int z)
|
||||
{
|
||||
return false;
|
||||
|
@ -79,22 +82,24 @@ public class LimboProvider extends WorldProvider
|
|||
|
||||
for (int steps = 0; steps <= 15; ++steps)
|
||||
{
|
||||
float var3 = 1.0F - (float)steps / 15.0F;
|
||||
float var3 = 1.0F - steps / 15.0F;
|
||||
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getSpawnPoint()
|
||||
{
|
||||
|
||||
return this.getRandomizedSpawnPoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle(long par1, float par3)
|
||||
{
|
||||
int var4 = (int)(par1 % 24000L);
|
||||
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
|
||||
float var5 = (var4 + par3) / 24000.0F - 0.25F;
|
||||
|
||||
if (var5 < 0.0F)
|
||||
{
|
||||
|
@ -107,7 +112,7 @@ public class LimboProvider extends WorldProvider
|
|||
}
|
||||
|
||||
float var6 = var5;
|
||||
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
|
||||
var5 = 1.0F - (float)((Math.cos(var5 * Math.PI) + 1.0D) / 2.0D);
|
||||
var5 = var6 + (var5 - var6) / 3.0F;
|
||||
return 0;
|
||||
}
|
||||
|
@ -125,6 +130,7 @@ public class LimboProvider extends WorldProvider
|
|||
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCoordinateBeSpawn(int par1, int par2)
|
||||
{
|
||||
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
||||
|
@ -135,19 +141,21 @@ public class LimboProvider extends WorldProvider
|
|||
{
|
||||
return worldObj.getHeight()/4-800;
|
||||
}
|
||||
@Override
|
||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
||||
{
|
||||
setCloudRenderer( new CloudRenderBlank());
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0);
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Vec3 getFogColor(float par1, float par2)
|
||||
{
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool(.2, .2, .2);
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getRespawnDimension(EntityPlayerMP player)
|
||||
{
|
||||
return 0;
|
||||
|
@ -160,6 +168,7 @@ public class LimboProvider extends WorldProvider
|
|||
return new LimboGenerator(worldObj, 45, spawner, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -1,27 +1,18 @@
|
|||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LimboSkyProvider extends CustomSkyProvider
|
||||
{
|
||||
@Override
|
||||
public String getMoonRenderPath()
|
||||
public ResourceLocation getMoonRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/limboMoon.png";
|
||||
return new ResourceLocation("DimDoors:textures/other/limboMoon.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSunRenderPath()
|
||||
public ResourceLocation getSunRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/limboSun.png";
|
||||
return new ResourceLocation("DimDoors:textures/other/limboSun.png");
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@ package StevenDimDoors.mod_pocketDim.world;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
@ -11,7 +10,6 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
|||
import net.minecraftforge.common.DimensionManager;
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.DimensionalDoor;
|
||||
import StevenDimDoors.mod_pocketDim.blocks.IDimDoor;
|
||||
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
||||
|
@ -25,9 +23,9 @@ import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
|||
import StevenDimDoors.mod_pocketDim.schematic.BlockRotator;
|
||||
import StevenDimDoors.mod_pocketDim.util.Pair;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
import StevenDimDoors.mod_pocketDim.items.BaseItemDoor;
|
||||
import StevenDimDoors.mod_pocketDim.items.ItemDimensionalDoor;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PocketBuilder
|
||||
{
|
||||
public static final int MIN_POCKET_SIZE = 5;
|
||||
|
@ -51,6 +49,7 @@ public class PocketBuilder
|
|||
* @param properties
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static boolean regenerateDungeonPocket(NewDimData dimension, DimLink linkIn, DDProperties properties)
|
||||
{
|
||||
if (linkIn == null)
|
||||
|
@ -79,6 +78,7 @@ public class PocketBuilder
|
|||
dimension.createLink(oldLinkPos, LinkTypes.SAFE_EXIT, (orientation+2)%4);
|
||||
return false;
|
||||
}
|
||||
@SuppressWarnings("unused") // ?
|
||||
NewDimData parent = PocketManager.getDimensionData(incomingLink.source().getDimension());
|
||||
|
||||
if (!dimension.isDungeon())
|
||||
|
@ -120,126 +120,127 @@ public class PocketBuilder
|
|||
}
|
||||
|
||||
private static boolean buildDungeonPocket(DungeonData dungeon, NewDimData dimension, DimLink link, DungeonSchematic schematic,World world, DDProperties properties)
|
||||
{
|
||||
{
|
||||
|
||||
//Calculate the destination point
|
||||
DungeonPackConfig packConfig = dungeon.dungeonType().Owner != null ? dungeon.dungeonType().Owner.getConfig() : null;
|
||||
Point4D source = link.source();
|
||||
int orientation = link.orientation();
|
||||
Point3D destination;
|
||||
|
||||
if (packConfig != null && packConfig.doDistortDoorCoordinates())
|
||||
{
|
||||
destination = calculateNoisyDestination(source, dimension, dungeon, orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
destination = new Point3D(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
|
||||
destination.setY( yCoordHelper.adjustDestinationY(destination.getY(), world.getHeight(), schematic.getEntranceDoorLocation().getY(), schematic.getHeight()) );
|
||||
|
||||
//Generate the dungeon
|
||||
schematic.copyToWorld(world, destination, orientation, link, random);
|
||||
|
||||
//Finish up destination initialization
|
||||
dimension.initializeDungeon(destination.getX(), destination.getY(), destination.getZ(), orientation, link, dungeon);
|
||||
dimension.setFilled(true);
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static boolean generateSelectedDungeonPocket(DimLink link, DDProperties properties,DungeonData data)
|
||||
{
|
||||
if (link == null)
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot be null.");
|
||||
}
|
||||
if (properties == null)
|
||||
{
|
||||
throw new IllegalArgumentException("properties cannot be null.");
|
||||
}
|
||||
|
||||
if (link.hasDestination())
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot have a destination assigned already.");
|
||||
}
|
||||
|
||||
//Calculate the destination point
|
||||
DungeonPackConfig packConfig = dungeon.dungeonType().Owner != null ? dungeon.dungeonType().Owner.getConfig() : null;
|
||||
Point4D source = link.source();
|
||||
int orientation = link.orientation();
|
||||
Point3D destination;
|
||||
|
||||
if (packConfig != null && packConfig.doDistortDoorCoordinates())
|
||||
{
|
||||
destination = calculateNoisyDestination(source, dimension, dungeon, orientation);
|
||||
}
|
||||
else
|
||||
{
|
||||
destination = new Point3D(source.getX(), source.getY(), source.getZ());
|
||||
}
|
||||
|
||||
destination.setY( yCoordHelper.adjustDestinationY(destination.getY(), world.getHeight(), schematic.getEntranceDoorLocation().getY(), schematic.getHeight()) );
|
||||
|
||||
//Generate the dungeon
|
||||
schematic.copyToWorld(world, destination, orientation, link, random);
|
||||
|
||||
//Finish up destination initialization
|
||||
dimension.initializeDungeon(destination.getX(), destination.getY(), destination.getZ(), orientation, link, dungeon);
|
||||
dimension.setFilled(true);
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static boolean generateSelectedDungeonPocket(DimLink link, DDProperties properties,DungeonData data)
|
||||
{
|
||||
if (link == null)
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot be null.");
|
||||
}
|
||||
if (properties == null)
|
||||
{
|
||||
throw new IllegalArgumentException("properties cannot be null.");
|
||||
}
|
||||
|
||||
if (link.hasDestination())
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot have a destination assigned already.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Register a new dimension
|
||||
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
||||
NewDimData dimension = PocketManager.registerPocket(parent, true);
|
||||
|
||||
//Load a world
|
||||
World world = PocketManager.loadDimension(dimension.id());
|
||||
|
||||
if (world == null || world.provider == null)
|
||||
{
|
||||
System.err.println("Could not initialize dimension for a dungeon!");
|
||||
return false;
|
||||
}
|
||||
|
||||
DungeonData dungeon = null;
|
||||
DungeonSchematic schematic = null;
|
||||
|
||||
//Register a new dimension
|
||||
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
||||
NewDimData dimension = PocketManager.registerPocket(parent, true);
|
||||
|
||||
//Load a world
|
||||
World world = PocketManager.loadDimension(dimension.id());
|
||||
|
||||
if (world == null || world.provider == null)
|
||||
{
|
||||
System.err.println("Could not initialize dimension for a dungeon!");
|
||||
return false;
|
||||
}
|
||||
|
||||
DungeonData dungeon = null;
|
||||
DungeonSchematic schematic = null;
|
||||
|
||||
dungeon = data;
|
||||
if (data == null)
|
||||
{
|
||||
System.err.println("Could not select a dungeon for generation!");
|
||||
return false;
|
||||
}
|
||||
schematic = loadAndValidateDungeon(dungeon,properties);
|
||||
|
||||
return PocketBuilder.buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static boolean generateNewDungeonPocket(DimLink link, DDProperties properties)
|
||||
{
|
||||
if (link == null)
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot be null.");
|
||||
}
|
||||
if (properties == null)
|
||||
{
|
||||
throw new IllegalArgumentException("properties cannot be null.");
|
||||
}
|
||||
|
||||
if (link.hasDestination())
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot have a destination assigned already.");
|
||||
}
|
||||
|
||||
dungeon = data;
|
||||
if (data == null)
|
||||
{
|
||||
System.err.println("Could not select a dungeon for generation!");
|
||||
return false;
|
||||
}
|
||||
schematic = loadAndValidateDungeon(dungeon,properties);
|
||||
|
||||
return PocketBuilder.buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static boolean generateNewDungeonPocket(DimLink link, DDProperties properties)
|
||||
{
|
||||
if (link == null)
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot be null.");
|
||||
}
|
||||
if (properties == null)
|
||||
{
|
||||
throw new IllegalArgumentException("properties cannot be null.");
|
||||
}
|
||||
|
||||
if (link.hasDestination())
|
||||
{
|
||||
throw new IllegalArgumentException("link cannot have a destination assigned already.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Register a new dimension
|
||||
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
||||
NewDimData dimension = PocketManager.registerPocket(parent, true);
|
||||
|
||||
//Load a world
|
||||
World world = PocketManager.loadDimension(dimension.id());
|
||||
|
||||
if (world == null || world.provider == null)
|
||||
{
|
||||
System.err.println("Could not initialize dimension for a dungeon!");
|
||||
return false;
|
||||
}
|
||||
|
||||
//Choose a dungeon to generate
|
||||
Pair<DungeonData, DungeonSchematic> pair = selectDungeon(dimension, random, properties);
|
||||
if (pair == null)
|
||||
{
|
||||
System.err.println("Could not select a dungeon for generation!");
|
||||
return false;
|
||||
}
|
||||
DungeonData dungeon = pair.getFirst();
|
||||
DungeonSchematic schematic = pair.getSecond();
|
||||
|
||||
return buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
||||
}
|
||||
|
||||
//Register a new dimension
|
||||
NewDimData parent = PocketManager.getDimensionData(link.source().getDimension());
|
||||
NewDimData dimension = PocketManager.registerPocket(parent, true);
|
||||
|
||||
//Load a world
|
||||
World world = PocketManager.loadDimension(dimension.id());
|
||||
|
||||
if (world == null || world.provider == null)
|
||||
{
|
||||
System.err.println("Could not initialize dimension for a dungeon!");
|
||||
return false;
|
||||
}
|
||||
|
||||
//Choose a dungeon to generate
|
||||
Pair<DungeonData, DungeonSchematic> pair = selectDungeon(dimension, random, properties);
|
||||
if (pair == null)
|
||||
{
|
||||
System.err.println("Could not select a dungeon for generation!");
|
||||
return false;
|
||||
}
|
||||
DungeonData dungeon = pair.getFirst();
|
||||
DungeonSchematic schematic = pair.getSecond();
|
||||
|
||||
return buildDungeonPocket(dungeon, dimension, link, schematic, world, properties);
|
||||
}
|
||||
|
||||
|
||||
private static Point3D calculateNoisyDestination(Point4D source, NewDimData dimension, DungeonData dungeon, int orientation)
|
||||
{
|
||||
|
@ -424,7 +425,7 @@ public class PocketBuilder
|
|||
int orientation = getDoorOrientation(source, properties);
|
||||
|
||||
//Place a link leading back out of the pocket
|
||||
DimLink reverseLink = dimension.createLink(source.getX(), destinationY, source.getZ(), LinkTypes.REVERSE,(link.orientation()+2)%4);
|
||||
DimLink reverseLink = dimension.createLink(source.getX(), destinationY, source.getZ(), LinkTypes.REVERSE,(link.orientation()+2)%4);
|
||||
parent.setDestination(reverseLink, source.getX(), source.getY(), source.getZ());
|
||||
|
||||
//Build the actual pocket area
|
||||
|
|
|
@ -12,7 +12,7 @@ import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||
|
||||
public class PocketGenerator extends ChunkProviderGenerate implements IChunkProvider
|
||||
public class PocketGenerator extends ChunkProviderGenerate
|
||||
{
|
||||
private World worldObj;
|
||||
|
||||
|
@ -32,6 +32,7 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unloadQueuedChunks()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -20,6 +20,7 @@ public class PocketProvider extends WorldProvider
|
|||
{
|
||||
private DDProperties properties;
|
||||
private MonolithSpawner spawner;
|
||||
@SuppressWarnings("unused") // ?
|
||||
private IRenderHandler skyRenderer;
|
||||
|
||||
public PocketProvider()
|
||||
|
@ -47,14 +48,14 @@ public class PocketProvider extends WorldProvider
|
|||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
||||
{
|
||||
setCloudRenderer( new CloudRenderBlank());
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool(0d, 0d, 0d);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public Vec3 getFogColor(float par1, float par2)
|
||||
{
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
||||
return this.worldObj.getWorldVec3Pool().getVecFromPool(0d, 0d, 0d);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,31 +1,18 @@
|
|||
package StevenDimDoors.mod_pocketDim.world;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PocketSkyProvider extends CustomSkyProvider
|
||||
{
|
||||
|
||||
public class LimboSkyProvider extends CustomSkyProvider
|
||||
@Override
|
||||
public ResourceLocation getMoonRenderPath()
|
||||
{
|
||||
@Override
|
||||
public String getMoonRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/pocketMoon.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSunRenderPath()
|
||||
{
|
||||
return "/mods/DimDoors/textures/other/pocketSun.png";
|
||||
}
|
||||
return new ResourceLocation("DimDoors:textures/other/limboMoon.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getSunRenderPath()
|
||||
{
|
||||
return new ResourceLocation("DimDoors:textures/other/limboSun.png");
|
||||
}
|
||||
}
|
|
@ -1,11 +1,5 @@
|
|||
package StevenDimDoors.mod_pocketDimClient;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
import StevenDimDoors.mod_pocketDim.PacketConstants;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||
|
@ -13,10 +7,17 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientDimData;
|
|||
import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateSource;
|
||||
import StevenDimDoors.mod_pocketDim.watcher.IUpdateWatcher;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.IPacketHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.server.integrated.IntegratedServer;
|
||||
|
||||
public class ClientPacketHandler implements IPacketHandler, IUpdateSource
|
||||
{
|
||||
|
|
|
@ -46,25 +46,26 @@ public class ClosingRiftFX extends EntityFX
|
|||
|
||||
public void func_92044_a(int par1)
|
||||
{
|
||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||
float var5 = 1.0F;
|
||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||
}
|
||||
|
||||
public void func_92046_g(int par1)
|
||||
{
|
||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92053_aD = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the bounding box for this entity
|
||||
*/
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -72,12 +73,14 @@ public class ClosingRiftFX extends EntityFX
|
|||
/**
|
||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||
*/
|
||||
public boolean canBePushed()
|
||||
@Override
|
||||
public boolean canBePushed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
@Override
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||
{
|
||||
|
@ -87,14 +90,14 @@ public class ClosingRiftFX extends EntityFX
|
|||
|
||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
float var8 = (float)(super.particleTextureIndexX % 16) / 16.0F;
|
||||
float var8 = super.particleTextureIndexX % 16 / 16.0F;
|
||||
float var9 = var8 + 0.0624375F;
|
||||
float var10 = (float)(this.particleTextureIndexX / 16) / 16.0F;
|
||||
float var10 = this.particleTextureIndexX / 16 / 16.0F;
|
||||
float var11 = var10 + 0.0624375F;
|
||||
float var12 = 0.1F * this.particleScale;
|
||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
float var16 = 0.8F;
|
||||
|
||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||
|
@ -104,16 +107,17 @@ public class ClosingRiftFX extends EntityFX
|
|||
|
||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
||||
|
||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
||||
par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11);
|
||||
par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10);
|
||||
par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10);
|
||||
par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
|
@ -126,7 +130,7 @@ public class ClosingRiftFX extends EntityFX
|
|||
|
||||
if (this.particleAge > this.particleMaxAge / 2)
|
||||
{
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||
|
||||
if (this.field_92053_aD)
|
||||
{
|
||||
|
@ -168,7 +172,8 @@ public class ClosingRiftFX extends EntityFX
|
|||
}
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float par1)
|
||||
@Override
|
||||
public int getBrightnessForRender(float par1)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
@ -176,7 +181,8 @@ public class ClosingRiftFX extends EntityFX
|
|||
/**
|
||||
* Gets how bright this entity is.
|
||||
*/
|
||||
public float getBrightness(float par1)
|
||||
@Override
|
||||
public float getBrightness(float par1)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
this.particleMaxAge = 30 + this.rand.nextInt(16);
|
||||
this.noClip = true;
|
||||
}
|
||||
@Override
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||
|
@ -43,14 +44,14 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
|
||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
float var8 = (float)(super.particleTextureIndexX % 16) / 16.0F;
|
||||
float var8 = super.particleTextureIndexX % 16 / 16.0F;
|
||||
float var9 = var8 + 0.0624375F;
|
||||
float var10 = (float)(this.particleTextureIndexX / 16) / 16.0F;
|
||||
float var10 = this.particleTextureIndexX / 16 / 16.0F;
|
||||
float var11 = var10 + 0.0624375F;
|
||||
float var12 = 0.1F * this.particleScale;
|
||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
||||
float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
float var16 = .0F;
|
||||
|
||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||
|
@ -60,10 +61,10 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
|
||||
par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, (float) .7);
|
||||
|
||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10);
|
||||
par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11);
|
||||
par1Tessellator.addVertexWithUV(var13 - par3 * var12 - par6 * var12, var14 - par4 * var12, var15 - par5 * var12 - par7 * var12, var9, var11);
|
||||
par1Tessellator.addVertexWithUV(var13 - par3 * var12 + par6 * var12, var14 + par4 * var12, var15 - par5 * var12 + par7 * var12, var9, var10);
|
||||
par1Tessellator.addVertexWithUV(var13 + par3 * var12 + par6 * var12, var14 + par4 * var12, var15 + par5 * var12 + par7 * var12, var8, var10);
|
||||
par1Tessellator.addVertexWithUV(var13 + par3 * var12 - par6 * var12, var14 - par4 * var12, var15 + par5 * var12 - par7 * var12, var8, var11);
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,25 +80,26 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
|
||||
public void func_92044_a(int par1)
|
||||
{
|
||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||
float var5 = 1.0F;
|
||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||
}
|
||||
|
||||
public void func_92046_g(int par1)
|
||||
{
|
||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92053_aD = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the bounding box for this entity
|
||||
*/
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -105,7 +107,8 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
/**
|
||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||
*/
|
||||
public boolean canBePushed()
|
||||
@Override
|
||||
public boolean canBePushed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -115,7 +118,8 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
|
@ -128,7 +132,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
|
||||
if (this.particleAge > this.particleMaxAge / 2)
|
||||
{
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||
|
||||
if (this.field_92053_aD)
|
||||
{
|
||||
|
@ -170,7 +174,8 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
}
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float par1)
|
||||
@Override
|
||||
public int getBrightnessForRender(float par1)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
@ -178,7 +183,8 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||
/**
|
||||
* Gets how bright this entity is.
|
||||
*/
|
||||
public float getBrightness(float par1)
|
||||
@Override
|
||||
public float getBrightness(float par1)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.client.renderer.ActiveRenderInfo;
|
|||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
|
@ -22,6 +22,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class RenderDimDoor extends TileEntitySpecialRenderer
|
||||
{
|
||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||
private ResourceLocation riftPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/RIFT.png");
|
||||
private ResourceLocation warpPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/WARP.png");
|
||||
|
||||
public RenderDimDoor()
|
||||
{
|
||||
|
@ -60,13 +62,14 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||
for (int count = 0; count < 16; ++count)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float var15 = (float) (16 - count);
|
||||
float var15 = 16 - count;
|
||||
float var16 = 0.2625F;
|
||||
float var17 = 1.0F / (var15 + .80F);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
this.bindTexture(new ResourceLocation("/RIFT.png"));
|
||||
this.bindTexture(riftPath);
|
||||
// move files into assets/modid and change to new ResourceLocation(modid:/RIFT.png)
|
||||
var17 = 0.1F;
|
||||
var15 = 25.0F;
|
||||
var16 = 0.125F;
|
||||
|
@ -76,7 +79,8 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||
|
||||
if (count == 1)
|
||||
{
|
||||
this.bindTexture(new ResourceLocation("/WARP.png"));
|
||||
this.bindTexture(warpPath);
|
||||
// move files into assets/modid and change to new ResourceLocation(modid:/WARP.png)
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
var16 = .5F;
|
||||
|
@ -99,14 +103,14 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||
**/
|
||||
|
||||
GL11.glTranslatef(
|
||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F,
|
||||
Minecraft.getSystemTime() % 200000L / 200000.0F,
|
||||
0, 0.0F);
|
||||
GL11.glTranslatef(0,
|
||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F,
|
||||
Minecraft.getSystemTime() % 200000L / 200000.0F,
|
||||
0.0F);
|
||||
|
||||
GL11.glTranslatef(0, 0,
|
||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
||||
Minecraft.getSystemTime() % 200000L / 200000.0F);
|
||||
|
||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE,
|
||||
GL11.GL_OBJECT_LINEAR);
|
||||
|
@ -173,11 +177,11 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||
GL11.glPushMatrix();
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F,
|
||||
(float) (Minecraft.getSystemTime() % 200000L) / 200000.0F
|
||||
Minecraft.getSystemTime() % 200000L / 200000.0F
|
||||
* var15, 0.0F);
|
||||
GL11.glScalef(var16, var16, var16);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef((float) (count * count * 4321 + count * 9) * 2.0F,
|
||||
GL11.glRotatef((count * count * 4321 + count * 9) * 2.0F,
|
||||
0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
|
|
|
@ -1,28 +1,30 @@
|
|||
package StevenDimDoors.mod_pocketDimClient;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderMobObelisk extends RenderLiving
|
||||
{
|
||||
protected ModelMobObelisk obeliskModel;
|
||||
protected ModelMobObelisk obeliskModel;
|
||||
|
||||
public RenderMobObelisk(float f)
|
||||
{
|
||||
super(new ModelMobObelisk(), f);
|
||||
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
||||
}
|
||||
|
||||
|
||||
public RenderMobObelisk(float f)
|
||||
{
|
||||
super(new ModelMobObelisk(), f);
|
||||
this.obeliskModel = (ModelMobObelisk)this.mainModel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getEntityTexture(Entity entity) {
|
||||
int watchByte = entity.getDataWatcher().getWatchableObjectByte(16);
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
byte b0 = entity.getDataWatcher().getWatchableObjectByte(16);
|
||||
|
||||
return new ResourceLocation("/mods/DimDoors/textures/mobs/Monolith"+watchByte+".png");
|
||||
return new ResourceLocation(mod_pocketDim.modid+":textures/mobs/Monolith"+b0+".png");
|
||||
}
|
||||
}
|
|
@ -7,8 +7,8 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
|
@ -23,6 +23,9 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||
{
|
||||
private FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||
private static DDProperties properties = null;
|
||||
private ResourceLocation riftPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/RIFT.png");
|
||||
private ResourceLocation warpPath= new ResourceLocation(mod_pocketDim.modid+":textures/other/WARP.png");
|
||||
|
||||
|
||||
public RenderTransTrapdoor()
|
||||
{
|
||||
|
@ -57,13 +60,13 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||
for (int count = 0; count < 16; ++count)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float var15 = (float)(16 - count);
|
||||
float var15 = 16 - count;
|
||||
float var16 = 0.2625F;
|
||||
float var17 = 1.0F / (var15 + 1.0F);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
this.bindTexture(new ResourceLocation("/RIFT.png"));
|
||||
this.bindTexture(riftPath);
|
||||
var17 = 0.1F;
|
||||
var15 = 25.0F;
|
||||
var16 = 0.125F;
|
||||
|
@ -73,16 +76,17 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||
|
||||
if (count == 1)
|
||||
{
|
||||
this.bindTexture(new ResourceLocation("/WARP.png"));
|
||||
this.bindTexture(warpPath);
|
||||
// move files into assets/modid and change to new ResourceLocation(modid:/WARP.png)
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
var16 = .5F;
|
||||
}
|
||||
|
||||
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
||||
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
||||
GL11.glTranslatef( Minecraft.getSystemTime() % 200000L / 200000.0F,0, 0.0F);
|
||||
GL11.glTranslatef(0, Minecraft.getSystemTime() % 200000L / 200000.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
||||
GL11.glTranslatef(0,0, Minecraft.getSystemTime() % 200000L / 200000.0F);
|
||||
|
||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||
|
@ -103,10 +107,10 @@ public class RenderTransTrapdoor extends TileEntitySpecialRenderer
|
|||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
||||
GL11.glTranslatef(0.0F, Minecraft.getSystemTime() % 200000L / 200000.0F*var15, 0.0F);
|
||||
GL11.glScalef(var16, var16, var16);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef((count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
GL11.glBegin(GL11.GL_QUADS);
|
||||
|
|
|
@ -46,25 +46,26 @@ public class RiftFX extends EntityFX
|
|||
|
||||
public void func_92044_a(int par1)
|
||||
{
|
||||
float var2 = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
float var2 = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
float var3 = ((par1 & 65280) >> 8) / 255.0F;
|
||||
float var4 = ((par1 & 255) >> 0) / 255.0F;
|
||||
float var5 = 1.0F;
|
||||
this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5);
|
||||
}
|
||||
|
||||
public void func_92046_g(int par1)
|
||||
{
|
||||
this.field_92050_aA = (float)((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = (float)((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = (float)((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92050_aA = ((par1 & 16711680) >> 16) / 255.0F;
|
||||
this.field_92051_aB = ((par1 & 65280) >> 8) / 255.0F;
|
||||
this.field_92052_aC = ((par1 & 255) >> 0) / 255.0F;
|
||||
this.field_92053_aD = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the bounding box for this entity
|
||||
*/
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -72,12 +73,14 @@ public class RiftFX extends EntityFX
|
|||
/**
|
||||
* Returns true if this entity should push and be pushed by other entities when colliding.
|
||||
*/
|
||||
public boolean canBePushed()
|
||||
@Override
|
||||
public boolean canBePushed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
@Override
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0)
|
||||
{
|
||||
|
@ -89,9 +92,9 @@ public class RiftFX extends EntityFX
|
|||
|
||||
public void doRenderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
float f6 = (float)this.particleTextureIndexX / 16.0F;
|
||||
float f6 = this.particleTextureIndexX / 16.0F;
|
||||
float f7 = f6 + 0.0624375F;
|
||||
float f8 = (float)this.particleTextureIndexY / 16.0F;
|
||||
float f8 = this.particleTextureIndexY / 16.0F;
|
||||
float f9 = f8 + 0.0624375F;
|
||||
float f10 = 0.1F * this.particleScale;
|
||||
|
||||
|
@ -103,9 +106,9 @@ public class RiftFX extends EntityFX
|
|||
f9 = this.particleIcon.getMaxV();
|
||||
}
|
||||
|
||||
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
|
||||
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
|
||||
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
|
||||
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
|
||||
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY);
|
||||
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ);
|
||||
float f14 = 0F;
|
||||
|
||||
if (PocketManager.getDimensionData(worldObj).isPocketDimension())
|
||||
|
@ -114,16 +117,17 @@ public class RiftFX extends EntityFX
|
|||
}
|
||||
|
||||
par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, (float) .7);
|
||||
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
|
||||
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
|
||||
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
|
||||
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
|
||||
par1Tessellator.addVertexWithUV(f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f7, f9);
|
||||
par1Tessellator.addVertexWithUV(f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f7, f8);
|
||||
par1Tessellator.addVertexWithUV(f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f6, f8);
|
||||
par1Tessellator.addVertexWithUV(f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f6, f9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
|
@ -136,7 +140,7 @@ public class RiftFX extends EntityFX
|
|||
|
||||
if (this.particleAge > this.particleMaxAge / 2)
|
||||
{
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
|
||||
this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / this.particleMaxAge);
|
||||
|
||||
if (this.field_92053_aD)
|
||||
{
|
||||
|
@ -178,7 +182,8 @@ public class RiftFX extends EntityFX
|
|||
}
|
||||
}
|
||||
|
||||
public int getBrightnessForRender(float par1)
|
||||
@Override
|
||||
public int getBrightnessForRender(float par1)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
@ -186,7 +191,8 @@ public class RiftFX extends EntityFX
|
|||
/**
|
||||
* Gets how bright this entity is.
|
||||
*/
|
||||
public float getBrightness(float par1)
|
||||
@Override
|
||||
public float getBrightness(float par1)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<project name="Necromancy" default="install" basedir=".">
|
||||
<project name="DimensionalDoors" default="install" basedir=".">
|
||||
<property environment="env" />
|
||||
|
||||
<property name="project.name" value="DimDoors" />
|
||||
|
|
199
buildOLD.xml
199
buildOLD.xml
|
@ -1,199 +0,0 @@
|
|||
|
||||
|
||||
<project name="DimensionalDoors" default="install" basedir=".">
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<property name="build.dir" value="build" />
|
||||
<property name="classes.dir" value="${build.dir}/packaging" />
|
||||
<property name="src.dir" value="src" />
|
||||
<property name="forge.version" value="1.5.2-7.8.0.691" />
|
||||
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
||||
<property name="mcp.version" value="751" />
|
||||
<property name="forge.dir" value="${build.dir}/forge" />
|
||||
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
||||
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
|
||||
<property name="resources.dir" value="resources" />
|
||||
|
||||
<property name="package.meta-inf" value="META-INF" />
|
||||
<property name="build.ver" value="1.5.2" />
|
||||
<property name="dist.dir" value="${build.dir}/dist" />
|
||||
|
||||
<property name="download.dir" value="downloads" />
|
||||
|
||||
<property name="lib.dir" value="${mcp.dir}/lib" />
|
||||
|
||||
<property file="${forge.dir}/forgeversion.properties" />
|
||||
<condition property="forge.already.installed">
|
||||
<equals arg1="${forge.build.number}" arg2="691" />
|
||||
</condition>
|
||||
|
||||
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
|
||||
<property name="verclass.name" value="mod_pocketDim.java"/>
|
||||
|
||||
|
||||
<mkdir dir="${download.dir}"/>
|
||||
<mkdir dir="${build.dir}" />
|
||||
|
||||
<target name="get-version" depends="setup-forge">
|
||||
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
|
||||
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
|
||||
<fileset dir="StevenDimDoors" />
|
||||
</copy>
|
||||
|
||||
|
||||
|
||||
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
|
||||
<arg value="-c"/>
|
||||
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
|
||||
</exec>
|
||||
<exec executable="python" osfamily="unix">
|
||||
<arg value="versionscript.py" />
|
||||
<arg value="${grep.out}" />
|
||||
</exec>
|
||||
<echo message="Grepped version: ${grep.out}"/>
|
||||
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
|
||||
</target>
|
||||
|
||||
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
||||
<condition property="should-download-ant-contrib">
|
||||
<or>
|
||||
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
<available file="${download.dir}/minecraftforge-src-${forge.version}.zip"/>
|
||||
</or>
|
||||
</condition>
|
||||
|
||||
<target name="install" depends="build">
|
||||
<copy todir="${classes.dir}/schematics" overwrite="true">
|
||||
<fileset dir="schematics" />
|
||||
</copy>
|
||||
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${mcp.dir}/reobf"/>
|
||||
<delete dir="${mcpsrc}/StevenDimDoors" />
|
||||
<delete dir="${mcpsrc}/Steven" />
|
||||
</target>
|
||||
|
||||
<target name="build" depends="get-version" unless="already-compiled">
|
||||
<!-- Recompile -->
|
||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
|
||||
<arg line="/c recompile.bat"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix" failonerror="true">
|
||||
<arg value="recompile.sh" />
|
||||
</exec>
|
||||
|
||||
<!-- Reobf -->
|
||||
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
||||
<arg line="/c reobfuscate_srg.bat"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
||||
<arg value="reobfuscate_srg.sh" />
|
||||
</exec>
|
||||
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
||||
</copy>
|
||||
<copy todir="${classes.dir}">
|
||||
<fileset dir="${resources.dir}"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
||||
<echo message="Using build number ${env.BUILD_NUMBER}..." />
|
||||
<property name="build.number" value="${env.BUILD_NUMBER}" />
|
||||
</target>
|
||||
|
||||
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
||||
<echo message="!! No build number set !!" />
|
||||
<property name="build.number" value="CUSTOM_BUILD" />
|
||||
</target>
|
||||
|
||||
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
||||
|
||||
<property name="build.full" value="${build.number}" />
|
||||
<unzip dest="${build.dir}">
|
||||
<fileset dir="${download.dir}">
|
||||
<include name="minecraftforge-src-${forge.version}.zip"/>
|
||||
</fileset>
|
||||
</unzip>
|
||||
|
||||
|
||||
<!-- Change executables' permitions -->
|
||||
|
||||
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
||||
|
||||
<!-- if your building on OSX these 2 should be executable -->
|
||||
|
||||
|
||||
|
||||
<!-- Install forge -->
|
||||
<delete dir="${mcp.dir}" failonerror="no"/>
|
||||
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
||||
<arg line="/c install.cmd"/>
|
||||
</exec>
|
||||
|
||||
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
||||
<arg value="install.sh" />
|
||||
|
||||
</exec>
|
||||
|
||||
|
||||
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
|
||||
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
||||
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
||||
<!-- Copy libraries -->
|
||||
<!-- <copy todir="${mcp.dir}/lib" >
|
||||
<fileset dir="lib" >
|
||||
<patternset includes="*.jar" />
|
||||
</fileset>
|
||||
</copy> -->
|
||||
</target>
|
||||
|
||||
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists">
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
<pathelement location="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
||||
<fileset dir="${download.dir}/ant-contrib/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<echo message="Downloading forge... " />
|
||||
<get src="${forge.url}" dest="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
||||
<echo message="Getting: ant-contrib"/>
|
||||
<mkdir dir="${download.dir}/tmp"/>
|
||||
<mkdir dir="${download.dir}/ant-contrib/lib" />
|
||||
<get src="http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip/download" dest="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip"/>
|
||||
<get src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp/commons-codec-1.6-bin.zip"/>
|
||||
|
||||
<unzip src="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip" dest="${download.dir}"/>
|
||||
<unzip src="${download.dir}/tmp/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp"/>
|
||||
|
||||
<move todir="${download.dir}/ant-contrib/lib">
|
||||
<fileset file="${download.dir}/tmp/commons-codec-1.6/commons-codec-1.6.jar"/>
|
||||
</move>
|
||||
|
||||
<!-- Delete useless files -->
|
||||
<delete dir="${download.dir}/ant-contrib/docs"/>
|
||||
<delete dir="${download.dir}/tmp"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="clean" >
|
||||
<delete dir="${build.dir}" />
|
||||
</target>
|
||||
|
||||
|
||||
</project>
|
||||
|
Before ![]() (image error) Size: 345 KiB After ![]() (image error) Size: 345 KiB ![]() ![]() |
Before ![]() (image error) Size: 471 KiB After ![]() (image error) Size: 471 KiB ![]() ![]() |
Before ![]() (image error) Size: 21 KiB After ![]() (image error) Size: 21 KiB ![]() ![]() |
Before ![]() (image error) Size: 2.7 KiB After ![]() (image error) Size: 2.7 KiB ![]() ![]() |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue