Merge pull request #29 from SenseiKiwi/master

New Rift Blade Setting and Minor Bug Fix
This commit is contained in:
StevenRS11
2013-06-18 22:14:15 -07:00
3 changed files with 310 additions and 321 deletions

View File

@@ -94,6 +94,7 @@ public class DDProperties
public final boolean LimboReturnsInventoryEnabled;
public final boolean DoorRenderingEnabled;
public final boolean TNFREAKINGT_Enabled;
public final boolean RiftBladeRiftCreationEnabled;
/**
* Other
@@ -165,6 +166,9 @@ public class DDProperties
LimboReturnRange = config.get(Configuration.CATEGORY_GENERAL, "Limbo Return Range", 500,
"Sets the farthest distance that Limbo can send you upon returning to the Overworld").getInt();
DoorRenderingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Door Rendering", true).getBoolean(true);
RiftBladeRiftCreationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Creation with Rift Blade", true,
"Sets whether Rift Blades can create new rifts. If set to false, " +
"they will only be able to create transient doors on existing rifts.").getBoolean(true);
TNFREAKINGT_Enabled = config.get(Configuration.CATEGORY_GENERAL, "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
NonTntWeight = config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25,

View File

@@ -74,8 +74,8 @@ public class DungeonHelper
public ArrayList<Integer> metadataFlipList = new ArrayList<Integer>();
public ArrayList<Integer> metadataNextList = new ArrayList<Integer>();
public DungeonGenerator defaultBreak = new DungeonGenerator(DEFAULT_DUNGEON_WEIGHT, "/schematic/somethingBroke.schematic", true);
public DungeonGenerator defaultUp = new DungeonGenerator(DEFAULT_DUNGEON_WEIGHT, "/schematic/simpleStairsUp.schematic", true);
public DungeonGenerator defaultBreak = new DungeonGenerator(DEFAULT_DUNGEON_WEIGHT, "/schematics/somethingBroke.schematic", true);
public DungeonGenerator defaultUp = new DungeonGenerator(DEFAULT_DUNGEON_WEIGHT, "/schematics/simpleStairsUp.schematic", true);
private HashSet<String> dungeonTypeChecker;
private HashMap<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;

View File

@@ -1,12 +1,6 @@
package StevenDimDoors.mod_pocketDim.items;
import java.util.List;
import java.util.Random;
import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -18,13 +12,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.DDProperties;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -49,7 +46,6 @@ public class ItemRiftBlade extends itemDimDoor
private static DDProperties properties = null;
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
@@ -72,22 +68,21 @@ public class ItemRiftBlade extends itemDimDoor
@Override
public boolean hasEffect(ItemStack par1ItemStack)
{
return true;
}
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public int getDamageVsEntity(Entity par1Entity)
{
return 8;
}
public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
{
float var4 = 1.0F;
@@ -112,7 +107,6 @@ public class ItemRiftBlade extends itemDimDoor
return par1World.rayTraceBlocks_do_do(var13, var23, true, false);
}
protected 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);
@@ -163,11 +157,15 @@ public class ItemRiftBlade extends itemDimDoor
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.bow;
return properties.RiftBladeRiftCreationEnabled ? EnumAction.bow : EnumAction.block;
}
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
//Condition for disabling rift creation
if (!properties.RiftBladeRiftCreationEnabled)
return;
Vec3 var2 = par3EntityPlayer.getLook(1.0F);
double cooef = -2;
@@ -176,13 +174,12 @@ public class ItemRiftBlade extends itemDimDoor
var2.zCoord*=cooef;
double var5 = par3EntityPlayer.posX - var2.xCoord;
double var9 = par3EntityPlayer.posZ - var2.zCoord;
double var7 =par3EntityPlayer.posY-var2.yCoord+2;
double var7 = par3EntityPlayer.posY - var2.yCoord+2;
int x = MathHelper.floor_double(var5);
int y = MathHelper.floor_double(var7);
int z = MathHelper.floor_double(var9);
int rotation = (int) (MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
LinkData link = new LinkData(par2World.provider.dimensionId, 0, x, y, z, x, y, z, true,rotation);
@@ -194,28 +191,16 @@ public class ItemRiftBlade extends itemDimDoor
if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==0)
{
dimHelper.instance.createPocket(link,true, false);
}
}
else
{
dimHelper.instance.createPocket(link,true, false);
}
placeDoorBlock(par2World, x, y-1, z, rotation, mod_pocketDim.transientDoor);
}
else
{
}
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
Boolean didFindThing=false;