Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Everything posted by sequituri

  1. for (Block b: GameData.blockRegistry) { doSomethingWithBlock(b); // example code write this method yourself - or: b.activateBlockMethod(args); // use a real method } for (Item i: GameData.itemRegistry) { doSomethingWithItem(i); // example code write this method yourself - or: i.activeItemMethod(args); // use a real method }
  2. The new Minecraft loader is pretty sophisticated piece of software (compared to the original) and it was designed to give flexibility to users who like to try out versions, mods, and options. You need to learn what the edit profile page does and how to use it, then you'll know how to select minecraft and forge versions.
  3. Take a look at BlockSlab#func150003_a(Block) is private and specific to vanilla slabs. So, you have to override the two functions that call it in your class. boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) Look at the code in BlockSlab and modify
  4. You could handle this event: ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, par1, par2, par3, par4); It happens in the code that calls onBlockClicked. The parameters might tell you something.
  5. First, you're not using extended properties properly. Second, this code will register your Entity data with a null player. Reverse to == to != and it should fix one problem. public void onEntityConstructing(EntityConstructing event) { if (event.entity instanceof EntityPlayer) { if (ExtendedPlayer.get((EntityPlayer) event.entity) == null) ExtendedPlayer.register((EntityPlayer) event.entity); } } Advice, the init() method is called when entity is created to set the initial properties for the entity. Yours does nothing. (maybe not critical, as the defaults are 0... in the case of objects it another story). loadNBTData() and saveNBTData() are called on entity spawn (player spawn in this case), and on entity despawn. This is where the data in the ExtendedEntity itself is loaded and saved. DataWatcher is nice only to the extent that it lets you know if the data has changed and communicates it to the other side immediately. However, you need to keep a valid copy in the data fields of this object. (So, when the datawatcher changes, you grab the data and update). Beyond that, I have not looked closely enough to give you an absolute fix. I'll keep looking, though.
  6. This is not how you define a resource location: It's looking for it in Minecraft (not your modid). new ResourceLocation(FruityGraphic.MODID + "/textures/model/BlockMasher.png"); Use this instead: Notice the colon character I put right there -----V new ResourceLocation(FruityGraphic.MODID + ":textures/model/BlockMasher.png"); --- or --- new ResourceLocation(FruityGraphic.MODID, "textures/model/BlockMasher.png"); Notice the two arguments above. And do not start your image path with slash "/", that is always wrong. Your texture needs to be assets\(whatever your modid is)\textures\model\BlockMasher.png starting at the root of your zip file.
  7. In simple terms, there may be a list (it's not null) but it also may be empty (it has no 0th element). Unless you know for a fact that the list is non-empy, check for it before using any element.
  8. The first thing to remember is not to scroll the players hotbar slots. And, no adding and removing slots is not what you want. Add all the slots at once and give the nonvisible ones locations that are off screen at first (like you had a much bigger chest on the screen. But mark them as not visible. Then when you scroll up or down, just walk through the slot list and update the Y values by the amount scrolled. (if you are scrolling side-to-side then adjust the X value.) Then mark the new visible slot and invisible ones. Only the visible ones will ever get a mouse-over, so they should work if you handle it properly. What you are doing is new territory and I don't think any tutorial will cover it, so you are on your one with the code mostly. Try to handle it as a gui scroll list.
  9. The whole decompiled and deobfuscated (for the most part) of Minecraft, FML, and Forge is readily browsable in Eclipse. All you have to do is setup up Forge and gradle properly. Then, read all about the interfaces, classes, methods, and what not.
  10. Posting arbitrary code and expecting it to help other people is not helpful at all. Do not post code with your own classes imported or defined in some outside invisible method. It just frustrates everyone.
  11. My advice is do the work in drawScreen by just drawing the slots and contents that are in view (using the current scroll row to begin drawing). I wouldn't change the slots at all. Let the server side deal with the slot, you just draw the slots that should be visible at the time. Of course, each slot visible and x,y position would need to update on scroll. But, that's trivial.
  12. Maybe it's different in 1.6.4, but in my version (1.7.2) Configuration does not have the signature you used. It doesn't even have that method. Code you use: config.getItem("Talisman core id", 6244, "determens the id of the core").getInt(6244); The code I found: public Property get(String category, String key, int defaultValue, String comment) So, get vs getItem, and the argument order and types differ.
  13. Yes, it's possible. But it's a lot of work and planning. I can't tell you how, though. I'd probably start with where your map is, and in what format, and how to read it, then setting up a dimension and biome, then using your decoded map info, build some terrain and decoration.
  14. Yeah, I'd plant this post in Forge Gradle, or Support and Bug Reports. It doesn't seem to be a coding issue.
  15. When did ChickenBones update that to 1.7.2? I was looking for that some time ago.
  16. NBTBase.NBTPrimitive is the basic concept of primitive storage types in NBT tags - which by the way is mostly polymorphic. So, directly storing only one of those primitives or String is allowed. Although, an array of integers or bytes is considered a basic NBT type as is a List of a single tagtype. Everything else (especially is it has keys or members) needs a Compound (since it is compound).
  17. I'd suggest creating a song registry (if there is not already one, that is). Use the 'ZipFiles' enumeration ability to find all your songs and add them all at once. Then, pick a random number: Random.nextInt(myRegister.length()) to decide which one to play. Study the code in net.minecraft.client.resources.FileResourcePack as an idea what you can implement.
  18. Everybody using eclipse and others like it should know this. The @Override annotation is put there as an error catcher!!! if you remove it, then you are ignoring some serious error you might be creating. Obviously any attempt to subclass a class and override methods (usually what you want) will be caught and signalled as errors only if the annotation is left in place. If it is removed, fine. Just beware that you are not actually overriding any method (you are creating a similar method). And your method may never be called. Worse, the original method will still be called. So, don't remove @Override!!!
  19. Never mind! I guess the forge release caused the problem. After setting both to 1029, the problem disappeared. I am going to update both to the cutting edge and see what shakes out now.
  20. I am using an slightly earlier version of Forge on my server (1024) than on my client (1029). I built my mod (using gradlew build) and it completed with no errors. I have no netty code in my mod. It was dropped in my server and client mod folders. The server started and ran fine and my mod was actively there (log messages). The client started and ran fine (standalone and integrated). However, the error occurs when I connect to my local server. The server believes the connection is going fine until the client disconnects - it says I joined game and then lost connection. The client log says something else entirely: Since this is the first time testing mods across TCP, I expected no problems. Vanilla works perfectly. This mod is so simple it only creates a few ores and some smelted items. Earlier on in the client log, I am seeing this (never saw it before):
  21. There is a reason for the sequence stated. Mod, creation is to allow the mod to get it's internal data structures set up. Then, when all mods are up to speed, each one goes through each sequence, in order to make their items play with others well. (That was one of the reasons for the OreDict.) When Init happens, *all* mod's blocks and items are ready to use. (accessible to other mods). When Post-init happens, al the recipes from all mods would be accessible and usable in other's recipes and can be modified. When InterModComms happens mods will be able to share functionality and alter how they run. Each has a unique purpose, don't pervert it.
  22. I was just playing with TransferStackInSlot() and I noticed that when it is successful, it must return an empty stack, not the original stack. The return stack is used to indicate that not all of the items could be transferred. If it has items left, there are put back into the original slot. This is for those people who shift-click and do not have enough room to hole all the crafts. I noticed that your return either null or the original stack, I don't think it will work that way.
  23. Did you perhaps forget to call TileEntity.addMapping(TileEntityHeatConductant, "MolecularScience_MyHeatConductant"); It needs that to reload tile entities and save the data properly. The naming just has to be unique across all tile entities in all mods. You can do that in a static block in your class. static { addMapping(Class,"id"); }
  24. What version has that change. I was using 1039, recently that was the latest on the download page.
×
×
  • Create New...

Important Information

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