Everything posted by Draco18s
-
HashMapping issue has me stumped
Even when the mods don't change? I thought it was at least stable under those conditions. And the hash is built during startup, IDs shouldn't change while the program is running and nothing about this data structure persists between runs (or even be relevant), it shouldn't even matter that the IDs changed due to a new mod install.
-
HashMapping issue has me stumped
So I'm having an issue with a wrapper class I wrote, so I can map a block+metadata to another piece of information data. It works find in Eclipse, no problems, none. Yet I've got reports from players (of a specific modpack, none the less, I haven't had reports from anyone else) of some console spam that only shows up if there is no match between the block and the info in the hashmap. The console spam is just debug logging info trying to resolve the underlying problem. Here's a section of that logging info, note the 4th listed item: [15:43:27][com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:201]: Hard Ore block, tile.ore_diamond has no flower data. This is a bug! [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:203]: Listing all mapped blocks: [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_iron:-1 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_gold:-1 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.beyondrealitycore:oreCopper:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_diamond:-1 true [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.beyondrealitycore:oreTin:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_redstone:0 false [com.draco18s.ores.block.ores.BlockHardOreBase:func_149726_b:206]: tile.ore_redstone:1 false Here's the code that generates the logging: BlockWrapper bw = new BlockWrapper(this,-1); OreData dat = HardLibAPI.recipeManager.getOreList().get(bw); if(dat != null) { //do stuff } else { System.out.println("Hard Ore block, " + this.getUnlocalizedName() + " has no flower data. This is a bug!"); System.out.println("Listing all mapped blocks:"); Map<BlockWrapper,OreFlowerData> map = HardLibAPI.recipeManager.getOreList(); for(BlockWrapper b : map.keySet()) { System.out.println(" " + b.block.getUnlocalizedName() + ":" + b.meta + " " + bw.equals(b)); } } Here's the wrapper class: public class BlockWrapper { public Block block; public int meta; private int fHashCode; /** * the block and metadata to match, -1 matches all **/ public BlockWrapper(Block block, int meta) { this.block = block; this.meta = meta; } @Override public int hashCode() { if (fHashCode == 0) { int result = HashUtils.SEED; result = HashUtils.hash(result, Block.getIdFromBlock(block)); fHashCode = result; } return fHashCode; } @Override public boolean equals(Object aThat) { if(aThat instanceof BlockWrapper) { BlockWrapper other = (BlockWrapper)aThat; return other.block == this.block && (other.meta == -1 || this.meta == -1 || other.meta == this.meta); } return false; } } I don't get what could possibly be going wrong to cause map.get(key) to be returning null here.
-
[1.7.10][SOLVED] setFireInfo using Deprecated functions?
Or you could call the fire info in your main mod class....
-
[1.7.10] Force Interface(GUI) to update within tileentity
Guis are client side only. In order to make changes to slots and items, you need to do or on the server.
-
[SOLVED][1.7.10] Variable is not saved to TileEntity
they need to sync the data back from the server to the client again. Look for the methods getdescription packet and on description packet.
-
[1.7.10][Solved] Redstone connections
The redstone repeater is a diode.
-
[1.7.10] Placing a vanilla block using my mod but making it unbreakable
Your Block dirt there is the same object as Blocks.dirt , you didn't create anything new with that code. Because setHardness looks like this: public Block setHardness(float val) { this.hardness = val; return this; }
-
(1.7.10) .onEaten - Return Itemstack
He wants to give the player an item (like an empty bowl) when they eat each of item various food items (like soup) without having to create a custom class for those food items. And the answer is no.
-
Saving a CompoundTag inside the root tag
That would be dumb and would violate the whole point of a public getter/setter wrapped around a private object.
-
[1.7.10] How do I setup forge and eclipse?
I still don't know why a batch file with "gradlew setupDecompWorkspace eclipse" in it isn't included, along with another one for IntelliJ.
-
CoreMod doesnt load?
There's a good reason for that and that's because you haven't told Eclipse to load them.
-
Saving a CompoundTag inside the root tag
It absolutely exists. Vanilla does tags-within-tags for a ton of things. For instance, chunk data is an NBT tag that contains the NBT tags of all the entities in that chunk. Enchantments are stored as an NBTTagList, IIRC, as well. So yes, it absolutely exists. Whether or not the name has been de-SRGed, I don't know.
-
Saving a CompoundTag inside the root tag
stack.setTagCompound(new NBTTagCompound()); Like that. Its magic. You now have NBT data and can start storing things into it. stack.getTagCompound().setWhatever("Key",value);
-
[1.7.10] Lost with Tile Entity block render
Uh huh. That would be the case.
-
[1.7]What item can I look at to see how to implement damage-specific textures?
https://github.com/Draco18s/HarderStuff/blob/master/main/java/com/draco18s/ores/item/ItemOreDustSmall.java#L77-L98
-
[1.7.10] Lost with Tile Entity block render
You mean, you aren't sure how to register a renderer for an Entity?
-
[1.7.10] KeyBinding keyUp() method
You need two presses because of this: private boolean pressedLastTick = false;
-
Gravity
There is NOT another way to so it. The static downward acceleration on entities is a hard-coded float value. Is not even a variable.
-
[Solved] "Cannot create a fluidstack from an unregistered fluid"??
See this bit here? See how it occurs after this bit here? Yeah, they need to be reversed. This is why you do not define your blocks, items, and fluids outside of a method.
-
Game Crash
This one's easy dude. Look for references to "magic_gem."
-
[1.7.10] How change texture 'onItemRightClick'
- [1.8][Solved] drawing a simple line
Nope. You need to draw all 12 edges.- [Solved] Item Lifespan
Single simple non-disruptive ASM hook in EntityItemFrame I suppose I could, but when it was reported, I looked into existing hooks and didn't find anything and said, "Actually, that effect is really neat, I like it." So yes, with some ASM I could "fix" the bug, but I thought it was a neat trick. It adds a little something to PvP servers. If someone finds your base where you've stashed all your stat boost items and breaks them, you're no longer so uber.- [1.7.10] How change texture 'onItemRightClick'
You can't add a parameter to a function and expect it to get called by magic.- [Solved] Item Lifespan
Only sort of. If you're checking onUpdate how long its been since creation (rather than incrementing a counter every tick) then it's not free. As soon as the player breaks the item frame and picks up the food, it'll go rotten. But I know what you're thinking, it turned into a kind of "phylactery" effect for my Unique Artifacts mod. If a player found an item that increased their health (or speed, etc.) they could shove it into an item frame and get the bonus permanently. Wasn't something I could prevent so I called it a feature. - [1.8][Solved] drawing a simple line
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.