Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TheGreyGhost

Members
  • Joined

  • Last visited

Everything posted by TheGreyGhost

  1. No worries At least it was an easy fix! -TGG
  2. Hi I suspect you might be right net.minecraft.entity.EnumCreatureType.<init>(java.lang.String, int, java.lang.Class, int, net.minecraft.block.material.Material, boolean) that constructor signature is for sure not right. Not that I know enough about reflection to tell what's going wrong. It might be worth a try changing this from a static initialiser to an explicit initialiser in preInit, just in case it's some strange initialisation order thing. Otherwise you could try submitting a possible bug report and seeing what response you get. -TGG
  3. Hi This line means that all your ooArmor instances will have the same texture public static String texture; -TGG
  4. Hi The problem is a common one in alpha blending, i.e. it depends which faces you render first. In your case, you probably have depth culling on, so if you draw the closest face first, the furthest face is hidden (culled) and not drawn at all. The best solution is to sort your faces so that you always draw the furthest faces first. Alternatively you may get acceptable results if you turn off writing to the depth buffer using GL11.glDepthMask(false); See here for some greater explanation http://www.minecraftforge.net/forum/index.php/topic,22368.msg113450.html#msg113450 http://www.minecraftforge.net/forum/index.php/topic,23237.msg117975.html#msg117975 -TGG
  5. Hi I think you might be confusing metadata with side? getIconFromDamage (eg see ItemCloth) can be used to "convert" the item damage into the block metadata, but I don't think this is what you want. I think you need to either choose your side orientations so that the default rendering (metadata = 0) shows the faces you want rendered in the inventory. You can override getIconFromDamage to return a different "fake" metadata for your block so that it renders the sides you want, if you're not actually using metadata for your item. FYI the rendering for ItemBlocks is done in RenderBlocks.renderBlockAsItem() -TGG
  6. Hi Some thoughts on point (2) I've had a fair bit of trouble trying to perform automated testing with minecraft because a lot of the classes are difficult or impossible to stub especially the ones with static methods or even worse a static singleton. Some things I've done that worked well: 1) Objenesis for instantiating vanilla classes without having to use one of the constructors - for stubbing, usually by extending the vanilla class with my own stub. 2) Junit for unit testing - this works great with my own classes which I can design to be testable 3) Mockito for mocks (haven't used much) I generally try to keep interaction with forge code as separate as possible, putting all the functionality into my own testable classes, then have an adapter class which subscribes to events etc and does nothing except call the appropriate method in one of the testable classes. This makes it a lot easier to test the classes independently. For other things which need to be tested in game, I have used a 'test' item that activates my test code when used, for example placing blocks in a given order, spawning entities, or executing a defined series of player actions, then checking for the correct result. A 'test world' saved game helps with this. You might try looking at Jetbrains' IntelliJ as an alternative IDE to Eclipse. It is really quite awesome. -TGG
  7. > Ok, I now used the GLMap methods and it works. keen. > Only one problem: show code? -TGG
  8. [12:31:30] [Client thread/ERROR]: Using missing texture, unable to load alchemyexchange:textures/blocks/waterinvolved_leaves_opaue.png What is the full path to your waterinvolved_leaves_opaue.png? And did you spell it opaque, actually? -TGG
  9. Hi What are your symptoms? i.e. what you do expect to see, what do you actually see? (screenshots would be helpful) Do you see a "using missing texture, unable to load" error message in the console log? -TGG
  10. Being a NURBS noob I'm for sure no expert but it looks to me like you can either use the glu methods, or the OpenGL 1.1 glMap2f methods. i.e. you don't need the glu methods. (Or - do the matrix maths yourself to generate the patches manually, if you don't go crazy on the number of patches it should be plenty fast enough) -TGG
  11. Hi A couple of comments I notice this in your GuiCuilGenerator protected int xSize = 247; protected int ySize = 165; That's bad news, you are hiding the xSize and ySize fields in the GuiContainer base class, so your class now has two fields called xSize; one that is seen by your GuiCuilGenerator code, the other that is seen by GuiContainer. I think that's asking for trouble. As for the drawing location, you are overriding initGUI() which is responsible for setting guiLeft and guiTop, but you didn't call super.initGUI, so the guiLeft and guiTop are still zero. -TGG
  12. GL11.glMap2f? http://www.glprogramming.com/red/chapter12.html -TGG
  13. Hi Although you're not using static variables any more, it won't help because Blocks are "singletons" anyway. A Block instance stores information about the capabilities of a block, not about the state of the block. Minecraft uses metadata for that. http://greyminecraftcoder.blogspot.com.au/2013/07/blocks.html Since you've figured out how to receive redstone signal, I'd suggest the easiest way is probably to store the redstone signal status in the block metadata. When you render the block, retrieve the metadata and change your render based on that. BlockTrapDoor does this, for example. Cheers TGG
  14. :-P well to be honest actually I'm just figuring this out as I go, plus a bit of background knowledge I wouldn't want to rob you of the satisfaction of a thrilling voyage of discovery For me, a lot of the fun of programming minecraft is trying to pick my way through this incomprehensible swamp of vanilla code until it finally goes 'click' in my head and I understand how it works. I think it's a very important skill for anyone who's going to try something more complicated than a new Block and a couple of recipes... If you just need text, that's relatively simple; you could try looking into the FontRenderer. It's scattered all throughout the vanilla code, for example the debug screen in Minecraft.displayDebugInfo; or the number of items in an itemstack in RenderItem.renderItemOverlayIntoGUI() -TGG
  15. I doubt you will find a step-by-step tutorial What you need is in MapItemRenderer: DynamicTexture created, returns an int [] which is then overwritten directly by the RGB data. Bind Dynamic texture when rendering. -TGG
  16. Hi The logic for constructing portals is in BlockPortal (in Size, onNeighborBlockChange), initially called from BlockFire.onBlockAdded I don't think there is a hook, I reckon you will probably need to use ASM + Reflection to modify the BlockPortal code to stop it opening at all. There are a couple of tutorials on that around, it needs some reasonably advanced Java knowledge to get it to work. -TGG
  17. Hi It's a mystery to me... I would suggest you put a breakpoint at your line 74 and trace into the vanilla code to see what's happening in the ResourceConstructor and the resource managers. -TGG
  18. Hi What I did for a couple of textures: put file in resources/assets/mymod/textures/other/mytexturename.png and in my class private final ResourceLocation ringTexture = new ResourceLocation("mymod", "textures/other/mytexturename.png"); -TGG
  19. Hi coords is a reference, so each time you put coords into your hashmap, you're putting the same variable in there, not a copy of what coords has at the time. On your second pass through the loop, you change your coords array, which alters not only the coords variable but also the reference that you previously put into the hashmap. Your watch shows this, i.e. the value for both entries is int[] = {int[2]@6530}, i.e. it's the same location. You need to put a new int [] into the hashmap each time. -TGG
  20. You can achieve this to some extent using your proxy class; http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html this can sometimes be very useful especially for packet handlers where any references to vanilla client code, even if you never execute that code path on the server, will cause a crash. Personally I think .isRemote is the easiest to understand and debug. I think that if I need to worry about whether my Class is being instantiated twice or only once, then I'm probably overcomplicating things and increasing the chances of logical vs physical server bugs. -TGG
  21. Hi As what dieSieben said, plus a few other ways listed here http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html -TGG
  22. Hi For the rendering, look into TileEntitySpecialRenderer. You can use a model in there, like gummby8 said. To move the player, you can change the player's speed by manipulating their .motionX, .motionY, .motionZ (eg player.motionX += 0.2) or their position by changing their posX, posY, posZ -TGG
  23. Hi Some of the vanilla TileEntities do this (for example TileEntityBeacon) Key places to look are: TileEntityBeacon:: public Packet getDescriptionPacket() (-->S35PacketUpdateTileEntity) public void readFromNBT(NBTTagCompound p_145839_1_) public void writeToNBT(NBTTagCompound p_145841_1_) and since your TileEntity isn't vanilla you will also need the Forge method TileEntity:: public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) -TGG
  24. Hi ItemDye is a good vanilla example to look at. Alternatively, if your Items are actually ItemBlocks, look at BlockColored -TGG
  25. Hi Try looking in the console output for "using missing texture unable to load" and post it here, along with your ResourceLocation statements? -TGG

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.