Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

rich1051414

Forge Modder
  • Posts

    160
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    United States
  • Personal Text
    Creator of the Paint Mod and Damage Indicators Mod

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rich1051414's Achievements

Creeper Killer

Creeper Killer (4/8)

36

Reputation

  1. I raytraced from the block back to the player head, and then back to the players feet, to see if I ran into another block, manually. Seemed like the most direct way to the solution, but it is still expensive. I was hoping minecraft kept a list of non-skipped or skipped blocks, but it appears to only care if blocks are directly obstructed instead of not visible by foreground blocks not touching it. At the moment, I have simply delayed my lookup to twice a second to minimize performance impact, maybe I will think of something later.
  2. I am currently working on a mod which requires me to check if a block is currently visible to a player. Grabbing a collection of blocks within this area is not a performance issue, however, checking if each block within it is visible or not is. This check is done on an area of 16x16x16 so it needs to be optimized. Is there a list that forge keeps, for rendering purposes, that I could use to speed this process up? If not, does anyone have an idea of a trick to make the check faster?
  3. You are totally right. I never realized it made the actual player move side to side, and not just the camera, but it really became noticeable when the player was shrink. Disabling head bobbing stopped it.
  4. I am currently working on a mod which miniaturizes the player, but this causes certain things to get exaggerated, like move speed, and the usually subtle sway back and forth the player does when walking. I cannot seem to be able to locate the code responsible for the swaying, so maybe someone can point me in the right direction. What I mean by sway is, when the player is moving, the model moves slightly from left to right as he moves forward. It is also not directly related to the limbswing, as the swaying gets out of sync with the leg movement. I will have no difficulty correcting the issue if I could locate the code responsible, so I can cancel out part of that at render time.
  5. Couldn't you do something like this: public AxisAlignedBB rotateBoundingBox(AxisAlignedBB bb, int steps){ AxisAlignedBB ret = bb.copy(); for(int i = 0; i < steps; i++){ ret.minX = bb.maxZ; ret.maxX = bb.minX; ret.minZ = bb.maxX; ret.maxZ = bb.minZ; } return ret; } Not sure if I got the order of the dimension shifting right, but should be universal.
  6. So after updating and migrating my code to forge 1.8, I have noticed what I think is a bug with the DynamicTexture object, but I am not totally sure if I am just doing it wrong. Currently I have my own texture loading code for skinning, which uses the DynamicTexture object and fills the objects texture data manually. It will then call DynamicTexture.updateDynamicTexture() to bind the texture before drawing it. However, it now seems to not be binding properly. I have checked and the DynamicTexture is properly getting its image data, but updateDynamicTexture() does not seem to be binding now, and attempting to bind with the raw texture ID and rendering with the Tesselator also does not work. Anyone know if any changes that messed this up, and if I am just doing it wrong now? Edit: Nevermind, turns out it is that the new tesselator cannot be used to render to the gui. I used a different method and is working fine now.
  7. We already went through this idea -- the problem is that would block all entities, including players. He wants to only block certain mobs from crossing. Overriding the addCollisionBoxToList will allow you to selectively block things. Look at the code I posted. Also, the vanilla Pathfinding will path around the invisible blocks, as they are stacked 2 high, as well. The only real caveat is if you bury the block, in a hole, the mob could walk over the invisible blocks, but i would call that user error, as they aren't using the block right. You could even add a simple check for such a thing to prevent placing if their is no block 3 blocks above where it is placed or something.
  8. I think you may be making this harder on yourself. All you need is an invisible block to occupy the block position above the block. You would only need something like this in your actual block code: public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); if(par1World.isAirBlock(par2, par3 + 1, par4)){ par1World.setBlock(par2, par3 + 1, par4, MyBlocks.pathBlockingBlock); } if(par1World.isAirBlock(par2, par3 + 2, par4)){ par1World.setBlock(par2, par3 + 2, par4, MyBlocks.pathBlockingBlock); } } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if(par1World.isAirBlock(par2, par3 + 1, par4)){ par1World.setBlock(par2, par3 + 1, par4, MyBlocks.pathBlockingBlock); } if(par1World.isAirBlock(par2, par3 + 2, par4)){ par1World.setBlock(par2, par3 + 2, par4, MyBlocks.pathBlockingBlock); } } Then for your invisibly rendered path blocking block: //This is not a normal block. public boolean renderAsNormalBlock() { return false; } //Let all light pass through public int getLightOpacity(World world, int x, int y, int z) { return 0; } //Set block as replaceable. public boolean isBlockReplaceable(World world, int x, int y, int z) { return true; } //0 width length and height box so no wireframe rendered. public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return AxisAlignedBB.getAABBPool().getAABB((double)par2, (double)par3, (double)par4, (double)par2, (double)par3, (double)par4); } //Check if the invisible block needs to cleanup public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if(par1World.getBlock(par2, par3 - 1, par4) != myBlock && par1World.getBlock(par2, par3 - 2, par4) != myBlock){ par1World.setBlockToAir(par2, par3, par4); } } //Only block specific mobs public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { if(par7Entity instanceof EntityMob){//Or whichever mob you want to block super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } } //So Raytracing passes through. public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { return null; } //Nothing needs to be done here like there is no block here. public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} I wrote this off the top of my head so you may have to fill in the blanks, but that should make the vanilla path finding work.
  9. Line 89-90 of ModelRenderer: TextureOffset textureoffset = this.baseModel.getTextureOffset(par1Str); this.setTextureOffset(textureoffset.textureOffsetX, textureoffset.textureOffsetY); You need to set your texture offsets first.
  10. First of all, the model must be centered on the relative point 0,0,0. By that I mean, in your model rendering, the offset point x=0, y=0, z=0 is the center-most point in your model. Then any rotations will rotate at the center point in the model.
  11. gradlew cleancache --refresh-dependencies That fixed the issue for me.
  12. gradlew build The issue has also been recreated by others, and is on the ForgeGradle bug list.
  13. Everything seems good to go, except gradle fails everytime on the reobf stage: FAILURE: Build failed with an exception. * What went wrong: A problem was found with the configuration of task ':reobf'. > No value has been specified for property 'deobfFile'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 5.909 secs Bit confused what i am missing Edit: Here is my build file: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } } apply plugin: 'forge' version = "1.0.0" group= "DamageIndicatorsMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "DamageIndicatorsMod" minecraft { version = "1.7.2-10.12.0.967" } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' include 'version.properties' } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' exclude 'version.properties' } }
  14. It would be fairly easy to implement your own. First output your data into a byte array, then split it up into chunks the size you want and send them, then after sending the last part, send a small final packet so the client can know the packet is done, then merge those parts back together client side and then extract whatever data it holds.
  15. I assume you mean how do you get the end user to get the library loaded so you can use it? You can add the library to the mods folder too, but forge will give a warning since its not a real mod, but it will inject it, or you can simply extract the library jar and add it to your mod. That is if the distribution rules on the library allows for that.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.