Jump to content

Matryoshika

Forge Modder
  • Posts

    523
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Matryoshika

  1. You need to override shouldSideBeRendered(IBlockState, IBlockAccess, BlockPos, EnumFacing) . In the super-class (BlockLeaves) the method is checking strictly " block == this " where you now have an instance of that block, leading to the if-check returning false.
  2. I'd recommend that you only check the "corners" of this area. If there are blocks inside this area, remove them. If there's a hole between & below these points, fill them in.
  3. Why use it? -It can pull any object from any registry, during runtime. Including objects from other mods. Why is it useful? -Let's say I have a mod called "SuperMod", and you want to use one of my blocks, but don't want to use my mod as a dependency. Instead, you can use ObjectHolder to "get" this block at runtime, and thus use it for whatever you want, without having a dependency on my mod. Of course, it is always good to only run this code if "SuperMod" is also loaded. Otherwise, it is going to stay null. (Use Loader.isModLoaded("modid") to check!)
  4. Of course the angle is static, if you never change the value of it. GlStateManager does not rotate the model for you, by the given angle, every who-knows-what-time-units. It only rotates once, by that amount. You need to -continuously- edit the angle to be something between 0-360 degrees. As mentioned, (System.currentTimeMillis() / 40) % 360 gives you a value that is always changing (aka creating a rotation) but always fixed between 0-360 degrees. Could you try using: GlStateManager.rotate((System.currentTimeMillis() / 40) % 360, 0, 1, 0); ? Does it, or does it not make your model rotate around continuously?
  5. alright I was able to find this again... I have been here I had just forgotten.... Still unable to get it to spin though. this is what I have that makes it look straight: GlStateManager.rotate(entity.rotationYaw, 1, 80, 1); I can do pitch aswell that way. The thing is, when the entity is thrown it sticks in that rotation and flies that way... It doesn't circulate. First and foremost: You are rotating it in all axii. To only rotate the yaw (y-axis rotation) use [angle, 0,1,0] as the variables. This is also only done client-side. What is the entity's rotation clientside? Does it ever change?
  6. Vic_ has a handy list of events, what they do, and what variables they contain, sadly, I have found a few events to be missing (Like ExplosionEvent (Still holds a wide assortment)) Also sadly, Vic_ changed their dropbox to now provide a download of the html file =_= Before, you could view it directly. The list can be found in my signature V
  7. For models, use GlStateManager.rotate(angle, x, y, z) For a dynamic angle between 0 & 360 degrees, I usually use (System.currentTimeMillis() / 40) % 360
  8. From ItemSword base class: public float getDamageVsEntity() { return this.material.getDamageVsEntity(); }
  9. What? If your friend is dealing with obfuscated jars, he is doing it all wrong. When you build the jar, your code is obfuscated to be able to work properly with "real" (aka non-dev environment) Minecraft. When building (since 1.8and later, I believe), you should by default get 2 jars inside the build/libs folder, [name].jar, and [name]-sources.jar. The "sources" indicates a non-obfuscated version of your mod, which other devs can use for cross-mod/addon interaction, etcetera.
  10. Take a look at Gui#drawCenteredString . You need to get the screen's middle, and offset it by half of the string's width to make both the screen's & string's middles line up.
  11. How does he modify it? Larger|smaller radius? Power? Stops it? Most likely, unless your friend is doing something major, he can simply subscribe to the ExplosionEvent and handle things from there. As long as any mod-dev makes his/her explosions fire this event as well (which they seriously should) then that is all that is needed.
  12. You seem to have a case of Client/Server mismatch. I believe you hinder the block from being broken on the server, but the client isn't aware of your change. Show your code please.
  13. No, that is not possible. RegistryEvent is fired before preInit . You need to use the @Mod.EventBusSubscriber annotation to register it.
  14. I18n. There are *4* I18n's, for some reason. One, is completely wrong; The first one you have encountered. The second, is the deprecated one, which was used before. The third one, that you should use, is net.minecraft.client.resources.I18n Fourth one, is from Sun's imageio package. Completely irrelevant. Use I18n#format(String) , where "String" is the lang-key inside your .lang that you want.
  15. The "#" is the notation used in JavaDoc to reference another class' methods. "Class.method" is the syntax for static methods, which can be mis-leading. This means, that when you see "class#method", you need an instance of the class. Here, the direct code would be " event.getEntityItem() ", where event is an instance of ItemExpireEvent . I use the IItemHandler capability here, to pickup items, and insert them into adjacent inventories that have said IItemHandler capability. If you do create your own custom container, you will need to attach the IItemHandler Capability to it. There are quite the few tutorials on that out there. The way you set the inventory now, will destroy items when any of these 2 conditions are met: There is already an item in the inventory at slot #1, OR more than 1 stack expires in the same block-space, which does fire the first condition. You simply set the first stack to something new, without checking if it is already something else. IItemHandler is superior to IInventory, because it does a lot of the logic for you. With IInventory, you need to scan the whole inventory for a null slot, or a slot containing the same item/block. Calculate how much you can insert into that slot, split the stacks, and actually insert the amount that you can. In the class I linked above, I first tested with IInventory.... Code was bulky as hell, more than twice as long, and not easily understandable from a glance. IItemHandler compacted the whole thing. I am seriously happy I took the time to learn about IItemHandler! Also: What do you think will happen when, let's say a BuildCraft quarry, or pipe, or heck, even a player with a magnet, gathers a lot of items in the world, and they despawn? Will each stack have it's own inventory spawned? That's some tower 'o chests right there... @loordgek Still the issue with overwriting whatever is already in the slot you specify. Always check IF you can, THEN do it. And yes. Seriously update to 1.7.10. Not supported here, and only reason that version isn't dead yet is because server's haven't been able to get a stable plugin+mod platform until recently ('stable' or rather, somewhat working)
  16. You get the EntityItem from ItemExpireEvent#getEntityItem() . I also advice you to create a BlockPos, from the EntityItem's x, y & z coords, and scan in all cardinal directions (for-loop through EnumFacing.VALUES, and offset the BlockPos) for another chest. If none exists, create one at the BlockPos, and insert the ItemExpireEvent#getEntityItem()#getEntityItem() (The stack stored in the entity) into the chest. To insert the item, use the ItemHandler Capability, don't cast the chest to IInventory.
  17. Technically, no. You should be able to "fake" colored light with a block with wanted vanilla light-amount, and access to the Tessellator. I had some fun with a TESR a week or two ago that faked a "star", 'shining' a soft diffused light to it's surroundings, and fading the further away it went. If the block of the corresponding tile's TESR had a light-value > 0, it could have been seen as what the OP seems to want. Horribly expensive on rendering, but still do-able without rewriting the engine.
  18. Pseudo-code if(entity instanceof EntityPlayer){ IYourCapability capability = entity.getCapability(YourCapabilityProvider.INSTANCE, null); int mobKills = capability.getMobKills(); }
  19. You need to store the mob-kills. I recommend you store them in a Capability , and attach it to EntityPlayer, and then all you need to do is retrieve the Capability from the player that tries to wear this armour, and get their mob-kill count. (Remember, mobs can also wear armour, so always check what is trying to wear the armour!)
  20. Yeah, as Desht states, DecorateBiomeEvent is not to actively alter medium-to-large parts of a chunk. When I developed Underworld, I had to do make use of some tricks to spawn what I wanted, where I wanted it, how I wanted it, without it actively killing the computer generating the terrain. Dealing with possibly 100 or more blockstates in one chunk at once, through world#getBlockState & world#setBlockState, will have similar issues, no matter how you do it. Compared to how ChunkProvider's generate terrain, world#getBlockState & world#setBlockState are quite inefficient (ChunkProvider's get a double-array with the size of 16x16xWorldHeight from NoiseOctaves|Perlin directly, and simply fills it instantaneously, creating the "chunk" without any features like trees, flowers etc) Bar ASM, you cannot stop gravel from falling. On every random update tick, it checks if it can fall in BlockFalling#checkFallable . Because it sounds like you are trying to do some major WorldGen changes, I would recommend you create your own ChunkProvider entirely, that places your own pseudo gravel (looks like gravel, drops gravel, sounds like gravel, but doesnt fall), with a following WorldProvider, and re-register the dimension in the DimensionManager. Or you could do as you want right now, but likely have some major lagspikes during worldgen.
  21. You don't need the " new Object[] " as the method wants varargs, like larsgerrits states. Also, what the heck are you doing with the Character#valueOf() ? GameRegistry.addRecipe(new ItemStack(ContentRegistry.GHAST_TEAR_JAR), "TTT", "TJT", "TTT", 'T', Items.GHAST_TEAR, 'J', ContentRegistry.JAR ); Works just fine and dandy, without all that baggage.
  22. I have not created any biomes myself, though I run run into the BiomeManager a couple of times, which I have seen has a method called BiomeManager.addBiome(BiomeType type, BiomeEntry entry) . If I remember correctly, ChunkProviders only call the WorldProvider, which call the BiomeProvider, which call the method getBiomesForGeneration which returns a list of all biomes, through the use of Biome#getBiomeForID(int) that is looped through. As it stands, any registered biome should thus spawn in the world, no matter what ChunkProvider or WorldProvider is used (as long as they don't do what the Nether/End's chunkproviders do, and only contain a single biome etc)
  23. Short answer: no. SharedMonsterAttributes.MAX_HEALTH is an instance of RangedAttribute with a minimum value of 0, and maximum of, as you can see, 1024. Long answer: You can probably hack your way and change the IAttribute, of this entity, through the use of Reflection, and replace the RangedAttribute with another one, with a higher max cap. Note: MAX_HEALTH , is a final field, and thus you will also need to reset this modifier. One warning though. Reflection isn't for the light-hearted. It can be quite difficult to get the hang of it.
  24. Just to be sure, as you do imply that you do not use Blender much at all, but are you sure you had Blender in the correct viewport? When importing about anything into blender, the default viewport is "solid", where you need either "texture", "material" or "rendered" to view it with "textures". [spoiler=image] On the Cubik issues. Yes, that is quite odd >_> As i mentioned before, I would recommend you get the model's texture baked to the UV-map, to make sure that it renders (This should be done inside the modelling software. If Cubik cannot do this, then sorry, it has no business with .obj models at all). I recommend that you guys use Blender or any other .obj modelling software directly instead of these "minecraft modelling programs" for anything that json files cannot do. Note: Faces in models (a cube has 6 flat faces aka sides. A 4-sided pyramid got 5 (4 triangles + bottom) etc) can only have 4 or less edges. More are not supported in Forge, and will either cause the model to render without the faces, or not render the model at all (have had both cases happen to me before)
  25. Well, using MCPBot, I can tell you that field_70122_E is onGround , however, I cannot find anything for the rest. For what version of Minecraft is this? In what classes did you find these?
×
×
  • Create New...

Important Information

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