-
Posts
160 -
Joined
-
Last visited
-
Days Won
4
Everything posted by SerpentDagger
-
(1.14.4) Potion effect wont remove
SerpentDagger replied to ImperialDragon99's topic in Modder Support
You don't make it false, it's set to false if the game is running on the logical server, and true if it's running on the logical client. More Information -
1.12.2 Block.getRenderLayer() crashes server
SerpentDagger replied to Cilka's topic in Modder Support
Wait, where are you even getting the getRenderLayer() method from? It's not a method accessible via Block, so your compiler should be shouting about that. The method I've been using is Block#getBlockLayer(), which does what I think you want. The only reference I've found to getRenderLayer() is MinecraftForgeClient#getRenderLayer(). -
Not beyond the maximum light value, which is what the torch is already set to. As Animefan8888 suggested, I suspect the easiest way of doing this would be with the fake air.
-
What's your new code?
-
1.12.2 Block.getRenderLayer() crashes server
SerpentDagger replied to Cilka's topic in Modder Support
Somewhere you're trying to register a block to a null registry name. You should trace this back from EventSubscriber.registerBlocks() with the debugger to find out where the name isn't being set, if it's tricky enough. Also: Code-Style #4 -
I'm afraid I don't know much about modeling/rendering, so I'll let someone else take care of that one. As for the others... If you want the arrow to look different, or have special effects that aren't achievable with the normal arrow, then yes. Otherwise, probably not. The damage, as well as other statistics, are properties of EntityArrow. In the normal bow, these properties are set by ItemBow during the onPlayerStoppedUsing() method. You can set the damage of the EntityArrow with EntityArrow#setDamage(). For more information and examples, you should look at the ItemBow/EntityArrow classes.
-
Currently you're only drawing that texture once, right when the button is clicked.You need to toggle something in your GUI class when the button is clicked, and then call drawTexturedModalRect() within drawScreen(), according to that value. Also: Code-Style: 4
-
This is still reaching across logical sides. You have to check if World#isRemote is true before calling your proxy. Sorry, but could you explain why this is reaching across logical sides? I would've expected this to simply call an empty method on the server side, and open the GUI on the client side, based on the proxy.
-
I think most of what you're referring to is the raycasting, right? My suspicion is that it increases the accuracy of hit-detection with fast-moving objects. If you only check collisions every 20th of a second, then if your entity is traveling at more than (20)(the target's bounding box size + projectile's bounding box size) per second, there will be unchecked gaps, which mean that your projectile would have a {[(gap size per second)/(speed per second)] * 100} percent chance of failing for every shot that should've hit.
-
Actually, for a bullet I'd try extending EntityArrow, or remaking some of its code with IProjectile implementation & Entity extension. I think it already does everything you're likely to want it to.
-
Looks like it returns an (x, y, z) representation of the pitch and yaw of the entity. Seems like it's got a magnitude of 1, since Entity#getVectorForRotation() uses straight trigonometric functions and no scalar. Also, it might help you out if you find how to open declarations and view references in your development program. In Eclipse, you right-click on the thing you want to view, and then > Open Declaration, or r-click > References > Workspace. It's a really useful tool for finding where/how something happens.
-
It sets both the width and depth to the first argument, and the height to the second. You can see the specifics in Entity#setSize().
-
Pretty sure Entity#setSize() should do the trick. It's called in the constructor of your entity class.
-
It's not printing because the game crashes during preInit. You're calling that method during init. That's probably also why your Fluid is unregistered when the FluidStack is being made.
-
(1.14.4) Potion effect wont remove
SerpentDagger replied to ImperialDragon99's topic in Modder Support
What disieben07 said. Instead, use NBT tags for the data storage. -
How can I get the characters typed in a TextBox/TextField?
SerpentDagger replied to Premiere's topic in Modder Support
getText() is already a method in all instances of GuiTextField, so you don't need to make a new one for it. Just call the method on your GuiTextField object, and it will return the text contained by said object. As a side note, I'd suggest you get much more familiar with Java in general before trying to do anything complicated with Forge, as it's not very beginner-friendly in places. -
How can I get the characters typed in a TextBox/TextField?
SerpentDagger replied to Premiere's topic in Modder Support
Assuming that you're using the GuiTextField or a subclass, you can use GuiTextField#getText. -
Help with Modding a Multiblock Structure
SerpentDagger replied to EmeraldJelly's topic in Modder Support
Unfortunately there's no method you can use to scan the nearby area for blocks, but you can get the IBlockState at a given BlockPos with World#getBlockState, and use nested for loops to check all positions within a cube. If you want to check in a sphere, you could use the cube method but then continue whenever the BlockPos is further than the radius away. -
Help with Modding a Multiblock Structure
SerpentDagger replied to EmeraldJelly's topic in Modder Support
The way I'd go about doing this would be to just check to see if the shrines are there whenever anything important is happening, else said important thing doesn't happen. -
Actually, looking at your model jsons, I think it's that you've written "parent": "block/cube_all", at the top. Since your model isn't a cube, you need to remove that.
-
What kind of texture/model errors are you getting, if any?
-
There's actually a guide for doing this posted at the top of the Modder Support forum. It's labeled "1.13 Update Notes for Mod Creators," but the linked page is for 1.13 & 1.14 both.
-
I've gotten it to work now, after copying a couple lines of translation code from Cadiboo's example here, for a different topic. The rest was correct. I think I understand how the translation works now, but if someone could confirm or correct, that would be great. It looks like BufferBuilder#setTranslation() sets the translation of the position origin in relation to the entity rendering the screen, rather than in relation to the world origin, and Cadiboo's code translates the position from the entity back to the world origin, so that you can draw something with world coordinates instead, by passing said world coords into the BufferBuilder#pos() method while building a vertex. I also found that it wasn't rendering from the bottom, because I hadn't used GlStateManager#disableCull() before the drawing. Cull enabled from underneath: Cull disabled from underneath:
-
For the orbit effect, you can use 3D polar* coordinates for both the movement in a ring as well as the rotation of that ring. The mathematics of orienting the ring, though, depend on how you want the ring to be oriented and rotated. For example, do you want it to be a vertical ring, rotated around the Y-axis? Or a horizontal ring rotated around X or Z? With the wave, you can spawn particles slowishly along the line from A to B, step by step. With each step, you could add to an angle variable which you take the sin or cosine of. That gives you a varying value between -1 and 1, depending on how far through the line you are. You can then add that varying value to the Y coordinate you otherwise would have spawned the particle at, and the height will vary in a wave pattern. You can also multiply the varying value from the sin/cosine by a scale factor to either stretch or squish the waves. Edit: You should also note that the Math.sin and Math.cos methods work with radians, not degrees. *Edit2: 3D spherical. Oops.
-
As the title says, I'm trying to use the Tessellator to draw a Quad in the world. My aim is to eventually draw lines in front of the player as they're casting a spell, as an cool effect, but I'm currently just trying to draw a Quad in a static location to learn my way around the Tessellator before getting fancy. I want the Quad to have a flat color instead of a block texture, which I think is achievable through the POSITION_COLOR and BufferBuilder#color methods. My code is posted below. It doesn't actually render anything in any of the locations I would expect from any combination of the translation methods / vertex positions. (I'm not sure exactly how those things work, so there's a good chance that's where I'm going wrong here. My assumption would be that the BufferBuilder#setTranslation method sets the location that the vertices are placed in relation to, and that the GlStateManager#translate method translates that location, but nothing renders in the location 0, (70 + 60), 0, so I might be wrong.) However, it doesn't give any errors, or wreck the rendering of other things, and it is being run, since the print method prints whenever I set i to 1. It would be great if someone could tell me which bit I'm missing/misunderstanding, as I've spent a considerable time looking through source code and open source mods without seeing much difference that I can discern with my inexperienced eyeballs.