Added Rift Blade Rift Creation Setting
Added a property in our config that enables or disables the Rift Blade's ability to create new rifts. It can still open existing rifts even if that ability is disabled. I tested that to be certain. If the ability is disabled, the Rift Blade blocks on right-click instead of charging like a bow.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user