-
Content count
479 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Everything posted by gummby8
-
Tile entity Create portal location WorldSaveData Better? I mean it works. Just wondering
-
There will be more than just the blockpos later. This is just a start. Still doesn't answer the question. Can I select 1 compound at random? Or do I need to get all the names from the set and build an array?
-
When I place a portal block it weird it's portal location to the world so when you step on one it will randomly pick another portal block out of all the portal blocks in the world. How else am I supposed to store that data if not NBT? So I need to get the list of portal locations from the world data. Which is a compound. So how can I randomly pick 1 portal from out of the lobbyPortal compound?
-
Ok that worked, made some progress fixed some errors. Now I need to get the tag compound and pick a random tag compound, in that tag compound...... So I have a NBTTagCompound called "lobbyPortals" In said compound are multiple other compounds all named where their location was at the time of creation. So how can I pick one at random? So far I have gotten this if (this.ticksExisted % 20 == (20 - 1) && !this.worldObj.isRemote){ NBTTagCompound data = roomData.getPortalData(); Set set = data.getKeySet(); String roomTag = null; int num = getRandomNumberInRange(1,set.size()); int count = 1; Iterator it = set.iterator(); while (it.hasNext()){ System.out.println("Count = " + count + " Num = " + num); if (count == num){ roomTag = it.next().toString(); System.out.println(roomTag); break; } else { count++; } } } but roomTag is always the same despite the count and num changing the roomtag never does. I can check the world data in NBT viewer and it does show 3 tags, and if I output the set size it shows 3 as well. So it should be giving me 1 of the 3 room tag names, but it keeps giving the same one. Am I going about this all wrong?
-
http://lmgtfy.com/?q=BrewingRecipeRegistry.addRecipe It was literaly the first thing that came up a perfect notated example of how to do EXACTLY what you wanted to do. // The following adds a recipe that brews a piece of rotten flesh "into" a diamond sword resulting in a diamond hoe BrewingRecipeRegistry.addRecipe(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond_hoe)); You need to learn java first. I learned AHK, HTML, PHP and SQL first, then wanted to make a mod. I was confused when everyone was talking about "methods" when I was used to hearing them called functions. Putting this a gentle as possible. You do not appear to have a firm grasp at how the code flows from one method/class to another, AKA programming. No one here can / has the time to teach you that. I hope you are using some sort of program like eclipse to write all this out because the syntax highlighting alone will teach you a ton. Here is a small leason / hint anything with () around it, is a method or calling to a method So some stuff derpStick(); other stuff Is calling to a method derpStick. somewhere else in that class there is a method that does something that will look like this public void derpStick(){ Doing things } The public means that any other class anywhere else can see and access that method. the void means it is not going to send any data back. It is just going to execute. So the code will flow in this order Some Stuff Doing Things Other Stuff Now what about if you need some variables to go to your method? Ok pass them to it! but the method has to be set up to "accept" those variables, and you have to declare what type of variable you are going to send. derpStick(String stringVariable){ System.out.println(stringVariable); } See that? derpStick is going to now require you give it a string, and then it will print it out in the console. So if you do this in the same class derpStick("Hi Mom!"); or this String message = "Hi Mom!; derpStick(message); both will print out "Hi Mom!" in the console. Notice in the second example how I had to declare the variable "message" as a String first, and I had to wrap the text in "" to let java know this is String text, not code. I'm probably going to get an earful by those who are better at this than me but whatevs. That is all, hope I helped further you down the road to java / programming. If this makes no sense still, I can't help you.
-
Collecting arrows stuck in blocks is not a "Normal" function of throwable entities, you don't get a ghast fireball when it hits you in the face right? To "kill" an entity after a certain period just set a ticksExisted check onUpdate(){ if (this.ticksExisted >= someNumberHere){ setDead(); } } You can look at how a ghast shoots fireballs at it's target, those fireballs do not have gravity and the explode on contact. So check out how a ghast formulates the vector to send the fireball and look at the fireball to see how it acts "on collision"
-
I believe... new File("."); ..is what I am looking for since it will be grabbing the schematic files server side. I had it make a directory at "./NERP" It appears in the "run" folder in my Eclipse workbench Huzza. Thanks
-
We use a mod called Schematica that saves schematics to a folder .minecraft\Schematics or ServerRoot\Schematics. I need to figure out how to create the path to that folder. File file = new File(SomethingSomething + "\Schematics"); NBTTagCompound nbtdata = SchematicUtil.readTagCompoundFromFile(file); Also where would I need to put the schematic folder for my Eclipse workspace to see it? Thank you,
-
Not to be a dick...but there are lots of tutorials on how to make a custom mob. Not sure which you viewed to get where you are now. But I would love to look at it and perhaps laugh a lot at it In other news http://lmgtfy.com/?q=forge+1.8+custom+mob
-
FFS just give him a damn tutorial. Telling the man he sucks does nothing to help anyone. The one trying to learn or the forge community. For all you know he could be Gods gift to forge modding and just needs a nudge, He even asked for some tutorials and so far no one has given him any. Just saying "Herp derp lrn to java first" HERE! MrCrayfish is what I used to get started. Good luck dude, welcome to the forge community. These guys are damn smart, but they also put up with a lot of stupid posts all day so they have a bit of an edge, and they WILL NOT pull punches....EVER. Don't hold it against them, and don't let it bother you. Best thing you can do is find a mod that has something you want and find that mods Github repositories and read. Id recomend CoolAlias's Zelda Sword Skills. He does just about everything from monsters to blocks to items....don't use his packets tho, I got an earful from him when I tired to emulate what he had, spent an hour in skype with him trying to fix my mess.
-
If I have a modpack with X, Y and Z mods. And mod X has some pretty neat stuff and then "Thor's Godly Hammer of Uber Doom!" and also "The Block That Kills Everything That Gets Near It!" Is there a way I can have my mod "unregister?" that overpowered item / block and keep all the other nifty stuff in tact? I understand if that item has any dependencies then things could explode, so it would have to be used with caution.
-
Is it possible to remove an item / block from another mod?
gummby8 replied to gummby8's topic in Modder Support
Minetweaker.......perfect. Now I don't have to make aything You da man Lex. Thanks -
Is it possible to remove an item / block from another mod?
gummby8 replied to gummby8's topic in Modder Support
Exactly. I am sure there are a lot of good things in draconic evolution. But is a few things are to game breaking and the mod dev didn't implement a way to disable them. I was looking to make a mod that could. I was asking if it was possible. -
Is it possible to remove an item / block from another mod?
gummby8 replied to gummby8's topic in Modder Support
I wan't thinking of doing this as a way of permanently removing items or block. Like Bukkit had permissions and whatnot, you could turn off certain parts of plugins if you didn't want them. In some cases a plugin dev would accidentally leave an overpowered item accessible. Rather than waiting for the dev to fix the mistake (most of the time it never happened) you could simply set a permission that dissalowed non-op players from crafting or holding said item I am asking as a permissions based thing. Is there a way I, in MY mod, can actively search in the item/entity/block registry and pluck out items that I don't want to be there. So that the players on my server can't get their hands on it. Like If I don't want players ever getting Diamond armor, or InsertModNameHere Armor. But I want to keep the other items from that mod. -
Is it possible to remove an item / block from another mod?
gummby8 replied to gummby8's topic in Modder Support
Was looking for a way to do it WITHOUT messing with the mod in question. -
Drawing from personal experience. Don't accidentally use > when you should have used < and spawn an infinite number of squids on land while simultaneously spawning lightning bolts to cause them all to catch fire and explode in every direction. Don't do that.
-
Could always offer a flat reward. Whoever thinks it's worth their time will make it. Set a time frame you expect the work to be done, and give bonus incentives for completing early. IE $500 for mod that does herp and werp and all the derp Completion time 6 months $50+ for each month completed early. Total cash on the table $800 This way even someone who isn't a java ninja could essentially be in a paid internship.
-
My buddy and I are creating a dungeon. It generates randomly so boss rooms and treasure rooms are never in the exact same place in relationship to each other when created. A treasure room can be placed on the north east south or west side of a boss room. When the boss is defeated the door to the treasure room opens, 10 min later when the boss respawns the door closes. Simple redstone signal from the boss spawn control block. The doors always line up in the exact same place on each face of the room so a redstone wire could in theory carry a signal from one room to another. here is the dilemma. I want to have a tile entity underneath the treasure room chest so that it will spawn new loot once the boss is defeated. I suppose I could use the redstone signal coming from the the boss control block once the boss is defeated, but if a player runs out of chunk load range and then runs back won't the redstone loading next to the treasure chest tile entity reload and cause the chest to reload its loot again?
-
[1.8][SOLVED]Loading Tile Entities with Schematics?
gummby8 replied to gummby8's topic in Modder Support
uppercase and lowercase are treated as seperate variables In this case uppercase X is the x cordinate in the schematic lowercase x in the coordinate found from the tileentity position, if they both match then it does stuff in other news, to solve the problem of worlds having different block IDs I did this if (message != null){ state = Block.getBlockFromName("mb:control_block").getStateFromMeta(metadata[counter]); } -
So I thought loading schematics into minecraft was going to be some super scary thing that would take me weeks to figure out. Then I saw apparently everyone is doing it. Schematic loader Block Object For testing I just made the string for the schematic file path static. I create the schematic file using worldedit for forge 1.8. I can create basic block schematics and then when I put them into my eclipse workplace I can load them in a debug environment and they place in teh world just fine. However when I try to make a schematic of my custom block with a tileentity, the custom block does not paste when i load the schematic. If I go back to normal minecraft with WordEdit and my compiled mod loaded I can create and paste schematics with my block, and all the specific tile entity stuff saves and loads just fine So what am I missing to be able to load my custom in my mod block?
-
[1.8][SOLVED]Loading Tile Entities with Schematics?
gummby8 replied to gummby8's topic in Modder Support
SWEET GIBBLY-GIBBLETS!!!! I DID IT I did done lrnd somethin Schematic loader package com.Splosions.ModularBosses.util; import java.io.FileInputStream; import java.io.InputStream; import java.util.List; import java.util.Map; import com.Splosions.ModularBosses.blocks.tileentity.TileEntityControlBlock; import com.google.common.primitives.UnsignedBytes; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; public class Schematic { private short width; private short height; private short length; private int size; private BlockObject[] blockObjects; public Schematic(String fileName) { try { InputStream is = Schematic.class.getResourceAsStream("/assets/mb/schematics/2.schematic"); NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(is); is.close(); //System.out.println("Schematic?"); width = nbtdata.getShort("Width"); height = nbtdata.getShort("Height"); length = nbtdata.getShort("Length"); size = width * height * length; blockObjects = new BlockObject[size]; byte[] blockIDs = nbtdata.getByteArray("Blocks"); byte[] metadata = nbtdata.getByteArray("Data"); int counter = 0; for(int Y = 0; Y < height; Y++) { for(int Z = 0; Z < length; Z++) { for(int X = 0; X < width; X++) { int blockId = UnsignedBytes.toInt(blockIDs[counter]); BlockPos pos = new BlockPos(X, Y, Z); IBlockState state = Block.getBlockById(blockId).getStateFromMeta(metadata[counter]); String message = null; NBTTagList tagList = nbtdata.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND); for(int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = tagList.getCompoundTagAt(i); String gotMessage = tag.getString("message"); int x = tag.getInteger("x"); int y = tag.getInteger("y"); int z = tag.getInteger("z"); if (x == X && y == Y && z == Z){ message = gotMessage; } } blockObjects[counter] = new BlockObject(pos, state, message); counter++; } } } } catch(Exception e) { e.printStackTrace(); } } public void generate(World world, double x, double y, double z) { for(BlockObject obj : blockObjects) { world.setBlockState(obj.getPosWithOffset((int) x, (int) y, (int) z), obj.getState()); if(obj.getMessage() != null){ TileEntity te = world.getTileEntity(obj.getPosWithOffset((int) x, (int) y, (int) z)); if (te instanceof TileEntityControlBlock) { ((TileEntityControlBlock) te).setMessage(obj.getMessage()); } } } } } BlockObject package com.Splosions.ModularBosses.util; import com.Splosions.ModularBosses.blocks.BlockControlBlock; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; public class BlockObject { private BlockPos pos; private IBlockState state; private String message; public BlockObject(BlockPos pos, IBlockState state, String message) { this.pos = pos; this.state = state; this.message = message; } public BlockPos getPos() { return pos; } public IBlockState getState() { return state; } public String getMessage() { return message; } public BlockPos getPosWithOffset(int x, int y, int z) { return new BlockPos(x + pos.getX(), y + pos.getY(), z + pos.getZ()); } } Waiting for someone to yell at me for using X and x as variables >.> -
[1.8][SOLVED]Loading Tile Entities with Schematics?
gummby8 replied to gummby8's topic in Modder Support
Ok so I got a NBT editor so I can see what and where the tileEntities are stored. [/img] So I have a schematic it has a tile entity in it with an id: TileEntityControlBLock That tile entity has a nbt tag called message. I have been beating the heck out of myself trying to learn how to pull an nbt tag out of a tileentity in a schematic. I just need to get the "message" tag an dput it into the newly spawned tileentity when it places the "ControlBlock" I already have a method in the TileEntityControlBlock that is setMessage(String message) so all I need to know is how to get that message tag out of the schematic and the setMessage on the tileentity that was just placed by the generate function. -
[1.8][SOLVED]Loading Tile Entities with Schematics?
gummby8 replied to gummby8's topic in Modder Support
So I did find a world edit source zip https://www.dropbox.com/s/8gvevkiufwwv0tn/WorldEdit-feature-forge1.8.zip?dl=0 I am trying to figure how I can condense what is there to suit my basic needs I believe I found the save and load methods Load Save In the save Method he puts the tileentities into a ListTag. In his load method he puts everything into a cubicclipboard object. From what I can tell my BlockObject array is pretty limited in what it holds just a position and state. So it is placing blocks without tile entities. Is there a way I can get the Block NBT data and do something like this: remove old tileentity and replace -
[1.8][SOLVED]Loading Tile Entities with Schematics?
gummby8 replied to gummby8's topic in Modder Support
I am assuming this is a limitation of the schematic file generation? If you create some schematics, then put in a few more mods, can't that break your schematics since the environment changed? There is no way to do it based on name rather than ID? Anyway. I recompiled my mod with the schematic loading methods in it It spawns my custom block when the schematic is loaded, but the tile entity is missing its data. When I load the same schematic with world edit, it has everything.