TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Class.getClass().getResource() working in Eclipse but not when compiled
TheGreyGhost replied to ss7's topic in Modder Support
Hi That path looks correct to me, because your lang resources are packaged inside a zip file. Vanilla uses a different code to retrieve files depending on whether they're in a folder in a zip file. See FileResourcePack.java (and ZipFile.java). Never used it myself so that's about all I know. -TGG -
Hi I had a quick look through your code. You didn't show your TileEntityExtractor, is TileEntityExtractor.direction static by any chance? -TGG
-
[Solved] Damages base items with an overlay texture
TheGreyGhost replied to Casual Dutchman's topic in Modder Support
Hi Yes you can, suggest using an IItemRenderer and rendering first one icon then the second. See here for more details (the sections on items, including sample code) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG -
Hi If you want to use the cocao rendering code to render your new block, you will need to make your new block extend BlockCocao instead of whatever it's currently extending, so that the cocao rendering code can work with it. If that won't work for you, alternatively you could copy the cocao rendering code into your own renderer (eg ISimpleBlockRenderingHandler). Some more information here- http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html and there is also some sample code here http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html (look at the BlockPyramidRenderer section) -TGG
-
Hi see also http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html for ways to get a subset of all players (eg all players in a particular dimension) -TGG
-
[SOLVED] Tessellator - already tessellating error
TheGreyGhost replied to Enkey's topic in Modder Support
Hi Sounds like it might be rendering but not in the place you expect. Suggest to try // comment this out tes.setTranslation(x, y, z); ResourceLocation textures = (new ResourceLocation(Reference.modid + ":textures/models/LEDStrip.png")); Minecraft.getMinecraft().renderEngine.bindTexture(textures); tes.addVertexWithUV(x, y, z, 0, 1); tes.addVertexWithUV(x, y+1, z, 0, 0); tes.addVertexWithUV(x, y+1, z+1, 1, 0); tes.addVertexWithUV(x, y, z+1, 1, 1); -TGG -
Hi unfortunately I've never used AML so I'm kind of stuck there. The caller has set up the coordinates so that you should draw the block from [x,y,z] to [x+1, y+1, z+1]. But it sounds like you're doing that already? -TGG
-
[SOLVED] Tessellator - already tessellating error
TheGreyGhost replied to Enkey's topic in Modder Support
Hi From looking in EntityRenderer.renderWorld I think this should work: Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); -TGG -
Hi My suggestion: write an ITickHandler that, every (say) 5 seconds checks the player's armour and if it's not correct, damages the player. It should run server-side only. You don't need to create your own player instance. Your code can get access to all players on the server side from WorldServer.playerEntities and WorldServer you can get from MinecraftServer.worldServerForDimension or DimensionManager.getWorld(par1); (see http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html) {Actually after reading dieSieben's answer I think his is better than mine.} -TGG
-
[SOLVED] Finding Held item in LivingDrops Event
TheGreyGhost replied to Eragonn1490's topic in Modder Support
Hi try player.inventory.getCurrentItem(); where you get player from event.source.getEntity() -TGG -
Help with running delays in a block class.
TheGreyGhost replied to happyPenguin's topic in Modder Support
Hi In order to do a delay, you will need to wait a number of ticks (the game calls the "tick" 20 times a second). You can't just stop the code for (say) 2 seconds because that will stop everything for 2 seconds, which is not what you want. There are a few ways, perhaps the easiest is Block.updateTick (see BlockRedstoneLogic). Your block will need to schedule itself to receive ticks (eg World.scheduleBlockUpdate) - see BlockRedstoneLogic. Alternatively you could run it all from an ITickHandler. Depends on the behaviour you want. -TGG -
[SOLVED] Finding Held item in LivingDrops Event
TheGreyGhost replied to Eragonn1490's topic in Modder Support
Hi I don't really understand your question. Could you describe in a bit more detail what you want to happen? eg "When you hit a cow while holding a butcher's cleaver it should drop a steak" -TGG -
[Unsolved] Error "Registering texture" Crash report
TheGreyGhost replied to SackCastellon's topic in Modder Support
Hi Busti means This line: java.lang.NullPointerException at SackCastellon.betterwood.items.MetaItemSoup.registerIcons(MetaItemSoup.java:98) tells you that you are giving a null variable to something which doesn't expect it. A null variable usually means you have forgotten to initialise it (it is empty). I suggest you should check your .texturePath, .texture and textureNames again, I think Busti is right. Do you know how to use the debugger? If so I'd suggest putting a breakpoint at MetaItemSoup.java:98 and inspecting textureNames etc to make sure it matches what you expect. If not, you could add the following code instead for (int i = 0; i < 4; ++i) { System.out.println("TextureNames[" + i + "] = " + TextureNames[i]); // similarly for TexturePath this.Texture[i] = par1IconRegister.registerIcon(TexturePath + this.getUnlocalizedName().substring(5).toLowerCase() + "/" + (TextureNames[i].startsWith("EBXL") ? "ebxl/" : "vanilla/") + (TextureNames[i].startsWith("EBXL") ? TextureNames[i].substring(5) : TextureNames[i])); } One thing I notice about your code too - the convention in Java is to use camelCase for instances of your classes. so for example class MyTestClass { // -- -etc }; MyTestClass myTestClassInstance = new MyTestClass(); instead of MyTestClass MyTestClassInstance = new MyTestClass(); -TGG -
Hi A couple of thoughts - your TileClient member variables will be reset every time the chunks are reloaded unless you add them to the constructor and save them to NBT. See for example TileEntityPiston - when/from where is your updateSides method called? - is there any reason your renderer can't just check the six adjacent blocks every time before it renders? -TGG BTW this link might help with background information about what @SideOnly does... as MineMaarten says, it's actually nothing to do with Server-side vs Client-side code. It's Client-with-integrated-server vs Dedicated Server. http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html
-
Hi The caller has already called Tessellator.startDrawingQuads before your IBSRH is called. And it will call Tessellator.draw() afterwards. So if you add Tessellator.instance.draw() to the start of your IBSRH method, and Tessellator.instance.startDrawingQuads() to the end of your IBSRH, I think it will solve your problem. -TGG
-
[SOLVED] Tessellator - already tessellating error
TheGreyGhost replied to Enkey's topic in Modder Support
Hi Well we're making progress... I didn't have this problem in my own ISBRH renderers so far, but perhaps you need to undo some of the setting changes you are making (setTranslate, texture, etc). I'd suggest removing them one by one and seeing which one(s) are causing the weirdness. And come to think of it, I don't think you need setTranslate, the caller should have done that for you. Setting it to 0,0,0 might actually be causing your problem. Something else to be aware of - if your block has transparent bits (is not a full, opaque cube), you need to override isOpaqueBlock to return false. http://4.bp.blogspot.com/-F0FTLzenidU/UfKBs19w_rI/AAAAAAAAABw/nxNmavM7sd4/s1600/StandardBlockWithAlpha-1.png -TGG -
crikey that is weird sorry dude, I have absolutely no clue. You might have some luck asking in an OpenGL forum somewhere? -TGG
-
Hi I actually have no clue what's causing the bug. But some suggestions - does it change if you change the order of your registering? Or if you just register the one you want to test? If it were me, I would put a breakpoint in WorldServer.spawnRandomCreature, then trace into it until you get to BiomeGenBase and can have a look at the spawnableCreatureList and see what happens to it - why your chicken is never selected, or why it's selected but never gets spawned. (You can increase the weightedProb parameter to something large, to make sure your desired chicken gets selected from the list of possible spawns). -TGG
-
[SOLVED] Tessellator - already tessellating error
TheGreyGhost replied to Enkey's topic in Modder Support
Hi The caller has already performed tes.startDrawingQuads(); for you. Delete that line and it should be fine. You can't do two startDrawingXXX in a row without a draw between them (and vica versa too) -TGG -
Hi I think you are right, you are having synch issues. Containers are tricky to get right (at least, tricky for me), so I would suggest you start with the code from a vanilla container (eg ContainerRepair, or ContainerWorkBench), copy it to a new class of your own, make sure it still works, then introduce one small change at a time until it has all the features you want. -TGG
-
Hi When you place the star, you have to save the coordinates somewhere. Then, in the PlayerSleepInBedEvent, retrieve the coordinates and do your setBlock. A good place might be in the player, i.e. you record the location of the last start that they placed. -Suggest getting an NBTTagCompound from EntityPlayerMP.getEntityData() and using that - so it will get saved automatically. You would need to do this on the server side, not the client. Alternatively, if that's too hard, you could just use a static variable in a class somewhere ( it won't survive a save, but perhaps you don't care about that) Nice idea by the way, I like it! -TGG
-
Hi It also took me a while to properly understand what the Forge tutorial was doing. This link might help explain it a bit, in case it's not clear. http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
-
Hi I once saw something very similar when I rendered two faces on top of each other (like you are doing) with back face culling off. Perhaps try GL11.glEnable(GL11.GL_CULL_FACE); before your rendering Alternatively, you could use Techne instead of the tessellator, much more user-friendly than Tessellator... http://techne.zeux.me/Techne -TGG -TGG
-
Adding a nausea/confusion effect without adding the potion effect
TheGreyGhost replied to Gwafu's topic in Modder Support
Hi That's true, and if you can find any which would intercept the vanilla code at the correct location, please let me know because I'd be very interested :-) -TGG -
Hi I suspect that it might be a more general problem caused by alpha blending rendering. It's important to render the polygons in reverse depth order (from furthest to nearest) when performing alpha blending rendering, otherwise the results aren't right (see the first few paragraphs of http://www.openglsuperbible.com/2013/08/20/is-order-independent-transparency-really-necessary/ ) I don't know an easy way to solve it. You could perhaps try rendering as two models, one with all the opaque bits, then one with all the smoky glass. Or alternatively, come up with four models with defined rendering order, that you switch between depending on the viewing direction. But that's a pure guess and I actually have no idea if it will work! Let us know if you crack it yeah? :-) -TGG