Progress on Rewrite #86
@@ -94,14 +94,12 @@ public class DDProperties
|
|||||||
public final boolean LimboReturnsInventoryEnabled;
|
public final boolean LimboReturnsInventoryEnabled;
|
||||||
public final boolean DoorRenderingEnabled;
|
public final boolean DoorRenderingEnabled;
|
||||||
public final boolean TNFREAKINGT_Enabled;
|
public final boolean TNFREAKINGT_Enabled;
|
||||||
public final boolean RiftBladeRiftCreationEnabled;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other
|
* Other
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final int NonTntWeight;
|
public final int NonTntWeight;
|
||||||
public final int RiftSpreadModifier;
|
|
||||||
public final int ClusterGenerationChance;
|
public final int ClusterGenerationChance;
|
||||||
public final int GatewayGenerationChance;
|
public final int GatewayGenerationChance;
|
||||||
public final int MonolithSpawningChance;
|
public final int MonolithSpawningChance;
|
||||||
@@ -166,9 +164,6 @@ public class DDProperties
|
|||||||
LimboReturnRange = config.get(Configuration.CATEGORY_GENERAL, "Limbo Return Range", 500,
|
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();
|
"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);
|
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);
|
TNFREAKINGT_Enabled = config.get(Configuration.CATEGORY_GENERAL, "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
|
||||||
NonTntWeight = config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25,
|
NonTntWeight = config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25,
|
||||||
@@ -219,10 +214,6 @@ public class DDProperties
|
|||||||
"Sets the chance (out of " + GatewayGenerator.MAX_GATEWAY_GENERATION_CHANCE + ") that a Rift Gateway will " +
|
"Sets the chance (out of " + GatewayGenerator.MAX_GATEWAY_GENERATION_CHANCE + ") that a Rift Gateway will " +
|
||||||
"generate in a given chunk. The default chance is 10.").getInt();
|
"generate in a given chunk. The default chance is 10.").getInt();
|
||||||
|
|
||||||
RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3,
|
|
||||||
"Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " +
|
|
||||||
"A value greater than 5 is not recommended as the growth is exponential.").getInt();
|
|
||||||
|
|
||||||
LimboBiomeID = config.get(CATEGORY_BIOME, "Limbo Biome ID", 251).getInt();
|
LimboBiomeID = config.get(CATEGORY_BIOME, "Limbo Biome ID", 251).getInt();
|
||||||
PocketBiomeID = config.get(CATEGORY_BIOME, "Pocket Biome ID", 250).getInt();
|
PocketBiomeID = config.get(CATEGORY_BIOME, "Pocket Biome ID", 250).getInt();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.EnumToolMaterial;
|
import net.minecraft.item.EnumToolMaterial;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
@@ -20,8 +19,6 @@ import net.minecraft.util.Vec3;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@@ -62,8 +59,14 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
@Override
|
||||||
|
public int getDamageVsEntity(Entity par1Entity)
|
||||||
|
{
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
public boolean hasEffect(ItemStack par1ItemStack)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@@ -76,12 +79,6 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDamageVsEntity(Entity par1Entity)
|
|
||||||
{
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
|
public MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
|
||||||
{
|
{
|
||||||
@@ -139,61 +136,6 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* How long it takes to use or consume an item
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
|
||||||
{
|
|
||||||
return 72000;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnumAction getItemUseAction(ItemStack stack)
|
|
||||||
{
|
|
||||||
return properties.RiftBladeRiftCreationEnabled ? EnumAction.bow : EnumAction.block;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int itemInUseCount)
|
|
||||||
{
|
|
||||||
//Condition for disabling rift creation
|
|
||||||
if (!properties.RiftBladeRiftCreationEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (world.isRemote)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Vec3 var2 = player.getLook(1.0F);
|
|
||||||
|
|
||||||
double cooef = -2;
|
|
||||||
var2.xCoord *= cooef;
|
|
||||||
var2.yCoord *= cooef;
|
|
||||||
var2.zCoord *= cooef;
|
|
||||||
double var5 = player.posX - var2.xCoord;
|
|
||||||
double var9 = player.posZ - var2.zCoord;
|
|
||||||
double var7 = player.posY - var2.yCoord + 2;
|
|
||||||
|
|
||||||
int x = MathHelper.floor_double(var5);
|
|
||||||
int y = MathHelper.floor_double(var7);
|
|
||||||
int z = MathHelper.floor_double(var9);
|
|
||||||
|
|
||||||
int orientation = (int) (MathHelper.floor_double((double) ((player.rotationYaw + 90) * 4.0F / 360.0F) + 0.5D) & 3);
|
|
||||||
|
|
||||||
//TODO: This looks weird. Shouldn't we aim to only create rifts on maxed-out usage time? i.e. "<= 0"
|
|
||||||
if (this.getMaxItemUseDuration(stack) - itemInUseCount > 12 &&
|
|
||||||
ItemDimensionalDoor.canPlace(world, x, y, z) && ItemDimensionalDoor.canPlace(world, x, y + 1, z))
|
|
||||||
{
|
|
||||||
NewDimData dimension = PocketManager.getDimensionData(world);
|
|
||||||
if (!dimension.isPocketDimension() && dimension.getLink(x, y + 1, z) == null)
|
|
||||||
{
|
|
||||||
dimension.createLink(x, y + 1, z, LinkTypes.POCKET);
|
|
||||||
player.worldObj.playSoundAtEntity(player,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
|
|
||||||
ItemDimensionalDoor.placeDoorBlock(world, x, y, z, orientation, mod_pocketDim.transientDoor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||||
{
|
{
|
||||||
@@ -212,7 +154,8 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
double var7 = var3.dotProduct(var4);
|
double var7 = var3.dotProduct(var4);
|
||||||
if( (var7+.1) > 1.0D - 0.025D / var5 ? player.canEntityBeSeen(ent) : false)
|
if( (var7+.1) > 1.0D - 0.025D / var5 ? player.canEntityBeSeen(ent) : false)
|
||||||
{
|
{
|
||||||
((ItemRiftBlade) stack.getItem()).teleportToEntity(stack, ent, player);
|
teleportToEntity(stack, ent, player);
|
||||||
|
stack.damageItem(3, player);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,36 +163,33 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(world, player, false);
|
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
if (hit != null)
|
if (hit != null)
|
||||||
{
|
{
|
||||||
if (world.getBlockId(hit.blockX, hit.blockY, hit.blockZ) == properties.RiftBlockID)
|
|
||||||
{
|
|
||||||
if (PocketManager.getLink(hit.blockX, hit.blockY, hit.blockZ, world) != null)
|
|
||||||
{
|
|
||||||
Block block = mod_pocketDim.transientDoor;
|
|
||||||
int x = hit.blockX;
|
int x = hit.blockX;
|
||||||
int y = hit.blockY;
|
int y = hit.blockY;
|
||||||
int z = hit.blockZ;
|
int z = hit.blockZ;
|
||||||
|
if (world.getBlockId(x, y, z) == properties.RiftBlockID)
|
||||||
if (player.canPlayerEdit(x, y, z, hit.sideHit, stack) && player.canPlayerEdit(x, y + 1, z, hit.sideHit, stack) && !world.isRemote)
|
{
|
||||||
|
if (PocketManager.getLink(x, y, z, world) != null)
|
||||||
|
{
|
||||||
|
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((double)((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||||
|
|
||||||
if (BaseItemDoor.canPlace(world, x, y, z) &&
|
if (BaseItemDoor.canPlace(world, x, y, z) &&
|
||||||
BaseItemDoor.canPlace(world, x, y - 1, z))
|
BaseItemDoor.canPlace(world, x, y - 1, z))
|
||||||
{
|
{
|
||||||
ItemDimensionalDoor.placeDoorBlock(world, x, y - 1, z, orientation, block);
|
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,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
|
||||||
stack.damageItem(10, player);
|
stack.damageItem(3, player);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//FIXME: Should this be inside or after this IF?
|
}
|
||||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||||
|
}
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,21 +210,6 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
return mod_pocketDim.itemStableFabric.itemID == par2ItemStack.itemID ? true : false;
|
return mod_pocketDim.itemStableFabric.itemID == par2ItemStack.itemID ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y,
|
|
||||||
int z, int side, float hitX, float hitY, float hitZ)
|
|
||||||
{
|
|
||||||
if (BaseItemDoor.tryItemUse(mod_pocketDim.transientDoor, stack, player, world, x, y, z, side, true, false))
|
|
||||||
{
|
|
||||||
world.playSoundAtEntity(player,"mods.DimDoors.sfx.riftDoor", 0.6f, 1);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows items to add custom lines of information to the mouseover description
|
* allows items to add custom lines of information to the mouseover description
|
||||||
*/
|
*/
|
||||||
@@ -292,8 +217,8 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
{
|
{
|
||||||
par3List.add("Opens a temporary door, has");
|
par3List.add("Creates temporary doors");
|
||||||
par3List.add("a special teleport attack,");
|
par3List.add("on rifts, rotates doors,");
|
||||||
par3List.add("and rotates existing doors.");
|
par3List.add("and has a teleport attack.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user