Jump to content

Black

Members
  • Posts

    103
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Black's Achievements

Creeper Killer

Creeper Killer (4/8)

16

Reputation

  1. Well I really don't have time to write a long reply as I only came to check something here but let me warn you this isn't something you should do if you need to ask the question on a board unrelated to it. And yes, this is advanced base java, not minecraft forge code. And sure, it is doable, afterall it is just a matter of connecting to the url, getting the stream and putting it through to the desired output(and a lot of other bits and pieces). Something which is easily explained however far less fun to do without a decent bit of experience in that particular field of programming. I'll point you in the right direction but you'll need to do the rest mostly yourself. First of all you have a perfect, well not perfect but decent enough to know how to do it, with that openblocks code. 'It didn't help me' is well... good luck getting any further with programming this radio. Secondly, look into connecting to an url, and look into andriod based radios as those applications do that often. As for ITzZ, you can set the stations in the config files of openblocks. Secondly, the openblocks code uses a open source android class to do it so you can easily use it.
  2. Disclaimer: I haven't been modding minecraft for very long TheGreyGhost gave a typical Java answer. And that's also something you have to keep in mind, minecraft is written in java. It's not in C++ with its handy destructors, pointers, cpu & memory control Instead it is in java which is a generalized language with less possibilities towards your particular application & optimalization but easier to code in e.g. it is meant for not worrying about cpu or ram. So in a sense it suffices to simply follow normal procedure of only saving necessary things and calculating the rest, avoiding calculations in for loops or in much triggered methods etc. The way I generally approach my minecraft methods is if I see they'll be called a lot without needing it is by simply throwing in an if statement first. Other than that, there really isn't a need to worry about cpu or memory unless you really see it. Just write your classes and after you're done, just go over them and improve where possible.
  3. In the block class there is a function getHarvestLevel(metadata) Just return the harvestlevel according to the metadata you get and don't set it in the constructor.
  4. Well, nbt does seem the way to go. However, if I were you I'd store that on the player instead. Afterall, it is the player who can't access it, not the block, e.g. it is information about the player. Thus according to propper programming ethique it is data that should belong in the player. Furthermore, let us consider a server with 100 players. If the 100th player click on the block it has to iterate through a list of 99 players, check if the player is in the list and if not hand the item. Now if that information was in the player, then it would have to iterate through only 5 blocks, namely the 5 possible blocks he can click on. And this can even be solved with a simple array of booleans. Also worth to note is that the amount of data that has to be saved is about the same while the data it needs to load at one time is significantly less, just 5 booleans for the player. I think this is a decent start for a suggestion. Consider it.
  5. I gave it a quick test since I wanted to see whether this code was still viable in 1.7.10. I hadn't gotten around to fixing a syringe in my own mod so this was an excellent opportunity. This animates the provided textures. @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem == null) { return itemIcon; } int ticksInUse = stack.getMaxItemUseDuration() - useRemaining; if (ticksInUse > 18) { return iconArray[2]; } else if (ticksInUse > 14) { return iconArray[1]; } else if (ticksInUse > 0) { return iconArray[0]; } else { return itemIcon; } } As coolAlias said, set this.setFull3D() in constructor and provide the texture with public static final String[] SyringePullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; @SideOnly(Side.CLIENT) private IIcon[] iconArray; and this @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister parIconRegister) { this.itemIcon = parIconRegister.registerIcon(MODID + ":" + "basesyringe"); this.iconArray = new IIcon[syringePullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = parIconRegister.registerIcon(MODID + ":" + "basesyringe" + "_" + SyringePullIconNameArray[i]); } } I gave you a lot, which is not my habit unless I see that the person knows java/modding/does effort, but at least I now know where to refer to once there is a similar question asked here.
  6. I'll be just as concise as you are. Use an event for your binded key. Set a value with that. Take that value with a switch and bind the texture you want. Just make sure you open & close your matrix/tessellator/... in each statement.
  7. That's because the normal bow animation is a hardcoded one only useable for the vanilla code. In this topic a solution is offered: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1437164-1-6-4-forge-bow-texture-not-working And it might just solve your rotation problem, which is probably caused by the animation not working thus rendering a standard item.
  8. Well, first of all add a system.out.println("test"); just inside the function (before the if statement). That way, if it is triggered you'll see it in the console printing test. Or it might just be that this isn't the correct event you need, in which case you can also make sure the event triggers by opening a chest, which is a container. However, I've told you before how to find the list of events and it is up to you to look through them and find the event that fits your needs perfectly. You'll learn more that way than if I spoon feed you everything. Secondly, have you registered your event in your main class? It won't trigger if isn't registered correctly. And if you don't know how, look up minecraft forge events in google, I'm sure you'll find the correct line of code for it.
  9. The parameter is your event, and I would create a new event handler class for it(don't forget to register it as you normally would). (no idea if it'll trigger with yours but it just might and otherwise there are plenty of other options, look through them) Then check if the container is your ship inside this method, get the player and check his inventory etc. Never use a null parameter, it serves no other purpose than to crash the game. And don't call that event, it'll trigger once the player opens a container. That's how events work, you don't have to call them at a particular point, they trigger when an event happens.
  10. The problem with declaring an EntityPlayer at the top is that it is empty so even if you add an achievement to that player object it won't show up in the game(if it doesn't crashes because of it, as that also would be a nullpointer because you didn't create a new player) because simply, that player object doesn't contain the current player, it is as simple as that. If I were you I'd set up my event again in my custom eventHandler, choose the event correctly and register it. If you want to know what all the events are, go to the event class (F3 on any type of event class and then F3 on the eventclass itself) and type ctrl+T for the type hierarchy. For instance, there is a playercontainer event, which is called when a player opens a container. And secondly, don't call the method yourself.
  11. I take it that with the textures not working you mean the animation isn't being done? This thread offers a perfect solution: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1438011-1-7-2-custom-bow-not-using-animation-textures And if you have trouble with the texture itself, it might solve that as well.
  12. Alright, so now you know which line is returning null. What you have to do now is deduce what is returning a null. Let us analyse the different possibilities. event.player.addStat(Skyline.achievementCivilianCaptain, 1) We clearly only have 2. The addStat and the achievement itself. One of them is null, why? Looking at addStat we only have 3 possibilities: Either you didn't register it correctly, you're calling the method from somewhere which shouldn't be done(the game calls the method itself when something is crafted, that's what the event is for), or the event doesn't return the player. Of the three, the most likely are 1 & 2. Looking at the achievement itself, well as long as the achievement was created and registered correctly it should be work. So have a look at those two different things. I personally believe you are calling the method instead of letting the event handle it. Or as a last option, I might be wrong as well since I haven't implemented an achievement yet(although I am going to create one now).
  13. Well, reading your errorlog always helps: java.lang.NullPointerException: Rendering screen at esvdefcon.skyline.chunk.AssembleResult.getShipType(AssembleResult.java:244) Have a look at the line 244 of the file. It should be within the method getShipType. One of variables or methods you call there return a null. E.g. what they contain or return is empty. Check which one it is (by substituting the others until you find which one crashes for instance) and then look at what that method or variable actually does and why it returns null. And you weren't really wrong with ItemCraftEvent. It's just that it's only going to trigger when you have crafted something.
  14. No I'm pretty sure he typed this according to his log: gradlew gradlew setupDecompWorkspace --refresh-dependencies So gradlew was looking inside its folders for a task it could execute called gradlew which it obviously doesn't have since that's itself.
  15. Decomp is still functional, I used it two days ago on the latest forge snapshot. Generally all you really have to do is download the src version of the latest forge, unzip it in the folder your project goes in(make sure it is an empty folder and that the foldername doesn't contain weird signs or symbols), shift right click and click on 'open console here' type in gradlew setupDecompWorkspace, let it run until complete and run gradlew eclipse as many times said before. And if it doesn't work no matter what, give the 1.6.4 935 I think it was a go and see if that works, if neither of them does its obvious the problem is on your side.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.