TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi EntityFX might look like Entity, but they're not. You should 100% never spawn them on the server. Something like this code, executed on the client only, should work just fine. It does for me. FlameBreathFX flameBreathFX = new FlameBreathFX(world, x, y, z, velocityX, velocityY, velocityZ); Minecraft.getMinecraft().effectRenderer.addEffect(flameBreathFX); where public class FlameBreathFX extends EntityFX { } -TGG
-
Hi It looks to me like your performAction method is being called on the server, in which case this code gets executed on the server, which is bound to cause trouble Minecraft mc = Minecraft.getMinecraft(); ... mc.effectRenderer.addEffect(..); You need to make sure you only spawn EntityFX on the client. -TGG
-
[1.7.10] Why doesnt this work?
TheGreyGhost replied to BoonieQuafter-CrAfTeR's topic in Modder Support
Hi Did you try spawning 5 blocks above the ground, just to make sure the spawning works? Did you try the System.out.println() in your code to verify that the spawning method call is being run (and is being run on the client)? Cheers TGG -
Problems with creating block(More in first line)
TheGreyGhost replied to Lightspeed360's topic in Modder Support
Dude... harsh! I think what KakesRevenge means is that by Java convention, rock is assumed to be an instance of Rock. In this case it's not, which is confusing. Perhaps you should rename rock to be rockBlock or lrBlock instead. I see you've already created your own block class LrBlock, just override LrBlock.isOpaqueBlock() to return false, as 61352151511 said. -TGG -
[1.8] Entity#getExplosionResistance bugged?
TheGreyGhost replied to coolAlias's topic in Modder Support
I would say its probably a bug Maybe something to do with legacy code, which had posY different between client & server, so you had to add eyeHeight on one side but not the other. -TGG -
Hi The basic idea is to shoot a 'ray' (a line) from the player's eyes. You can see the full algorithm in action in World.rayTraceBlocks(). You can imagine a grid of cubes around the player, say like glass blocks. The ray trace algorithm starts at the player's eyes, starts moving in the direction that the player is looking, and finds the first side of the "glass block" that the ray hits. If it's a solid block, it stops. If it's not solid, it continues the ray through the block to find out which side the ray exits, then checks that block. It keeps doing that until either it hits something or the ray gets too long. When the ray enters a more complicated blocks (say like a torch), it will check to see whether the ray actually hits the torch, or whether it misses and passes through to the next block. That's what Block.collisionRayTrace does. For most blocks, they just need to set their bounds correctly and the vanilla code does the rest. In your case, you will probably need to do a "sub-block" ray trace. BlockStairs is a good example, although it's a bit optimised so it's harder to follow. A simpler algorithm for you would be "test every side of every sub-cube to see if the ray intersects it (similar to the super method). It will probably be fast enough already, and if it isn't, you'll have a good test case for when you develop a faster implementation. -TGG
-
[1.8] Access Item Rotation / Translation From .JSON Model
TheGreyGhost replied to EverythingGames's topic in Modder Support
Hi I haven't seen any tutorials (but I haven't looked either ) coolAlias has a snippet here http://www.minecraftforge.net/forum/index.php/topic,30873.msg160542.html#msg160542 You could perhaps base your code off this tutorial project https://github.com/TheGreyGhost/MinecraftByExample and adapt one of the "smart" models to be IPerspectiveAwareModel - for example MBE04. It will probably take a bit of stuffing around to get it to work as you expect, so be prepared for frustration I think. -TGG -
[1.8]Render A TileEntity as A 3D Item like in 1.7?
TheGreyGhost replied to ItsAMysteriousYT's topic in Modder Support
I believe the Forge code purity police removed all posts relating to that Why do you want to use a TileEntitySpecialRenderer for your item? -TGG -
[1.8] Access Item Rotation / Translation From .JSON Model
TheGreyGhost replied to EverythingGames's topic in Modder Support
Hi I think you can use IPerspectiveAwareModel to do this now. I haven't tried it yet but it looks like it should work. -TGG -
[1.8] Problems with breaking particles of multitextured blocks
TheGreyGhost replied to Mistram's topic in Modder Support
Hi There is no texture called "blocks/bricks", you've made a spelling mistake. Do you know how to browse the minecraft assets folder to find the correct name? Either open up the forgeSrc-1.8- library, or look in the assets/minecraft folder under windows explorer -TGG -
[1.8] Problems with breaking particles of multitextured blocks
TheGreyGhost replied to Mistram's topic in Modder Support
HI blockorientable looks like this { "parent": "block/cube", "textures": { "particle": "#front", "down": "#top", "up": "#top", "north": "#front", "east": "#side", "south": "#side", "west": "#side" } } When you use blockorientable as the parent model for your block, you need to define the textures front, top, side. If you want to define up, down, north, south, west, east and particle (not particles!) use cube as the parent model. -TGG -
[SOLVED][1.8] SmartblockModel weirdness (TheGreyGhost)
TheGreyGhost replied to Reygok's topic in Modder Support
Hi Forge only expects your model to have one loader. FOr example - Forge finds octablocks:tinyCobblestone, and looks through the custom loaders. ModelLoaderTinyDirt.accepts() says "yes I am the one who should load that" but also ModelLoaderTinyCobblestone.accepst() says "yes I am the one who should load that". If it has two loaders, how does it know which one it should use for the model? I'd suggest you use just one loader for your 'octablocks' and return the right IModel based on the modelresourcelocation. -TGG -
Hi Try matching upper and lower case. Also http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
-
[1.8] Load .obj Models like in 1.7?
TheGreyGhost replied to ItsAMysteriousYT's topic in Modder Support
Or you can port the 1.7.10 code to 1.8, it is very straightforward eg https://github.com/TheGreyGhost/dragon-mounts/tree/PortTo1-8/src/main/java/info/ata4/minecraft/dragon/client/forgeobjmodelported -TGG -
[1.8] Problems with Customblock Rendering
TheGreyGhost replied to Kavaeron's topic in Modder Support
Hi Have you tried this troubleshooting guide? http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html It shows the most common 'missing texture' problems. You seem to be have a variety of problems - one is because the texture is not found. The second is that you are mixing up rendering a block model with rendering a TileEntity model, the two are very different. Does your RendererTisch render method get called? [14:16:51] [Client thread/WARN]: Unable to resolve texture due to upward reference: #crop in minecraft:models/block/crop Your block model file doesn't define the crop texture. [14:16:51] [Client thread/ERROR] [FML]: Model definition for location fruitsmodpro:Tisch#inventory not found [14:16:52] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= [14:16:52] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found. [14:16:52] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Your item's Tisch model file is either not defined, has the wrong name, or isn't registered properly You might find this example project useful, it contains examples of simple blocks (MBE01) and a TileEntitySpecialRenderer (MBE21) https://github.com/TheGreyGhost/MinecraftByExample -TGG -
That's odd. I don't get that alpha behaviour. I don't think you need to modify the Tessellator to draw triangles. Just use .startDrawing(GL11.GL_TRIANGLES) instead of .startDrawingQuads(); Then add points in groups of three instead of groups of four. It sounds like you need to set up the lighting properly before rendering. This link has a bit of info. http://greyminecraftcoder.blogspot.com.au/2014/12/lighting-18.html You generally need to properly set the lighting on/off, the multitexturing "mixedBrightness" (blocklight/skylight), and sometimes also the render colour depending on how you're doing the rendering. This class might also help with some ideas: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe21_tileentityspecialrenderer/TileEntitySpecialRendererMBE21.java -TGG
-
Hi You could try using the approach in dynamic lights (he uses ASM+Reflection to modify vanilla). The source code is inside the download. -TGG
-
[1.7.10] When/where spawn particles on client???
TheGreyGhost replied to Elix_x's topic in Modder Support
Hi This is 1.7.10 yeah? I suggest first thing is to comment out this for(int i = 0; i < particleAmount(); i++){ world.spawnParticle(getParticle(), entity.posX + randomRangedPNDouble(getParticlePosRandomizerRange()), entity.posY + randomRangedPNDouble(getParticlePosRandomizerRange()), entity.posZ + randomRangedPNDouble(getParticlePosRandomizerRange()), look.xCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange()), look.yCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange()), look.zCoord * 10 + randomRangedPNDouble(getParticleVelocityRandomizerRange())); } and replace it with (going from memory here) world.spawnParticle("smoke", entity.posX, entity.posY, entity.posZ, 0.05, 0.05, 0.05); That should help narrow down the possible problems -TGG -TGG -
Hi Yeah I tried it just the other day (in 1., seemed to work fine - my particle whites were still white. FXLayer 1 only seems to affect which texture is bound (i.e. the block texture for layer 1). Any colour filtering you're seeing might be happening in the EntityDiggingFX or similar? Or alternatively, because world lighting is being applied? If you don't want that to happen, your EntityFX must override public int getBrightnessForRender(float p_70070_1_) Keen looking forward to your tutorial -TGG
-
[1.7.10] When/where spawn particles on client???
TheGreyGhost replied to Elix_x's topic in Modder Support
Hi It should work fine to spawn particles on client in ClientTick, RenderTick, WorldTick, or anywhere else actually. Perhaps you are spawning them at the wrong location, or they are invisible. Show code? -TGG -
[1.8] Crafting Recipe java.lang.NullPointerException?
TheGreyGhost replied to TheImpure1's topic in Modder Support
Hi One of the objects on this line in your code hasn't been initialised properly (is still null) at impure.explorer.crafting.ExplorerCrafting.init(ExplorerCrafting.java:195) Some background info on debugging Null Pointer Exceptions... http://webcache.googleusercontent.com/search?q=cache:http://www.terryanderson.ca/debugging/run.html&gws_rd=cr&ei=JAaFVZGwJ6fHmAXbzK7ICQ Be quick before it disappears... -TGG -
Hi After fiddling with EntityFX for a couple of days, I think you might be better putting your EntityFX onto layer 1, and adding your WellingFXTexture to the texture map using TextureStitchEvent.Pre eg public static void preInitClientProxyOnly() { MinecraftForge.EVENT_BUS.register(new TextureStitcherBreathFX()); } public class TextureStitcherBreathFX { @SubscribeEvent public void stitcherEventPre(TextureStitchEvent.Pre event) { ResourceLocation flameRL = new ResourceLocation("minecraftbyexample:entity/flame_fx"); event.map.registerSprite(flameRL); } } and public FlameFX(World world, double x, double y, double z, double a, double b, double c, float size, int age) { super(world, x, y, z, a, b, c); // set the texture to the flame texture, which we have previously added using TextureStitchEvent TextureAtlasSprite sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraftbyexample:entity/flame_fx"); func_180435_a(sprite); @Override public int getFXLayer() { return 1; } -TGG
-
Hi This link talks more about mining blocks. http://greyminecraftcoder.blogspot.ch/2015/01/mining-blocks-with-tools.html When you say "I can still mine it with stone." do you mean a) "The block breaks when I stone pickaxe it" or b) "The block breaks when I stone pickaxe it, and gives me ore". setHarvestLevel should stop (b) but not (a) -TGG
-
[1.7.10] how to emit light from a held item
TheGreyGhost replied to BoonieQuafter-CrAfTeR's topic in Modder Support
Hi This mod does exactly what you want. It is quite awesome. Best thing is, it is specifically designed so that your mod can communicate with it eg to turn the hand-held light on & off. http://atomicstryker.net/dynamiclights.php THe source code is inside the download file. -TGG