Everything posted by Draco18s
-
Forge 1236 - Config Comments Unexpected Behavior
Not sure if a bug or Working as Intended (but in an unexpected manner). So I was setting up the configs for a mod I'm working on and figured out I needed to comment a few settings. So I added comments, similar to how Test1 is set up below. The comment wasn't saving and no amount of config.save() calls in and around the line would cause it to do so. The only way I could get it to save was to save the Property to a variable (Test 2). @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); boolean configBool; int configInt; /*Test 1*/ configBool = config.get("Test1", "boolTest", false).getBoolean(); config.get("Test1", "intTest", 6).comment = "This is a comment on intTest for test 1.\nIt has several lines of comment to avoid text wrap and will not show up in the config file.\nMin 1, Max 12, Default 6."; configInt = Math.min(Math.max(config.get("Test1", "intTest", 6).getInt(), 1), 12); /*Test 2*/ configBool = config.get("Test2", "boolTest", false).getBoolean(); Property prop = config.get("Test2", "intTest", 6); prop.comment = "This is a comment on intTest for test 2.\nIt has several lines of comment to avoid text wrap and will show up in the config file.\nMin 1, Max 12, Default 6."; configInt = Math.min(Math.max(prop.getInt(), 1), 12); config.save(); } And the resulting config file generated: # Configuration file test1 { B:boolTest=false I:intTest=6 } test2 { B:boolTest=false # This is a comment on intTest for test 2. # It has several lines of comment to avoid text wrap and will show up in the config file. # Min 1, Max 12, Default 6. I:intTest=6 } I realize that Test 2 is better practice (due to caching the Property instead of calling get() twice) but it seems to me that both methods should save the comment to the file, yet the former does not.
-
State of Forge Server modding?
- [1.7.10] Using NBT to store items in a tileentity ?
Game crashes if you don't, hehe. I've forgotten twice in my current project and when I did the game would immediately crash as soon as the block was placed in the world. Other two functions you should go ahead and implement now are: @Override public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); writeToNBT(nbtTag); return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbtTag); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); } And you'll also need this line any time you change the inventory (important when dealing with hoppers and similar!) if (worldObj != null) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);- State of Forge Server modding?
The client will need some level of modding, no matter what you do. ANY kind of interface element or in-game effect, item, or block will need to be installed on the client. If people are having trouble installing mods in the current state of affairs, they're idiots or the mod is not a properly constructed mod. I.e. all you have to do to install a mod is: 1) download forge, run it 2) add mod to /mods folder If (2) is not true, then the mod is improperly constructed.- Tile Entity Data not saving
No no no no. Don't send your metadata in the packet at all! Block metadata is already synced between client and server.- Why wont structure generate
Did you register it?- modification to a mod (volunteer work)
All I can tell you is that treating those blocks as pathable (and diggable by mobs) is a non-trivial task. There's a 1.6.4 mod, Invasion Mod, that did have this, but they had to implement their own pathfinder, and so on. There's an incomplete update for 1.7 available here.- Minecraft Forge 1.6.4 Won't Launch
In b4 deisieben07 says, "stop using 1.6.4": Can't help you without error log.- [Solved][1.7.10]Custom Fluid - NullPointerException
Try swapping these two lines: GameRegistry.registerBlock(BlockLiquidCoffee, Names.LIQUID_COFFEE_BLOCK); FluidRegistry.registerFluid(LiquidCoffee);- Rendering a standard block as part of a TileEntity?
Long story short: For some reason the tessellator doesn't work when called from a TESR. Same code copied into an ISimpleBlockRenderer renders just fine.- Rendering a standard block as part of a TileEntity?
Thanks anyway Diesieben. Trying to poke at the values that make RenderBlock do its Thing, nothing is seeming to indicate a complete non-render. :\ Copying tessellator code now to do it my bloody self.- Rendering a standard block as part of a TileEntity?
Hmm. It didn't crash, but it also didn't render the water. http://s27.postimg.org/kb12ndiar/2014_11_21_13_30_09.png[/img] Item Render is using an old model which is not being used in-world at all (commented sluice.render(...) so it would just draw the water). Not sure how to go about debugging that, as it would require adding statements inside vanilla code.- Rendering a standard block as part of a TileEntity?
Ahh. I'll try that, thanks.- ClassDefNotFoundError: EntityClientPlayerMP - Why?
import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; None of these classes exist on the server, merely instantiating your class will cause the server to crash due to missing references. You will see this a lot with inter-mod compatibility. You must create a unique class for EACH mod API you want to use because if that mod is not present and you call a function in a class that merely contains the imports will cause Minecraft to crash, even if the code that uses the imported classes isn't called.- Rendering a standard block as part of a TileEntity?
So here's what I'm trying to do, I have a model that I want to render a block of flowing water in the same space so that my model doesn't need to supply the faces and texture of flowing water itself for various reasons. public class TESRSluiceBottom extends TileEntitySpecialRenderer { private ModelSluice sluice = new ModelSluice(); @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { System.out.println("Rendering sluice at " + tileentity.xCoord + "," + tileentity.yCoord + "," + tileentity.zCoord); System.out.println("world: " + RenderBlocks.getInstance().blockAccess); if(RenderBlocks.getInstance().blockAccess != null) { RenderBlocks.getInstance().renderBlockAllFaces(Blocks.flowing_water, tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); } sluice.render(tileentity, d0, d1, d2, 0, ((TileEntitySluiceBottom)tileentity).getRotationY()); } public void renderTileEntityInventory(TileEntity tileentity, double d0, double d1, double d2, float f) { sluice.render(tileentity, d0, d1, d2, 0, f); } } Problem is: RenderBlocks.getInstance().blockAccess is always null. Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null Rendering sluice at -720,62,-447 world: null If that IBlockAccess field is null, then when it goes to attempt to render the water, it tries to get the biome color to use for the water, which requires a non-null world (i.e. it crashes). So clearly I'm doing something wrong somewhere. What do I need to change?- How do you port a mod from 1.7.10 to 1.6.4?
I don't know why, but Forge 965 uses MCP. Go get 964, which has Gradle.- [1.7.10]Adding music into the game.
You don't have to.- [1.7.10] How to make mob attack?
Also use @Override so that your IDE will yell at you when you aren't actually overriding something.- Would this be possible to do with a forge mod
Just as an example of "something you can actually do" (with enough time, knowledge, and effort): Recreate the affects of Accel World's Brain Burst game which stops time. The rough bullet point method of doing this is as follows: 1) recreate the 2) copy region data to a new dimension when the player activates Brain Burst 3) teleport the player to this dimension (there's another mod that does something similar and has a "power cell" biome where no ticks happen) 4) add a blue-tone filter 5) add custom gameplay 6) teleport player back to the overworld when done 7) play out the resequence data, accelerating the updates of all objects not in the player's view fulcrum (if it enters, replay at normal speed until it leaves again). Voila, player-perspective time-stopping powers.- 1.7.10 Ore Generator not working
Also, just as an FYI: Your default case should treat the dimension "like the overworld" for compatibility with other mods, such as Mystcraft. If you don't add any code to determine what mod added the dimension and figure out if your ore should generate there or not (the Mystcraft API has an "is Mystcraft Age" method, for example) then just assume that it's "overworld-like" and attempt to generate.- Eclipse is not recognizing the Mincreft project in the src
I have both Indigo and Juno and both work fine.- Removing XP From Player
what happens when... amt = 10 player.experience = 5 player.experienceLevel = 2 ..?- How to change an item when I right click
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { itemStack = new ItemStack(...); } ?- Adding particles
The Tessellator is how vanilla draws black squares.- Share a boolean between all clients
So use the NBT all entites have instead. I gave you two options and you don't know anything about one of them (and frankly, neither do I). - [1.7.10] Using NBT to store items in a tileentity ?
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.