Jump to content

Cyan

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Cyan

  1. Hi, I am attempting to update my dimension from 1.8.9, and have a few questions/concerns on something I am doing wrong involving the BiomeProvider, or perhaps maybe even the WorldProvider itself. I have a multibiome dimension with all custom biomes, and yet everytime I try to set the BiomeProvider for it, I seemingly end up with a world that is only made up of Plains and Ocean biomes. My working understanding of how world generation works has led me to believe that the world is defaulting to these biomes because it cannot get the list of new biomes, whiiiich is where I run into trouble. Also for reference, I have tried plugging in the BiomeProviderSingle class with all of my custom biomes, and it works flawlessly, save for of course only being the single biome, so I know my problem lies somewhere within the realm of my new biomeprovider. My guess is that I am missing something pretty obvious, or there has been some kind of major change to the world generation code other than the WorldChunkManager becoming the BiomeProvider that I have completely overlooked. Below is the relevant code from each of the files. I didn't figure the rest of it needed to be included as it is either vanilla, or does not pertain to the generation of the dimension itself. WorldProviderCustom BiomeProviderCustom ChunkProviderCustom At this point in time, is just more or less a straight copy from vanilla and shouldn't be causing any issues, but I can provide it should I have missed something that's changed here that might be causing my problem. Disclaimer: It's entirely likely that I have missed something pretty obvious, as my programming skills are certainly not the best, but this is the first issue I have actually had with dimensions since first making one around 1.6 or so, so if I have missed something obvious please try not to beat me over the head too much Thank you in advanced for any insight you all may have in this matter!
  2. Hello all, I know that there were a few topics back for 1.7.2 that covered there being an error with using custom creature types, and I was just wondering if this was fixed for 1.7.10, because I keep getting a null point exception when trying to start up the game with a custom creature type. For reference, I'm declaring it as public static final EnumCreatureType testSub = EnumHelper.addCreatureType("TestSubject", EntityTestSubject.class, 10, Material.air, true, true); And then of course sticking it into correct parameter for EntityRegistry.addSpawn Not sure if there are still some errors with the code, or if I have done something wrong. Is there a certain place I should be declaring the creature type at? I've just been doing it in my main file. Thanks for any help you may be able to provide!
  3. I feel like such an idiot. Didn't even occur to me to cast it to entity. Such an obvious thing. Yep. That solved the problem. All hail CoolAlias(and the others who have been patient enough to help me) Thank you all
  4. Alright, so let's see if I got any closer. I added an integer to be sent in the message, and have sent the id along with the new nickname: testmod.ModBase.testmod.snw.sendToServer(new NicknameMessage(testScreen.getNickname(), testScreen.getEntityId())); And then my packet is now looking as follows: public class NicknameMessage implements IMessage { private String text; private int entityid; public NicknameMessage() { } public NicknameMessage(String text, int entityid) { this.text = text; this.entityid = entityid; } @Override public void fromBytes(ByteBuf buf) { text = ByteBufUtils.readUTF8String(buf); entityid = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, text); buf.writeInt(entityid); } public static class Handler implements IMessageHandler<NicknameMessage, IMessage> { @Override public IMessage onMessage(NicknameMessage message, MessageContext ctx) { ctx.getServerHandler().playerEntity.worldObj.getEntityByID(message.entityid); // setNickname(message.text); // Still not entirely sure how to reference the entityfile here without a static variable return null; } } } This may not even be close to what was meant by sending the entityID/using the world to get the ID, but its kinda how it came together in my head. STILL not sure how I am going to make a reference to the setNickname function though. I'm sure that I am just overlooking a simple way to do it.
  5. I was under the impression that I would need to use the setNickname() method from my entity file in the message. But if I understand correctly, you are saying that I only need to make sure that the recieved message is going to the entity?(via the entity's ID) In hindsight, I feel like that's what diesieben07 was trying to tell me from the beginning in a lot less words.
  6. Yep so I totally was misunderstanding what you posted about the onMessage, but I went back to the tutorial and saw where I was being stupid(several hours later). I need to call the nickname during onMessage, and I feel like a total idiot for reading over the part about it being receiving the packet but anyway, So I guess my question would be how to best make a call to the entity file without getting into a bunch of trouble with static variables? ALSO should mention this is for 1.7.2, in case anything new was added for these type of situations in 1.7.10
  7. I figured the handler probably had nothing to do with it, but I guess I just thought I would double check I had my understandings of it right Well I mean, setNickname() is setting the new text into the entity already, or am I just misunderstanding what you meant?
  8. Hey, So I'll just go ahead and admit that I am not the best when it comes to sending things from one side to the other, but at the moment I am attempting to create a GUI with a renaming feature, that is, you type the name into the gui, and the name(which is attached to a datawatcher), will update to the new name. Whiiich is where the problem naturally is. So in the GUI, I have the packet being sent to the server when the key is typed: Which triggers fine, other than the fact that it does not send the updated name to the server. GRANTED I may need to do something else in NicknameMessage#OnMessage, but if that is not the case, I don't have the slightest clue where I have went wrong. NicknameMessage, which is more or less the basic string message from the tutorials. public class NicknameMessage implements IMessage { private String name; public NicknameMessage() { } public NicknameMessage(String name) { this.text = name; } @Override public void fromBytes(ByteBuf buf) { name = ByteBufUtils.readUTF8String(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, name); } public static class Handler implements IMessageHandler<NicknameMessage, IMessage> { @Override public IMessage onMessage(NicknameMessage message, MessageContext ctx) { System.out.println(String.format("Received %s from %s", message.name, ctx.getServerHandler().playerEntity.getDisplayName())); return null; } } } Again, sorry if this is something simple, but packets is pretty much a new territory for me. Thanks for any help you can provide, Cyan
  9. Hey there, just a quick question for setting up a non-containered GUI. I have a GUI that simply displays text, nothing fancy there. I suppose I'm running into a problem with figuring out what the server element should be. Normally that would be where the container goes, right? Right. In the case of not needing a container, I thought I would just return it as null. However, that does absolutely nothing(or I have made an error elsewhere) SO back to the main point, what is the proper way for setting this up? Should I be creating an empty container? If I should be returning null, I will be glad to post up all the code to see where else I may have made an error. Thanks for any info you may be able to provide.
  10. Edit: Thats okay..I managed to figure out what I did wrong without a sarcastic remark.
  11. So I'm having a similar problem to this, except that when I click on the multiplayer option, the test server doesn't show up at all. Its essentially stuck at "Scanning for games on your local network...", and never budges. The server launches perfectly however. Not sure what I have done to not make the client acknowledge it though.
  12. Turned out to be a rather stupid error with a misplaced bracket. Woops. Make that the second freshmen error made in this topic. Thanks anyways!
  13. YES IT DOES!!!! I found it! You know what the problem was? I accidentally erased @EventHandler. You're the bomb! Thanks for being so patient! Hi. I was following along with this to see if any major revelations were made in the getting biomes to work in 1.7. Was just wanting to ask you if you are declaring your new biomes any differently from 1.6? Or something different in the biome files themselves? I have successfully managed to add in a new biome, but the name that pops up is "null" rather than the custom biome name I have set, and it is rather laggy. The only thing I figure is that I have missed something that wasn't mentioned in-topic, and I thought I would ask. Thanks.
  14. Sorry sorry. I meant to say language file, instead of registry. Slight typo. But I will definitely try the StatCollector, thanks. EDIT: Works like a charm, many thanks.
  15. Not necessarily what I am looking for. I have a rather large amount of custom entities, and there is nothing there that really satisfies what I am trying to do. I would still need to go through and set each entities name individually in their respective files. Which: A) Is irrelevant. I am trying to figure out if there is a way I can use EntityList to return the names without it returning as "modid.mobname", as EntityList seems like the best way to set names for over 240 entities without individually going through each file. B) Use the language registry, so it will reflect the language(I.E. Using a spanish lanuage file rendering "Pollo" over a chicken, rather than "Chicken"
  16. So, title kinda explains it all in a nutshell. So, I have made a datawatcher to keep track of my entity names, but I cannot for the life of me figure out how I would link it to the language file. Currently I am using the EntityList to get the names of the entities, but the names are displayed as modid.entity instead. Not sure this is making any sense, so here is all the relevant code. public abstract class EntityTest extends EntityCreature { public EntityTest(World world) { super(world); dataWatcher.addObject(4, ""); //Name newEntity(); } public void newTest() { setName(EntityList.getEntityString(this)); } //Naming process public String getName() { return dataWatcher.getWatchableObjectString(4); } public void setName(String name) { dataWatcher.updateObject(4, name); } public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setString("name", getName()); } public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); setName(nbt.getString("name")); } And then the code adding the entity, as well as what it is marked down as in the language file EntityRegistry.registerModEntity(EntityTest.class, "TestEntity", 1, testmod.instance, 80, 3, true); entity.testmod.TestEntity.name=TestEntity Now, this will give be the "Player has been slain by TestEntity" when killed, but when setName() is displayed in my render over the mob, it is shown as testmod.TestEntity I figure this is somehow related to the way getEntityString() reads the names from mods. So is is possible to get setName() to read from the Lanuage file names? Thanks for any help you can provide
  17. That seems like a pretty good lead to me, thank you. May I ask which file that is under so I can look a little more in-depth into it? I would greatly appreciate it.
  18. Okay, just curious. Carry on then. If you wanted more details, you could have asked for more details. Communication makes the world go round. I'm looking for a condition to check if a player is online, nothing else. The details of the function are not really important to answering the question. But since you asked so nicely.. What I'm aiming for is: public void onLivingUpdate() { super.onLivingUpdate(); if (!this.worldObj.isRemote && isTamed() && CONDITIONTOCHECKIFOWNERISONLILNEHERE) { energyticker++; if (energyticker >700) { setEnergy(getEnergy() - 1); if(getEnergy() < 0) { setEnergy(0); } energyticker = 0; System.out.println("Energy went down."); } } Like I mentioned in the first post. Its just a simple timer. But it keeps decrementing on servers when the player is offline, SO I am trying to figure if there is a condition somewhere that I have missed to check to see if the owner of the entity is online. But after reading through your previous two posts, it is becoming a little more obvious that you really only skimmed my original post, and then decided to post a snide quip. But for anyone else who may be able to help me out(or you should you decide knock off the snide comments), that is what I am trying to do.
  19. ..None of the above. I'm just looking for something I can use as a condition to check if the entities owner is online. That way I can make certain things in OnLivingUpdate() only run when the player is online.
  20. Hello, So I have some various timers and such running through OnLivingUpdate() for tamed entities, and I ran into a problem with these timers running even when the owner is not on. So my question is, would there be a way to check to see if the owner is online so that they only run while the player is there? I'm currently using the vanilla taming method, as well as for getting the owner. Just need to figure out how to check to see if the owner is online. Thanks, Cyan.
  21. Sorry. Guess I should have clarified. The mutations are the rare spawnings of the base biomes. Such as the sunflower plains etc. public BiomeGenBase createMutation() { BiomeGenPlains biomegenplains = new BiomeGenPlains(this.biomeID + 128); biomegenplains.setBiomeName("Sunflower Plains"); biomegenplains.field_150628_aC = true; biomegenplains.setColor(9286496); biomegenplains.field_150609_ah = 14273354; return biomegenplains; } Is the code to create them, but I don't believe there is a way to make things spawn exclusively to the mutations.
  22. Topic is pretty self explanatory this time. I've been looking around BiomeGenBase and a few other files to see if I could dig up anything, but so far I don't see it being possible. BUT, I figured I would ask here in case I have missed something. Thanks for the help, Cyan
  23. Hello all, So I'm probably missing something fairly simple, but is there a legitimate way to check for blocks being used in the interact? I found in the Itemstack file that you can use getItem() for things such as itemstack.getItem() == Items.feather But unfortunately, I cant seem to find a function similar for blocks. Thanks to anyone who can point me in the right direction.
  24. Right. So I tried this, and now I can't get the command prompt to recognize anything. PATH -> C:\Program Files\Java\jre7\bin;C:\Program Files\gradle-1.10\bin JAVA_HOME -> C:\Program Files\Java\jdk1.7.0_51 EDIT: Turns out setting both Java_Home and Path to jdk instead of jre worked. Will close this now.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.