mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Finished the TeleStaff.
Missing yet: Textures!
This commit is contained in:
parent
8b72bbf79e
commit
1e2e8f2b8d
6 changed files with 21 additions and 12 deletions
|
@ -86,9 +86,9 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
|
||||||
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc")));
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc")));
|
||||||
}
|
}
|
||||||
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc")));
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc")));
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(""));
|
||||||
}
|
}
|
||||||
else player.openGui(ActuallyAdditions.instance, GuiHandler.PHANTOM_PLACER_ID, world, x, y, z);
|
else player.openGui(ActuallyAdditions.instance, GuiHandler.PHANTOM_PLACER_ID, world, x, y, z);
|
||||||
player.addChatComponentMessage(new ChatComponentText(""));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,10 @@ public enum ConfigIntValues{
|
||||||
DRILL_FORTUNE_EXTRA_USE("Fortune Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 40, 0, 10000, "How much extra Energy the Fortune Upgrade uses"),
|
DRILL_FORTUNE_EXTRA_USE("Fortune Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 40, 0, 10000, "How much extra Energy the Fortune Upgrade uses"),
|
||||||
DRILL_FORTUNE_II_EXTRA_USE("Fortune II Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 60, 0, 10000, "How much extra Energy the Fortune II Upgrade uses"),
|
DRILL_FORTUNE_II_EXTRA_USE("Fortune II Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 60, 0, 10000, "How much extra Energy the Fortune II Upgrade uses"),
|
||||||
DRILL_THREE_BY_THREE_EXTRA_USE("3x3 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 10, 0, 10000, "How much extra Energy the 3x3 Upgrade uses"),
|
DRILL_THREE_BY_THREE_EXTRA_USE("3x3 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 10, 0, 10000, "How much extra Energy the 3x3 Upgrade uses"),
|
||||||
DRILL_FIVE_BY_FIVE_EXTRA_USE("5x5 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 30, 0, 10000, "How much extra Energy the 5x5 Upgrade uses");
|
DRILL_FIVE_BY_FIVE_EXTRA_USE("5x5 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 30, 0, 10000, "How much extra Energy the 5x5 Upgrade uses"),
|
||||||
|
|
||||||
|
TELE_STAFF_REACH("TeleStaff: Reach", ConfigCategories.MACHINE_VALUES, 150, 5, 500, "How far the TeleStaff can teleport you"),
|
||||||
|
TELE_STAFF_ENERGY_USE("TeleStaff: Energy Use per Block", ConfigCategories.MACHINE_VALUES, 200, 1, 5000, "How much energy the TeleStaff uses per Block you teleport");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package ellpeck.actuallyadditions.items;
|
package ellpeck.actuallyadditions.items;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||||
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.EnumRarity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -11,13 +13,18 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class ItemTeleStaff extends ItemEnergy implements INameableItem{
|
public class ItemTeleStaff extends ItemEnergy implements INameableItem{
|
||||||
|
|
||||||
private static final double reach = 250D;
|
private static final double reach = ConfigIntValues.TELE_STAFF_REACH.getValue();
|
||||||
private static final int energyUsedPerBlock = 250;
|
private static final int energyUsedPerBlock = ConfigIntValues.TELE_STAFF_ENERGY_USE.getValue();
|
||||||
|
|
||||||
public ItemTeleStaff(){
|
public ItemTeleStaff(){
|
||||||
super(1000000, 12000, 1);
|
super(1000000, 12000, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return "itemTeleStaff";
|
return "itemTeleStaff";
|
||||||
|
@ -25,7 +32,7 @@ public class ItemTeleStaff extends ItemEnergy implements INameableItem{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
|
||||||
MovingObjectPosition pos = WorldUtil.getMovingObjectPosWithReachDistance(world, player, reach, false, true, false);
|
MovingObjectPosition pos = WorldUtil.getMovingObjectPosWithReachDistance(world, player, reach);
|
||||||
if(pos != null){
|
if(pos != null){
|
||||||
int side = pos.sideHit;
|
int side = pos.sideHit;
|
||||||
if(side != -1){
|
if(side != -1){
|
||||||
|
@ -39,7 +46,7 @@ public class ItemTeleStaff extends ItemEnergy implements INameableItem{
|
||||||
player.swingItem();
|
player.swingItem();
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
((EntityPlayerMP)player).playerNetServerHandler.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
|
((EntityPlayerMP)player).playerNetServerHandler.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
|
||||||
this.extractEnergy(stack, use, false);
|
if(!player.capabilities.isCreativeMode) this.extractEnergy(stack, use, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
public class ModUtil{
|
public class ModUtil{
|
||||||
|
|
||||||
public static final String VERSION = "1.7.10-0.0.6.4";
|
public static final String VERSION = "1.7.10-0.0.6.5";
|
||||||
|
|
||||||
public static final String MOD_ID = "ActuallyAdditions";
|
public static final String MOD_ID = "ActuallyAdditions";
|
||||||
public static final String NAME = "Actually Additions";
|
public static final String NAME = "Actually Additions";
|
||||||
|
|
|
@ -214,14 +214,10 @@ public class WorldUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MovingObjectPosition getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance){
|
public static MovingObjectPosition getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance){
|
||||||
return getMovingObjectPosWithReachDistance(world, player, distance, false, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MovingObjectPosition getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance, boolean arg1, boolean arg2, boolean arg3){
|
|
||||||
float f1 = player.prevRotationPitch+(player.rotationPitch-player.prevRotationPitch)*1.0F;
|
float f1 = player.prevRotationPitch+(player.rotationPitch-player.prevRotationPitch)*1.0F;
|
||||||
float f2 = player.prevRotationYaw+(player.rotationYaw-player.prevRotationYaw)*1.0F;
|
float f2 = player.prevRotationYaw+(player.rotationYaw-player.prevRotationYaw)*1.0F;
|
||||||
Vec3 vec = Vec3.createVectorHelper(player.prevPosX+(player.posX-player.prevPosX)*(double)1.0F, player.prevPosY+(player.posY-player.prevPosY)*(double)1.0F+(double)(world.isRemote ? player.getEyeHeight()-player.getDefaultEyeHeight() : player.getEyeHeight()), player.prevPosZ+(player.posZ-player.prevPosZ)*(double)1.0F);
|
Vec3 vec = Vec3.createVectorHelper(player.prevPosX+(player.posX-player.prevPosX)*(double)1.0F, player.prevPosY+(player.posY-player.prevPosY)*(double)1.0F+(double)(world.isRemote ? player.getEyeHeight()-player.getDefaultEyeHeight() : player.getEyeHeight()), player.prevPosZ+(player.posZ-player.prevPosZ)*(double)1.0F);
|
||||||
Vec3 vec1 = vec.addVector((double)MathHelper.sin(-f2*0.017453292F-(float)Math.PI)*-MathHelper.cos(-f1*0.017453292F)*distance, (double)MathHelper.sin(-f1*0.017453292F)*distance, (double)MathHelper.cos(-f2*0.017453292F-(float)Math.PI)*-MathHelper.cos(-f1*0.017453292F)*distance);
|
Vec3 vec1 = vec.addVector((double)MathHelper.sin(-f2*0.017453292F-(float)Math.PI)*-MathHelper.cos(-f1*0.017453292F)*distance, (double)MathHelper.sin(-f1*0.017453292F)*distance, (double)MathHelper.cos(-f2*0.017453292F-(float)Math.PI)*-MathHelper.cos(-f1*0.017453292F)*distance);
|
||||||
return world.func_147447_a(vec, vec1, arg1, arg2, arg3);
|
return world.func_147447_a(vec, vec1, false, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,6 +281,9 @@ item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle
|
||||||
item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz
|
item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz
|
||||||
item.actuallyadditions.itemMiscRing.name=Ring
|
item.actuallyadditions.itemMiscRing.name=Ring
|
||||||
|
|
||||||
|
item.actuallyadditions.itemTeleStaff.name=Teleport Staff
|
||||||
|
tooltip.actuallyadditions.itemTeleStaff.desc=Teleports you to where you're looking when you right-click.
|
||||||
|
|
||||||
item.actuallyadditions.itemJamCuBaRa.name=CuBaRa-Jam
|
item.actuallyadditions.itemJamCuBaRa.name=CuBaRa-Jam
|
||||||
item.actuallyadditions.itemJamGraKiBa.name=GraKiBa-Jam
|
item.actuallyadditions.itemJamGraKiBa.name=GraKiBa-Jam
|
||||||
item.actuallyadditions.itemJamPlApLe.name=PlApLe-Jam
|
item.actuallyadditions.itemJamPlApLe.name=PlApLe-Jam
|
||||||
|
|
Loading…
Reference in a new issue