Everything posted by Draco18s
-
[1.10.2][Solved] Synchronization of RF energy in TileEntity
See, I never would have even noticed. I saw magic numbers and went "fuck this, I'm going to assume it's correct." I couldn't even tell that these methods were (partly) responsible for sync.
-
1.10.2 Working With A friend
One of you did something terribly terribly wrong for that to occur. That is in no way git's fault.
-
[1.10.2] Keybind Change Event
This is stupid.
-
Problems building FernFlower from the github repo [Unsure if right place to ask]
Funny thing about Github repos: they have an issue tracker where you can post this, because this is the wrongest place. That said: > There were failing tests. See the report at: file:///C:/Users/james_000/Downlo ads/FernFlower-master/build/reports/tests/index.html
-
Enchantments cannot be resolved or is not a field
Use your god damned IDE (go look at the class, use the autocomplete dropdown...). They are in all caps now.
-
[1.7.10] PlaceEvent doesn't actually take metadata into account
1.7.10 is no longer supported. Update.
-
[1.10.2] Inserter glitch
So learn. They aren't that hard. https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
-
[1.10.2][Solved] Synchronization of RF energy in TileEntity
So the link to sync code doesn't actually link to anything that does syncing. That would be here: https://github.com/JakeStanger/Chemistry/blob/master/src/main/java/roboguy99/chemistry/tile/TileOreProcessor.java#L543 The part you linked to instead, however, uses magic numbers. Fuck, did BlockState property enums teach you nothing?
-
[1.10.2] Inserter glitch
You're a freaking idiot. Seriously. if (container.getStackInSlot(i).stackSize < 64) { container.getStackInSlot(i).stackSize++; entityItem.setDead(); } Seriously. What the hell. All of your problems are here. And why are you not using Capabilities for item storage?
-
[solved] source code modification will not be executed
Correction: don't modify any vanilla code, that's not how Forge works. As for MCP, you can't really do it that way either, because the Forge setup hasn't used MCP that gives you modifiable vanilla files since 1.7.10 and everything's moved since then, so you can't download it anyway. Also, update to 1.10. Or if you're really hell bent on 1.8, at least update to 1.8.9
-
[1.10.2] Absolutely noobish Q.: How to properly register new Block?
public static void registerRender (Block block) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher(). register(item, 0, new ModelResourceLocation(Reference.modID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } This won't work. You never create and register an ItemBlock for your block. Also, don't use getUnlocalizedName for anything. Use getRegistryName. Following that comment, do this: setUnlocalizedName(getRegistryName()) Also, you have your rendering registration code inside common code, you can't do that. It MUST exist in a proxy or you'll crash the dedicated server. Here's how I do it: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/client/ClientProxy.java And if you check out my common proxy, you'll see how I register my items so that it translates cleanly from 1.7.10's style to 1.10's.
-
[1.9.4] [SOLVED] onNeighborBlockChange
Deprecated in this case means "do not invoke this method, but you can override it"
-
[1.10.2] Only render block if player holds a specified item
I'd use the TextureAtlasSprite method. They're real easy to use, unless you're doing crazy shit like trying to generate a runtime texture. Just go look at the TextureAtlasSpriteClock and TextureAtlasSpriteCompas classes. What they do is override updateAnimation , look at player/world information, and determine which frame of the animation should be used and update it. Dirt simple. The hard part is letting Minecraft know there's a custom TextureAtlasSprite class involved (you may have to dig around in the compass/clock item classes and related code; I haven't done this for 1.10 yet).
-
[1.10.2] Keybind Change Event
While that looks elegant, that's really not how things should work (i.e. the server knowing about keypresses). In reality what that API should do is take the packets sent from the client about when the client presses buttons, and store that information. What I did in 1.7.10 was rather hacky as all I was trying to do was work around an issue with liquids and not being able to jump out of them, but on the client side of things I listened for "is the player trying to jump and are they in water?" and if so, tell the server "hey, this player is swimming." So then on the server: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/HazardsEventHandler.java#L88-L90 You'd essentially do the same thing: "Hey this player is doing the thingamajig" and the server goes "ok, I can remember that." The server gives no fucks about keybinds instead it cares about what the player is doing. You can still refer to it like a keybind, but it's not. Instead it's the client saying "the player is giving me [x input]." No listening to keybind changes necessary.
-
[1.10.2]Refresh Button Texture
Well of course not. You didn't update the button's mode field. You get the value from the TE only in its constructor.
-
Force player to face certain direction?
int rotation = player.getRotationYawHead() % (2*Math.PI);
-
[1.10.2]Refresh Button Texture
Make your own class that extends GuiButton and override drawButton to draw the correct texture.
-
[1.10.02] Overlay item texture on block texture
Green textures.
-
[1.10.02] Overlay item texture on block texture
Set the GL color.
-
[1.10.2] Block Reach Distance (SOLVED)
You have to do it on the client too, otherwise the client won't be aware of the extended reach.
-
[1.10.2] What is "flag" 11?
11 would be flags 1 + 2 + 8. I've never figured out what Flag 8 does.
-
[Forge 1.10] Block that clears player inventory
Be sure to check types before casting.
-
[1.10.2] TileEntitySpecialRenderer
Also don't use a TESR if your model does not animate.
-
[SOLVED] @SideOnly annotation
If a method you are overriding has it, you should add it, but it won't hurt anything if you don't. Just never ever put SideOnly on something that didn't already have it. http://www.minecraftforge.net/forum/index.php/topic,22764.0.html
-
Mod works in IDE but not as a jar after building??
1.1 as in older than 1.6? Or 1.1 as in "that's the same decimal value as 1.10"? (Hint, it's not)
IPS spam blocked by CleanTalk.