Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. You will have to find the chest in the structure manually after generating it(again, look at the igloo example) and give it the loottable you want.
  2. You can use the structure blocks to save the structure into a format the game would recognize and then use built-in structure generation system to generate them from the resulting files. You can see an example in vanilla at ComponentScatteredFeaturePieces.Igloo.
  3. Well, don't. Static initializers are bad since you can't control the order in which your classes are loaded and thus your objects are instantinated which leads to a multitude of issues. BlockBase and alike abuse inheritance to simplify instantination which is not what inheritance is for. You can use a helper method that does the same but won't require your block to extend a BlockBase. All basic functionality is already included in the Block class, so there is no need for another layer of BlockBase. Additionally minecraft uses instanceof checks in many places which will be an issue to you if you are using a BlockBase class for things when you need to add new blocks which can't be an instance of BlockBase. You can use a switch statement, or if you want to use this one class for a lot of different instances then you can add a ResourceLocation to the constructor that would point to the registry name of your item and get the item from the registry on demand(probably caching it after doing so). I am not sure then. Could you provide a link to your github repository so I can debug this issue locally?
  4. Just... no. Don't interact with raw numerical IDs ever. They can and will change. What means "block of lava" in one world may mean "block of singularity matter infused with neutronium" in another and you would have no way to know beforehand. Just ditch the entire system and make a new one. Probably the one that would utilize structure blocks and structure files. Why did you upload files here? Create a git repository and link it here. People are not going to download random archives from the internet. What's with the java files anyway? Why do they have a comment before some lines indicating the line's number?
  5. us is a terrible modid, you have 64 characters available to you, don't use just two since it could lead to name collision. How did you upload your repository and why did you delete the .gitignore file? Your repository contains a ton of not needed stuff like the run directory. I doubt you own matthyfamily.com. Use a different package name. BlockBasic(or BlockBase really) is an antipattern. Do not abuse inheritance. Especially if thay may harm your project later. Don't use static initializers. Instantinate your stuff in the appropriate registry event. This is the cause of your error. Well, technically the cause of your issue is the fact that you never call the init method, but if you were doing things the conventional way you wouldn't need this method anyway.
  6. BlockBase is an antipattern, do not use it. Passing an item to the constructor of the block indicates to me that there are many things horribly wrong with your code since item registry event fires after the block one and as such your items must be instantinated after your blocks, which means one of two things - either you are using static initializers in which case don't and instantinate your things in the appropriate registry event or you are passing null to the drop item. What material are you passing to the block and what are you mining the block with? Consider that if the block is not mined by the correct tool and the tool is required to mine it then it will take a while to break it.
  7. That doesn't mean you need a custom fontrenderer class. See how vanilla does that in Minecraft#init
  8. You can use the default fontrenderer class provided by minecraft since yours has no changes made compared to it.
  9. Could you please elaborate? What do you mean by "register a picture"?
  10. Override Entity#applyOrientationToEntity and do whatever you need to the player's rotation there.
  11. I think what's happening here is your font is of a pretty high resolution and minecraft's textures by default have a linear interpolation on the minimization filter so when shrunk parts of the texture become transcluent. By default it looks like FontRenderer doesn't enable blend when rendering so alpha test takes care of the alpha values and the default value of the function set in place simply discards any texels with too low of an alpha value. What you can do is provide a custom implementation of FontRenderer that changes the alpha test function to a desireable one and enables blend before drawing.
  12. Don't necropost old threads. If you have an issue create your own thread. In any case as was told to the OP instantinate your block in a local variable. This is basic java.
  13. Hmm, I see. I think minecraft has a system to get a dynamic texture from a framebuffer but yeah, if that's your usecase then sure, it's fine. Your specified format is pos+uv+lmap+color yet you are specifying the data in a different order. The order matters. Also 255, 255 isn't fullbright weirdly enough. Use 240 instead.
  14. You don't need a TESR for "emissive quads", this is perfectly achievable with a custom IBakedModel implementation. Don't use GL directly. Use GlStateManager. You also don't need to do anything with the matrix here. Why? This if for GUI rendering. You can use a DynamicTexture for this, no need to operate with GL directly. You don't need to do that. You don't need to do that either since you are popping the matrix anyway. You are not specifying a normal vector anyway and the default one should already be normalized, there is no need to do this. You can use a format that specifies the lightmap and pass the fullbright lightmap coordinates manually.
  15. Your font doesn't support unicode, it's just one sheet of characters, likely within the 0-256 range, thus passing true to the unicode boolean argument makes no sense. Don't create a new font renderer instance every frame. You don't need a custom fontrenderer class here. You would also need to register your font renderer as a resource reload listener so it actually reads the glyphs from the texture. You need to do this at an appropriate time though.
  16. 1.7.10 is no longer supported on this forum. Update to a modern version of minecraft to receive support.
  17. The parameters to the tracker are range, frequency and whether or not to send velocity updates. Frequency is the rate at which the entity sends the data. 20 would mean it sends 1 update per 20 ticks. In your case it's 80 meaning it sends the data once per 80 ticks. Range is the range that the entity must be within in relation to a player to receive updates. The last parameter is self-explanatory. Don't use static initializers. Instantinate your stuff directly in the appropriate registry event. You can't reference client-only code in a common environment like the update method as it will crash the dedicated server. You must use a proxy for something like this. No, the fact that it is hidden behind a World.isRemote check doesn't stop the crash, it is still referenced. Standard JVM won't load the class until it is required, but I can't be so sure about third-party JVM implementations.
  18. You do not need to invoke Entity#move manually since it already does that for you in it's update method. Could you try a higher value in your second example? 0.001 is very low and minecraft already subtracts the motionY each tick to simulate gravity. As for the likely cause of your issue: All inputX fields are false and I don't see you changing them anywhere.
  19. Why are you using 1.11? Update. Don't use ITileEntityProvider, it is outdated and unnecesarry. Just override Block#hasTileEntity and Block#createTileEntity. Also blockbase is an anti-pattern. Don't invoke EntityPlayer#openGui on the client at all. Forge will do the networking for you. This is likely the cause of your issue. Your health property is lost upon (de)serialization. You should probably include this in your (de)serialization methods too. public int quantityDropped(Random random) { return 1; } The default implementation already returns 1. Why did you override it? MathHelper.clamp already returns an int. Why do you need to ask the Integer class to get the value from it? Same here. ...What? FULLNESS is static thus your IDE should be screaming at you for using this access keyword. Also why are you comparing it to the argument? You do know that Object#equals returns a boolean that indicates the result of comparing two objects. Same here. if (tileentity != null) { tileentity.validate(); worldIn.setTileEntity(pos, tileentity); } You don't need to do this. Just override TileEntity#shouldRefresh in your TE class. Actually you are already doing that so there is no need for this code at all. TileEntity already implements ICapabilityProvider. You don't need to add this interface again. Blocks are singletons. You can use @ObjectHolder to get the reference if you need it. int metadata = getBlockMetadata(); return new SPacketUpdateTileEntity(this.pos, metadata, nbt); This is not what that parameter wants from you. As you are using a modded TE you can pass anything to it. public BlockFoodDish getFoodDish() { return this.blockfooddish; } Again, blocks are singletons. You do not need to store a block reference in each instance of your TE. ...Why? It is already set to that.
  20. The problem here is that the rest of the game uses GLStateManager to change GL states and GLStateManager has it's own copy of each state value. Thus if you change a value through OpenGL's direct API the state manager and thus the rest of the game won't know about it and still think the old one is used.
  21. When enabling blend you need to specify the blending function otherwise it will default to the last one used which may not be desireable(which is what is happening in you case). Additionally it is better to set the GL states once before rendering everything and not everytime you need to render every quad. GlStateManager.pushMatrix(); GlStateManager.translate(0, 0, 0); Why? Why are you translating by 0,0,0? It does absolutely nothing. You do not need matrix interactions here at all.
  22. Looks like your version of mappings doesn't correspond to the one Cadiboo has used. You either need to use the same mappings or manually update the methods names.
  23. Unfortunately those blocks use a TESR and you can't really do this with a TESR. A possible solution would be to render a TESR onto a separate framebuffer, but then you would need a solution for blocks that use a FastTESR. It is possible in theory I suppose but you would have to look into the way vanilla+forge render TESRs.
  24. That's quite literally what readPixels is supposed to do - it reads the pixel values from the currently bound framebuffer. For the future you can read documentation about opengl methods here. For actually reading the pixel values from a texture you need to use getTexImage. Note that it will dump the entire texture onto the buffer though. You could render the part of the texture you need onto a framebuffer and read from that using readPixels but I don't think it is going to be faster than reading the entire texture.
×
×
  • Create New...

Important Information

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