Everything posted by TheGreyGhost
-
[1.7.10] Armor have all the same texture [SOLVED]
No worries At least it was an easy fix! -TGG
-
[1.7.2] Crash When Adding New Creature Type UPDATED: [New Issue 1.7.10]
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
-
[1.7.10] Armor have all the same texture [SOLVED]
Hi This line means that all your ooArmor instances will have the same texture public static String texture; -TGG
-
[1.7.10]Rendering Custom Rendered Block - Alpha Problem
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
-
Inventory Block Metadata [UNSOLVED] [1.7]
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
-
Debugging with other mods / Unit Testing / CI?
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
-
[Solved] Rendering a NURBS Curve
> Ok, I now used the GLMap methods and it works. keen. > Only one problem: show code? -TGG
-
[1.7.10] Why does the texture don't render?
[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
-
[1.7.10] Why does the texture don't render?
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
-
[Solved] Rendering a NURBS Curve
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
-
[Solved] [1.7.10] Block Container issue with Slot shfiting
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
-
[Solved] Rendering a NURBS Curve
GL11.glMap2f? http://www.glprogramming.com/red/chapter12.html -TGG
-
Animated Model Problem
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
-
how to build an item that can dynamically change its texture?
:-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
-
how to build an item that can dynamically change its texture?
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
-
[SOLVED] Stop Nether Portal From Opening
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
-
Slash not detected by render engine
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
-
How to load external texture for a Block
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
-
General bugfix question
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
-
[1.7.10] SideOnly vs FMLCommonHandler.getSide
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
-
getting all players in a server
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
-
360° Rotation of Blocks
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
-
Tile entity syncing
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
-
[1.7.10]Adding an item with metadata to the Creative Tab List?
Hi ItemDye is a good vanilla example to look at. Alternatively, if your Items are actually ItemBlocks, look at BlockColored -TGG
-
[1.7.10] Compiling the mod but not all textures
Hi Try looking in the console output for "using missing texture unable to load" and post it here, along with your ResourceLocation statements? -TGG
IPS spam blocked by CleanTalk.