Everything posted by TheGreyGhost
-
What does this all mean?
Hi It might be because your Newt package starts with a capital letter (which goes against java coding style conventions), or because your mod id is Newt or NeWt and the gradle build script is being "helpful" FYI http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s5-naming in case you didn't see it before, I for sure found it helpful coming from a C++ background. Personally I make my modid, all my resources, folders, packages, resource filenames lower case because I kept having these kinds of problems. It was a real pain with Git/GitHub because it ignores case and the only way I could get my filenames to change to lower case was to rename them to something totally different, commit and push, then rename to the lower case and commit and push again (if there's a "case sensitive" option I didn't find it...) -TGG
-
Modifying death message handling
Hi The death messages come from the .lang file, eg death.attack.lava=%1$s tried to swim in lava I think the code that reads the death message is in DamageSource as you said. public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) { EntityLivingBase entitylivingbase1 = p_151519_1_.func_94060_bK(); String s = "death.attack." + this.damageType; String s1 = s + ".player"; return entitylivingbase1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {p_151519_1_.func_145748_c_(), entitylivingbase1.func_145748_c_()}) : new ChatComponentTranslation(s, new Object[] {p_151519_1_.func_145748_c_()}); } When the player dies, this code in EntityPlayerMP is called, which eventually gets to the method above public void onDeath(DamageSource p_70645_1_) { if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; // you can hook in here using LivingDeathEvent this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); What do you mean "overriding" getDeathMessage()? Show the code you tried? -TGG
-
[solved][1.7.10] Some explosions not animating
Hi No problem The reason it doesn't send a packet is easy to miss World.createExplosion calls World.newExplosion On the client, this executes the code you copied, but on the server, it is overridden by WorldServer.newExplosion public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; explosion.doExplosionA(); explosion.doExplosionB(false); if (!p_72885_10_) { explosion.affectedBlockPositions.clear(); } Iterator iterator = this.playerEntities.iterator(); while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer)iterator.next(); if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D) { ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer))); } } return explosion; } -TGG
-
[solved][1.7.10] Some explosions not animating
Hi I think you need to trigger the explosion on the server only, and not on the client. If you do it right (WorldServer.newExplosion() or .createExplosion(), I think), the server will then send a packet (S27PacketExplosion) to the client and everything will synch itself up properly. You also need to remember that the server has only one SuperItem but lots of players. Which means that if more than one player is using an egg, they will explode the wrong egg. You need to store a last egg for each player. -TGG
-
Collision Baxes And Rot. Angles
Hi You could try looking at Vanilla code which does this BlockSlab might be a good one if your block is basically like a cube with one or more of the faces chopped off shorter ; setBlockBoundsBasedOnState() and perhaps addCollisionBoxesToList() -TGG
-
What does this all mean?
No worries, sometimes there's subtle stuff which it's easier just to start again > Also what would cause the textures to load fine in the dev environment but not load once the mod is packaged? I've had this twice before; Once was because I put the textures in the wrong folder and they weren't packaged into the jar properly Once was because the file capitalisation didn't match exactly. Windows ignores file upper/lower case, but packaged mod doesn't, so for example MyBlockTexture.png and myblocktexture.png are interchangeable in the dev environment, but not when packaged. -TGG
-
Collision Baxes And Rot. Angles
Collision boxes are always aligned to the x,y,z axes (that's what "AxisAlignedBoundingBox" means), so you just need to change the x, y, or z sizes. Post some code / pictures of what you're trying to do? -TGG
-
What does this all mean?
Hi Unfortunately I don't have the time to look deeper right now; but if your earlier versions worked ok, I'd suggest you find the latest one you know worked (version history in Git?) and look carefully to compare your main mod file NeWt and constants file. The problem is almost certainly there. Forge wasn't even able to load your main class which is pretty much the first thing it does with your code. -TGG
-
What does this all mean?
Hi That capitalisation NeWt is odd. Are you sure it matches the actual filename? Show your code? -TGG
-
[1.7.10] Forcing the player to sink in water.
Hi I think the "swim upwards" is handled in EntityLivingBase.onLivingUpdate(): if (this.isJumping) { if (!this.isInWater() && !this.handleLavaMovement()) { if (this.onGround && this.jumpTicks == 0) { this.jump(); this.jumpTicks = 10; } } else { this.motionY += 0.03999999910593033D; // swim up here } } else { this.jumpTicks = 0; } This tricky bit will be to disable this without affecting all other entities as well. You can probably use ASM+reflection to intercept this call (don't know exactly how to be honest) and check for whether the player is holding your 'sink' item, or alternatively you might be able to cancel it out by copying the "am I swimming?" code above into your item onUpdate and using it to subtract 0.04 from motionY, or possibly into the player update tick event (eg PlayerTickEvent pre or post) if the item onUpdate doesn't work. You could also try disabling the jump key or overwriting isJumping or similar, if you can find a hook in the right place (i.e. between when the field is set and when it is used by the swim code) -TGG
-
[Solved][1.7.10] Unwanted "background" with custom item renderer
No worries, glad I could help
-
[Solved][1.7.10] Unwanted "background" with custom item renderer
Hi I reckon it might be an OpenGL render setting carrying over from the last thing that got drawn. Alpha test is a typical suspect, there are others. I wrote a small tool that I've used in the past to check what the OpenGL settings are; it's not complete, but dumpAllIsEnabled() works and has showed up problems for me before- dump for a good render, dump for a bad render, and spot the difference. It might be worth a go. https://github.com/TheGreyGhost/SpeedyTools/blob/master/src/speedytools/common/utilities/OpenGLdebugging.java -TGG
-
my ore textures not rendering ingame or generating ingame
Not sure I understand the problem, if I got it right: 1) you get the "missing texture" error and black-and-pink texture for your nickelingot.png 2) in the creative tab, your other ores show up fine but when you place them in the world you don't see anything? 1) is probably because there's no nickelingot.png in src/main/resources/assets/aerocorp/textures/items For (2), what do you see? anything at all? are you sure the block is there? -TGG
-
my ore textures not rendering ingame or generating ingame
Hi This link might help http://www.minecraftforge.net/forum/index.php/topic,18371.msg92948.html#msg92948 -TGG
-
Malformed JSON in mcmod.info
That's strange JSON validator likes it no problem http://jsonlint.com/ Mine starts like this and it works fine. [{ "modid": "speedytoolsmod", "name": "Build Faster Mod", .. etc .. }] Some strange problem with carriage return / line feed perhaps? Line 1 column 5 doesn't seem to exist. Perhaps try pasting it into notepad and saving again to make sure it's just text. If it were me, I would try set a breakpoint at cpw.mods.fml.common.MetadataCollection.from(MetadataCollection.java:55) [MetadataCollection.class:?] and then trace in using the debugger to see why the JsonReader thinks it's malformed. -TGG
-
How would I check for a type of block at a specific location?
Hi As Larsgerrits says, in this case myBlock is Blocks.chest For others, look in Blocks eg public static final BlockChest chest = (BlockChest)Block.blockRegistry.getObject("chest"); -TGG
-
how to make a fluid tank render
RenderBlocks.renderBlockLiquid() has something similar to what you want (not in a TESR admittedly) If you read that link I posted you should find it pretty straightforward to change the height of your liquid block. This TESR tutorial is short but will get you started http://www.minecraftforge.net/wiki/Tile_entity_special_renderer -TGG
-
how to make a fluid tank render
Hi Since it's a TileEntity already, I would suggest using a TileEntitySpecialRenderer. Google should show a few examples, also the vanilla code. In the renderer, assuming the water is a cube, you can use Tessellator commands with a variable height to change the height of the cube http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG
-
Block Textures With alpha?
Ah oops, sorry http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html hint: Block.canRenderInPass() -TGG
-
Block Textures With alpha?
Hi You might find this link helpful for background information http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html [ninja edit!} -TGG
-
Direct rotation (not "smooth" and prettier 359 -> 0)
Hi I still don't understand your question, but a random idea: try setting prevRotationYaw as well as rotationYaw. -TGG
-
Moving the player forward naturally [1.7.10]
Hi No worries you're welcome The vanilla Keybinding.ispressed is private by default. If you want to make it public, you can use an access transformer. http://www.minecraftforge.net/wiki/Using_Access_Transformers Actually I had to do exactly the same thing for a mod I'm working on; my speedytoolsmod_at.cfg contains just this single line public net.minecraft.client.settings.KeyBinding * # All fields After modifying your gradle.build you'll need to run gradlew clean setupDecompWorkspace eclipse --refresh-dependencies. After that the fields should be public. You can also use Reflection. It might be easier (or might not) - I've never used it. The access transformer worked fine for me. -TGG
-
Detect all nearby entities to player and then shoot lightning at them
Hi EntityPotion.onImpact() has a good example of this entity.posX, .posY, .posZ contain the position. -TGG
-
Moving the player forward naturally [1.7.10]
Hi You might find this link useful http://greyminecraftcoder.blogspot.com.au/2013/10/user-input.html It's a bit dated (1.6.4) but most of it is still the same (apart from the packet names) and it should show you where to look in vanilla. -TGG
-
Custom door block, having trouble with texturing [SOLVED]
Hi Is there only one door? Did it render correctly? Try adding a bit more info to the println, eg if (isUpper){ System.out.println("Upper at [" + x + ", " + y + ", " + z + "] side " + p_149673_5_); } else { System.out.println("Lower at [" + x + ", " + y + ", " + z + "] side " + p_149673_5_); } p_149673_5_ is side. Ah - wait a second iconsB[1] = new IconFlipped(iconsA[0], true, false); that doesn't look right. -TGG
IPS spam blocked by CleanTalk.