• 0

    posted a message on Stuck on a tracker block, of sorts, need advice/ideas.

    DimensionManager was one of the first things I tried..


    Trying it again skipping the advanced pieces of grabbing my Tile entity and focusing on fetching the World object still results on returning null.


    @Override
    	public void addInformation(ItemStack stack, EntityPlayer player, List toolTip, boolean bool) 
    	{
    		WorldServer dimWorld = DimensionManager.getWorld(0);//World for Overworld
    		
    		if(dimWorld != null)
    		{
    			toolTip.add("World: " + dimWorld.provider.getDimensionName());
    		}
    		else
    		{
    			toolTip.add("World is null!");
    		}
    		
    		
    		super.addInformation(stack, player, toolTip, bool);
    	}


    Standing in the Overworld beside my Tile Entity with my item in hand.



    Regarding what you said about there being no guarantee the world would return anything..How would the item/Tile Entity communication be affected if the player holds the item in the Overworld and the tile entity is in The Nether? Assuming, of course, the Tile Entity was loaded by means of something like a ChickenChunks Chunk Loader or Railcraft World Anchor?

    Posted in: Modification Development
  • 0

    posted a message on Stuck on a tracker block, of sorts, need advice/ideas.

    Ok, so I've been through all sorts of ideas in my head, for the last..several days, on how to get something like this to work.


    What I'm trying to do:


    I'm trying to save the name of an Entity that touches a Tile Entity and have it display as a tool-tip on an item.


    What I have so far:


    So far I have an item(Clipboard) that saves the X/Y/Z/dim ID to itself via nbt and places a tile entity(tracker block) when right clicked. The tracker block itself is working fine; I can have it save the name and print it, that part is alright. The problem arises when I try to add it to the item's tool-tip.


    What I (think) I need:


    I need an instance of the World the Tracker Block is in. The addInformation method has a player parameter in it, which I could get a world object from. However it wouldn't help me much if the player and Tracker are in different dimensions, which is very possible.


    The only thing that I think may do it that I haven't tried yet is something with packets. I'm fairly sure I could do it with them, but honestly have no idea where to start with them.


    How I think the addInformation method will look by the end.

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List toolTip, boolean bool) 
    {
    	NBTTagCompound nbt = stack.getTagCompound();
    	
    	if(stack.getTagCompound() != null && stack.getTagCompound().hasKey("Tracker_Set") && nbt.getBoolean("Tracker_Set"))
    	{
    		double x = nbt.getDouble("X");
    		double y = nbt.getDouble("Y");
    		double z = nbt.getDouble("Z");
    		int dim = nbt.getInteger("Dim_ID");
    			
    		TileEntityTracker trackerBlock = (TileEntityTracker) trackerBlocksWorld.getTileEntity((int) x, (int) y, (int) z);
                
    		if(trackerBlock.lastEntityToTouch != null)
    		{
    			toolTip.add("The last Entity to collide with me was: " + trackerBlock.lastEntityToTouch.getCommandSenderName() + " at: " + "X: " + x + "," + " Y: " + y + " Z: " + z);
    		}
    	}
    	
    	
    	super.addInformation(stack, player, toolTip, bool);
    }


    Any advice or ideas would be super appreciated! If packets would be the best choice here, some tips on where to get started would be great, rather than just "Go learn packets." ;)

    Thank you!

    Posted in: Modification Development
  • 0

    posted a message on Probably a simple question regarding multiblocks..and some less important, random things.

    Sakra, you're awesome! Thanks you so much for your help! I'll keep this info in mind when I redo that class tomorrow. I've scrapped and restarted this mod several times already, but this time I feel like I'm getting somewhere. I'm marking this topic Resolved, as my questions have been answered. Thanks again!


    --Tenyar

    Posted in: Modification Development
  • 0

    posted a message on Probably a simple question regarding multiblocks..and some less important, random things.

    That...was surprisingly simple..Almost a waste of time, haha. Thank you!


    For the FOV thing.. I'm doing all my logic in a LivingUpdateEvent. I check if the block under the player is mine, and if the "ritual" hasn't started yet. If so I save the perspective and FOV. If the player sneaks with my item the "ritual" starts, I force a FOV change, and after some time I change it back. My class is below.


    Forcing the FOV was something I just finished, I tried using maps with the players name as a unique key and all kinds of crazy things. This is the first things I got to actually work..Until multiplayer, that is. ;P Maybe it's time to rest and look at it with fresh eyes before I do anything else with it. I really appreciate your help! Thanks! :Diamond:



    public class RitualEvent
    {
    public int ticks;
    public static int perspectiveOld = 0; //Default value
    public static float FOVOld = 70; //"Normal" value

    Random rand = new Random();
    Minecraft mc = Minecraft.getMinecraft();

    @SubscribeEvent
    public void onLivingUpdate(LivingUpdateEvent event)
    {
    if (event.entity instanceof EntityPlayer)
    {
    ItemStack heldItem = player.inventory.getCurrentItem();
    World world = player.worldObj;

    if(Ritual_Utils.findBlockUnderEntity(world, player) == Dark_Rituals.darkAltar)
    {
    if(!hasRitualStarted)
    {
    boolean saved = false;
    if(!saved)
    {
    perspectiveOld = mc.gameSettings.thirdPersonView;
    FOVOld = mc.gameSettings.fovSetting;
    saved = true;
    }
    }

    if(!world.isDaytime() || Ritual_Utils.isInCreative(player))
    {
    if (heldItem != null && heldItem.getItem() == Info.Ritual_Catalyst)
    {
    if(player.isSneaking())
    {
    player.setLocationAndAngles((int) player.posX + 0.5, (int) player.posY - 1, (int) player.posZ + 0.5, player.cameraYaw, player.cameraPitch);
    destroyItem(player);
    hasRitualStarted = true;
    }
    }
    }
    }

    if(hasRitualStarted)
    {
    forceChangeFOV();
    ticks++;

    if(ticks >= 20*1 && ticks <= 20*2)
    {
    Ritual_Utils.playSound(player, SoundNames.dragonGrowl);
    }
    if(ticks >= 20*2 && ticks <= 20*5)
    {
    player.motionX = 0;
    player.motionY = 0;
    player.motionZ = 0;
    }
    if(ticks >= 20*5)
    {
    mc.gameSettings.thirdPersonView = perspectiveOld;
    mc.gameSettings.fovSetting = FOVOld;
    Ritual_Utils.playSound(player, SoundNames.dragonDeath);
    ticks = 0;
    hasRitualStarted = false;
    player.motionX = player.motionX;
    player.motionY = player.motionY;
    player.motionZ = player.motionZ;
    }
    }
    }
    }

    public void destroyItem(EntityPlayer player)
    {
    if(!player.capabilities.isCreativeMode)
    {
    player.destroyCurrentEquippedItem();
    }
    }

    public void forceChangeFOV()
    {
    mc.gameSettings.thirdPersonView = 1;
    mc.gameSettings.fovSetting = 110;
    }

    }

    Posted in: Modification Development
  • 0

    posted a message on Probably a simple question regarding multiblocks..and some less important, random things.

    The answer to this is probably sitting right in-front of my face, but I've been up for an unreasonable amount of time so any help is appreciated. &lt;_&lt;


    Basically I'm using a tile entity to check blocks at a predefined X/Z location, and a variable height. Then, if they are a specific block, (in this case Nether Brick) do something. Now, obviously I'd want to use loops for this, which I am, but as it stands, it reacts if even a single block in the tower is Nether Brick, as opposed to the entire tower being Nether Brick, which I want.


    I would just use a ton of if statements, but this is my first mod that isn't just a "generic tools & armor" mod, and I want it to be presentable code wise. ;)

    ...Besides..that would be totally inefficient.


    I'm also wanting to change the players FOV, which I am already able to do, but run into issues in multiplayer (or LAN, at-least). Right now I'm saving the current FOV settings to a float with Minecraft.getMinecraft().gameSettings.fovSetting; changing the FOV and then resetting it with the saved float from earlier. On the player that is hosting the save, everything works as intended, the setting is saved, FOV is changed, and replaced to what it was. However, if I use the player that joined the hosted game, it changes the FOV for all players. Is there a way to change the FOV on a player/client basis?


    Thanks for any and all help you guys give me! :)


    --Tenyar


    My multiblock code is below, but it's literally just a for loop inside my tile entity's updateEntity method.


    @Override
    public void updateEntity()
    {

    for(int i = 0; i < 5; i++)
    {
    Block towerMaterial = worldObj.getBlock(xCoord + 6, yCoord + i, zCoord + 2);

    if(towerMaterial == Blocks.nether_brick)
    {
    System.out.println(Info.DEBUG_Message);
    }
    }

    }

    Posted in: Modification Development
  • 0

    posted a message on [Discontinued, unless specifically requested]The Breakfast mod! Over 400 Downloads!
    Hey! While this mod is discontinued unless specifically requested, I am currently working on a different mod that could use some loving on it's textures. :P I'll PM you to farther discuss it.
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    :DORE: Updated to support 1.6.4!This update adds no new content. It also does not have any Ore Dictionary support, unfortunately. On the bright side, however, I am still Tinkering with it, so to say. ;)

    More to come soon! :Notch:
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Good news! I've found an old source, and, my goodness, what was I thinking! That code was such a mess! :D :P

    I should have it updated and playable tomorrow or the day after. I currently do not have the Ore Dictionary in use yet, but I will play around with it and see what I can come up with. :)
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Actually, I was going to wait until the 1.7.X development environment was released, and push all the new content I've been working on all at once(Dungeons, mobs, structures, dimension, exc.) , but I will look around for a backdated source. If I find one, I'll update and publish it here, but it will have no new content. That will all be pushed whenever I can make the leap to 1.7. :)

    Obligatory teaser pic. ;)




    Edit: @ Mr.theboy

    Me desculpe, eu não entendo você. -- My last post may be of help to you, though.
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Hey guys!

    Sorry for my absence, but I'm back now! :D

    Here are a few sneak-peeks of what I've been up to. :)

    [media][media][/media[/media]]

    [media][media][/media[/media]]

    And a passive animal. :)



    I often post short videos showing what I've been doing on my YouTube page, just saying. ;)


    Also, hers is some nice music. :)

    [media][media][/media[/media]]
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Thank you for the video! :D
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Ok, I'll post it on the top page when it is uploaded! :)
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Quote from ProPride

    Here's a little update I've made, its about 1 minute long. If you don't put in the directions for making a living dispenser, copy this address as a spoiler/cheat so if people want to figure it out. Use it if you want. :)


    Thank you. :) It is under the Tumi tab, as a spoiler.
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Please do! I love to watch them! :D
    Posted in: Minecraft Mods
  • 0

    posted a message on {1.6.4} {Forge} Better Defense Updated 8/12/13
    Thanks PlayingRisky(or ProPride)! I moved your video to the "Videos!" section of OP. :)
    Posted in: Minecraft Mods
  • To post a comment, please .