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

SteakHead

Members
  • Posts

    21
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

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

SteakHead's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. Yes, you could do that. However, because vanilla teleporter class requires a WorldServer instance in the constructor, it would have to be made either in a method that subscribes to the World.Load event or making a variable in the portal block that gets instated if (teleporter == null). Either way is fine, but I just figured that if Forge spent the time to write all the other dimension stuff, they might as well go the whole way and make things neat.
  2. Hi, Currently, while looking through the code, neither vanilla or anything Forge adds takes into account custom dimension teleporters. See net.minecraft.world.WorldServer line 119: this.worldTeleporter = new Teleporter(this); Whenever I want to teleport an entity, I have to create a new instance of my custom teleporter class. While this works fine, it's not really ideal, because the teleporter instances do not share a cached portal position list. (Thus, everytime something teleports, the teleporter has to search within a wide range of blocks for a matching portal). If Forge added the ability to register Teleporters (in DimensionManager?), then a system could be made in which only 1 teleporter instance is made for a WorldServer of a certain dimension (therefore the teleporter instance would not have to search for a portal everytime, reducing teleport time, which I'm sure everyone can agree is a good thing). At the moment, you can make the cache variable static and do manual removal checks, but I feel an actual alternative is better. Just a thought - SH
  3. Because of the 1.9 update, the way to register blocks/items has changed. Specifically, you're following only 1/2 of the required steps to register a block/item. In the new system, you need to set a block's/item's registry name. Before the line that reads GameRegistry.register(item), add item.setRegistryName(insert register name here. it can be anything, but i suggest making it the same as your items' unlocalized names), perhaps something like item.setRegistryName(item.getUnlocalizedName().substring(5))
  4. Hi, while decompiling does take longer than the other processes, not that much longer. First, kill the process if it is still running. As Cerandior stated, try assigning gradle more memory. You can do this by creating a file called gradle.properties in the same folder as gradlew. In the new file, add this line: org.gradle.jvmargs=-Xmx2048M This will assign gradle 2 GB of memory, which should hopefully be enough to decompile MC in less time. After creating the new file and adding this line, try to setup the workspace again.
  5. Hi, Does anyone know how to enable/use stencil bits with Forge 1.9? I read somewhere that I can use MinecraftForgeClient#reserveStencilBit and Framebuffer#enableStencil to achieve this, but I'm not sure how. Any documentation or a tutorial would be helpful. Thanks
  6. Hi, So I've been fiddling with world rendering and I just have a question because I'm still a bit unclear about 1.9 rendering. Basically, are there 1.9 equivalents for RenderGlobal#clipRenderersByFrustum, RenderGlobal#updateRenderer and RenderGlobal#sortAndRender (these methods were from 1.7.10). I've looked through all the vanilla code for both 1.7.10 and 1.9, but I don't see many similarities. My best guess is RenderGlobal#setupTerrain and EntityRenderer#updateCameraAndRender, but they don't appear to work exactly the same way. Does anyone know a better solution? - SH
  7. Hi, Does anybody know how to approch drawing simple quads in 1.9 with the new vertex buffer and stuff? In previous versions, I could simply do: WorldRenderer wr = Tessellator.getInstance().getWorldRenderer(); wr.startDrawingQuads(); /* add vertices */ Tessellator.getInstance().draw(); But since the updates, this is no longer works. Basically, What is the 1.9 equivalent for drawing simple quads? Thanks - SH
  8. Hi, I was wondering how to add new AI mechanics to existing vanilla mobs. The only way I can think of doing it is accessing a mob's tasks and targetTasks variables whenever it joins the game (via Forge's EntityJoinWorldEvent) and adding the new AI task there. Is there a better way to doing this? Perhaps something that adds the AI to all mobs instead of one at a time? Thanks - SH
  9. Yes, you can find it at Teleporter#placeInExistingPortal
  10. As of 1.9, the block color stuff has been moved to it's own interface. So now, you can either do two things. First, have your block implement IBlockColor, which will give you your colorMultiplier method in your block class, or do something like this: If your block class does implements IBlockColor: In any case, these methods should be put in your main class after you register your block with GameRegistry#registerBlock. If the first method is unclear, the actual file is at net.minecraft.client.renderer.color.BlockColors. Keep in mind that you should create only one instance of BlockColors, as every time you call BlockColors#init, the registered map gets cleared.
  11. Hi all, Has anyone figured out how to do custom bows with Forge 1.9? I'm having trouble finding where to render the bow animation. In previous versions, I could switch between item models via Item#getModel, but that no longer exists. Any info would be helpful, Thanks
  12. So I just started to update my mod to 1.9, but it would appear that all the IBakedModel stuff has changed significantly. ISmartBlockModel no longer exists, which was the core of my mod. What is the 1.9 alternative? Thanks
  13. EDIT: It would seem like I am too use to shaders in WebGL. I had assumed that each vertex on a side had an associated RGB int array, but apparently that is not the case. I dug deeper into Forge's code and I looks like I was completely wrong. Each vertex does not have an RGB array, but rather, each side has an RGB int shader. I was updating indicies that I thought were colors but were actually uv and vertex points, which explains why the model always rendered as a solid red cube. The correct shader code is below, with vd being the original vertex data array. private int[] alterColor(int[] vd) { int[] vertexData = Arrays.copyOf(vd, vd.length); vertexData[3] = this.sepiaizeWithHue(vd[3]); vertexData[10] = this.sepiaizeWithHue(vd[10]); vertexData[17] = this.sepiaizeWithHue(vd[17]); vertexData[24] = this.sepiaizeWithHue(vd[24]); return vertexData; } HOWEVER This is half-way to what I aim to accomplish. At the moment, the generated color is overlayed on top of the existing color. Does anyone know a way to completely remove the original color of the texture so that only my sepia version remains?
  14. Hi, I was wondering if it is possible to set the texture data of an instance of IFlexibleBakedModel. I searched around the forums for a bit and it would seem like this is something that can be done. What I'm attempting to do is take the texture data from a model, convert it to a sepia version (which is a brownish filter, see bit.ly/1ZOLgSt) and change the hue of the sepia texture to a light cyan. Basically, make a block look like a light blue version of that block. Reading some other forums (like this one bit.ly/1ZazR2w, I've managed to change the color, but I cannot figure out what indices of the model's vertex data to change to the appropriate RGB value. My code for what I'm doing is below. The issue is within the 'alterColor' method. And for what it's worth, it seems to change every model into a bright red, texture-less cube. Any information about vertex data or my issue would be much appreciated. Thanks! public class FrozenBlockModelBuilder implements ISmartBlockModel { public static final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(Reference.MODID + ":frozenBlock"); private IBakedModel currentBlockModel; public FrozenBlockModelBuilder(IBakedModel defaultModel) { this.currentBlockModel = defaultModel; } @Override public IBakedModel handleBlockState(IBlockState state) { this.currentBlockModel = I9Utils.getBlockModel(FrozenBlockRegistry.getFrozenState(state)); return this; } @Override public TextureAtlasSprite getTexture() { return this.currentBlockModel.getTexture(); } @Override public List getFaceQuads(EnumFacing face) { List<BakedQuad> quads = Lists.<BakedQuad>newArrayList(); List<BakedQuad> faceQuads = this.currentBlockModel.getFaceQuads(face); for(BakedQuad bq : faceQuads) { quads.add(new BakedQuad(this.alterColor(bq.getVertexData()), 0, face)); } return quads; } @Override public List getGeneralQuads() { List<BakedQuad> quads = Lists.<BakedQuad>newArrayList(); List<BakedQuad> generalQuads = this.currentBlockModel.getGeneralQuads(); for(BakedQuad bq : generalQuads) { quads.add(new BakedQuad(this.alterColor(bq.getVertexData()), 0, bq.getFace())); } return quads; } private int[] alterColor(int[] vd) { int[] vertexData = Arrays.copyOf(vd, vd.length); int[] vc = this.sepiaizeWithHue(vertexData[3], vertexData[4], vertexData[5]); int[] vc2 = this.sepiaizeWithHue(vertexData[10], vertexData[11], vertexData[12]); int[] vc3 = this.sepiaizeWithHue(vertexData[17], vertexData[18], vertexData[19]); int[] vc4 = this.sepiaizeWithHue(vertexData[24], vertexData[25], vertexData[26]); /* THIS SECTION IS WHAT DOESN'T WORK */ vertexData[3] = vc[0]; vertexData[4] = vc[1]; vertexData[5] = vc[2]; vertexData[10] = vc2[0]; vertexData[11] = vc2[1]; vertexData[12] = vc2[2]; vertexData[17] = vc3[0]; vertexData[18] = vc3[1]; vertexData[19] = vc3[2]; vertexData[24] = vc4[0]; vertexData[25] = vc4[1]; vertexData[26] = vc4[2]; /* ---------------------------------- */ return vertexData; } private int[] sepiaizeWithHue(int red, int green, int blue) { int tr = (int)((0.393D * red) + (0.769D * green) + (0.189D * blue)); int tg = (int)((0.349D * red) + (0.686D * green) + (0.168D * blue)); int tb = (int)((0.272D * red) + (0.534D * green) + (0.131D * blue)); float[] hsv = Color.RGBtoHSB(Math.min(tr, 255), Math.min(tg, 255), Math.min(tb, 255), null); int color = Color.getHSBColor(180, 20, hsv[2]).getRGB(); int nR = (color >> 16) & 0xFF; int nG = (color >> & 0xFF; int nB = (color) & 0xFF; return new int[] { nR, nG, nB }; } @Override public boolean isAmbientOcclusion() { return this.currentBlockModel.isAmbientOcclusion(); } @Override public boolean isGui3d() { return this.currentBlockModel.isGui3d(); } @Override public boolean isBuiltInRenderer() { return this.currentBlockModel.isBuiltInRenderer(); } @Override public ItemCameraTransforms getItemCameraTransforms() { return this.currentBlockModel.getItemCameraTransforms(); } }
×
×
  • Create New...

Important Information

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