Jump to content

Cyan

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Cyan

  1. Hey there, So I'm making the jump into gradle, but I've seem to run into a problem actually adding the gradle address as a Path variable. At least, that is the only reason I can come up with. ERROR: JAVA_HOME is not set and no 'java' command can be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. I feel like I have probably missed something stupidly easy, but I know that the java portion of the value is right, as I can bring up various commands in the command prompt, but nothing with gradle. My path is C:\Program Files\Java\jdk1.7.0_51\bin;C:\Program Files\gradle-1.10\bin Any help would be appreciated. Thanks, Cyan
  2. Mind if I add on here and ask another question? Seemed like a better idea than creating a similar topic! Now I know you can use getCanSpawnHere() to make mobs spawn exclusively on certain blocks, but is there a way to make them spawn on "materials" such as leaves or ice? What about on the air blocks? I tried using worldObj.getBlockId((int)posX,(int) posY-1,(int) posZ) == 0; as a random shot in the dark. Thanks for any insight you may be able to provide.
  3. That is pretty much what I am doing already. The problem isn't with calling the vanilla copies. Its figuring out what I need to edit in the copies.
  4. I mean there isn't a great deal of new code here yet. As far as the AI goes, its just the vanilla copypasta. The target tasks specifically are this.targetTasks.addTask(1, new EntityNewAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityNewAIOwnerHurtByTarget(this)); this.targetTasks.addTask(3, new EntityNewAIOwnerHurtTarget(this)); I was hoping that making EntityAIHurtByTarget would make it change priority after being attacked by something else, but no dice.
  5. Well I currently have about 90 entities All of which can either be tamed through the right methods, or become hostile if attacked. The idea is to really pit the tamed ones against the hostile ones, but the only vanilla way to do that is to make the hostile entity attack on sight, rather than after being attacked.
  6. Hello there, So I have been screwing around with the AI lately, and noticed something. Other than spiders who don't use the standard AI, mobs tend to stick with the first target that attacks them.(Which is obviously the purpose of EntityAIHurtByTarget) Anyway, I was wondering if there is a way, or perhaps someone has a really good idea, on how to change the AI to not attack the player. I have already tried going into the isSuitableTarget method and seeing if I could get anything out of that to no avail. The main purpose of this is because I want to attack a custom hostile entity, and then have it switch to a tamed entity that might be also attacking it. Obviously with the vanilla code it will just keep attacking me instead of switching to the tamed entity. Thanks for any advice you may be able to provide.
  7. Hmm. The handler may have to do, but I'm going to keep this open just a little longer in case anyone else has some ideas.
  8. Hello, I was wondering if anyone may have some good ideas for further limiting an entity from spawning, as I can't seem to get the desired results that I want. Currently, I can only limit an entity by the probably of it spawning, the number per spawn, the max amount spawned per chunk, and what block they can spawn on.(Courtesy of vanilla methods) What I want to know is, what would be my best bet for making "rare" entities? I'd like to only make a certain entity only spawn once in a biome to be more specific, but the closest I can get to that is to limit to one per chunk. Alternatively, I have tried generating special blocks in different biomes so that they can only spawn from it, but that is a hassle. Thanks for any tips/insight
  9. Well..Like I said in the initial post, if you have more than one biome ID in your config file, it appears to only generate the last biome added to the config. The point of metadata is to keep the clutter down. I find it much cleaner to create one item file for 15 similar items than to make them all separate.
  10. Hello, Is there a proper way to make IDs for metadata? Naturally the it can't be done the way a normal block or item is done, and I haven't seen anything suggesting it can be done. Although I'm sure there is a way. I saw one of the tutorials on the wiki has a "chaining configurations" section, but Im not sure that exactly applies(although it could, since that portion didn't offer much explanation). Same question for biomes. Adding configurable IDs only allows one custom biome to generate(if there are multiple registered under the config). This one I'm not sure can be done, but I figured I would ask anyway. Thanks in advanced!
  11. While I thank you for pointing all of that out(and I am working on cleaning that up a bit at the moment), I'm more concerned about why my scale is no longer working. I'm wondering what has changed since 1.5, because all of this, despite as messy as it may be, worked just fine. I can't seem to find any details about renderer changes, so I was hoping there might be some information here.
  12. Bumping as I have not found a solution for this on my own, or through any poor attempts at research.
  13. Hello there, So while 1.6 has had me swimming in texture changes, I have gotten those all pretty much fixed up. My question is about some of the other additional rendering changes. I have noticed that the scaling will not change, and any rendered text appears to not be showing up anymore. Sooo, just wondering if there is a newer/better method for this, or if I need to find a new way of doing this. RenderDigimon file import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import digimobs.Entities.EntityDigimon; public class RenderDigimon extends RenderLiving { float scale; public RenderDigimon(float f, ModelBase model, float scale) { super(model, f); this.scale = scale; } protected void preRenderScale(EntityDigimon entitygiantzombie, float f) { GL11.glScalef(scale, scale, scale); } protected void passSpecialRender(EntityLiving entityliving, double d, double d1, double d2) { renderName((EntityDigimon)entityliving, entityliving, d, d1+entityliving.height/2, d2); } protected void renderName(EntityDigimon entityplayer,EntityLiving entityliving, double d, double d1, double d2) { EntityDigimon digimonScreen = entityplayer; if(Minecraft.isGuiEnabled() && (entityliving instanceof EntityDigimon) && entityplayer != renderManager.livingPlayer && digimonScreen.isTamed()) { float f = 1.6F; float f1 = 0.01666667F * f; float f2 = entityplayer.getDistanceToEntity(renderManager.livingPlayer); float f3 = entityplayer.isSneaking() ? 32F : 64F; if(f2 < f3) { String s = new StringBuilder().append(entityplayer.getNickname()).append(" lvl").append(entityplayer.getLevel()).toString(); String s2 = "Status : "; if(digimonScreen.isSitting()){ s2 = new StringBuilder().append("Status : ").append("Sitting").toString(); }else{ s2 = new StringBuilder().append("Status : ").append("Following").toString(); } String s3 = new StringBuilder().append(" Owner:").append(digimonScreen.getOwnerName()).toString(); if(!entityplayer.isSneaking()) { renderLivingLabel(entityplayer, s, d, d1, d2, 64); renderLivingLabel(entityplayer, s2, d, d1+0.2D, d2, 64); renderLivingLabel(entityplayer, s3, d, d1-0.2D, d2, 64); } else { FontRenderer fontrenderer = getFontRendererFromRenderManager(); GL11.glPushMatrix(); GL11.glTranslatef((float)d + 0.0F, (float)d1 + 2.3F, (float)d2); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F); GL11.glDepthMask(false); GL11.glEnable(3042 /*GL_BLEND*/); GL11.glBlendFunc(770, 771); Tessellator tessellator = Tessellator.instance; GL11.glDisable(3553 /*GL_TEXTURE_2D*/); tessellator.startDrawingQuads(); int i = fontrenderer.getStringWidth(null) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.addVertex(-i - 1, -1D, 0.0D); tessellator.addVertex(-i - 1, 8D, 0.0D); tessellator.addVertex(i + 1, 8D, 0.0D); tessellator.addVertex(i + 1, -1D, 0.0D); tessellator.draw(); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); GL11.glDepthMask(true); fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff); fontrenderer.drawString(s2, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff); // fontrenderer.drawString(s3, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff); GL11.glEnable(2896 /*GL_LIGHTING*/); GL11.glDisable(3042 /*GL_BLEND*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } } } } protected void preRenderCallback(EntityLiving entityliving, float f) { preRenderScale((EntityDigimon)entityliving, f); } public void renderModel(EntityLiving entityliving, double d, double d1, double d2, float f, float f1) { super.doRenderLiving(entityliving, d, d1, d2, f, f1); } public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2, float f, float f1) { renderModel(entityliving, d, d1, d2, f, f1); } public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { renderModel((EntityLiving)entity, d, d1, d2, f, f1); } @Override protected ResourceLocation func_110775_a(Entity entity) { return new ResourceLocation(((EntityDigimon) entity).getTexture()); } }
  14. I wasn't saying use a packet for EVERYTHING, I was saying that I use a packet to update the client from its "dumb" stage to a slightly knowledgable level so that the client displays correct data. I am not entirely sure about datawatchers and if they update the client or not... I actually had no idea about the ctrl+h. That has become very nifty. Thank you. I have been experimenting all weekend with this to see if I can use the entityInit, and did not get any results. I tried with both an abstract class and a non abstract class for the heck of it, and I would get issues preventing the entities from spawning. I'm going to put up my whole entity file this time in hopes that it may be more useful, because I am kind of getting desperate to figure out why this reset is occurring. Note that this is BEFORE I began experimenting, so this is without the entityInit in it. (Also pay no attention to the tileentity portions. They are severely out of date) EntityDigimon Also, I have looked at the packet tutorial on the wiki, as well as from some other github src to try and make heads or tails of it. I'll put up what I have as well for any critique/suggestions on how to fix it.(note that I don't have the packets in the above entity file at all at the moment) DigimobsPacketHandler public class DigimobsPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { DataInputStream dataStream = new DataInputStream(new ByteArrayInputStream(packet.data)); try { int packetID = dataStream.readInt(); LevelPacket d = new LevelPacket(); d.readPacketData(dataStream); } catch (IOException e) { e.printStackTrace(); } } } DigimobsPacket public abstract class DigimobsPacket extends Packet250CustomPayload { // EnumPackets packetType; public Packet getPacket() { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DataOutputStream data = new DataOutputStream(bytes); try { writePacketData(data); } catch (IOException e) { e.printStackTrace(); } Packet250CustomPayload pkt = new Packet250CustomPayload(); pkt.channel = "Digimobs"; pkt.data = bytes.toByteArray(); pkt.length = pkt.data.length; return pkt; } @Override public abstract void writePacketData(DataOutputStream par1DataOutputStream) throws IOException; @Override public abstract void readPacketData(DataInputStream par1DataInputStream) throws IOException; ; public String toString(boolean full) { return toString(); } } Level Packet public class LevelPacket extends DigimobsPacket { public int level; public LevelPacket() { } public LevelPacket(EntityDigimon d, int level) { this.level = level; } public LevelPacket (int level) { this.level = level; } @Override public void writePacketData(DataOutputStream data) throws IOException { data.writeInt(level); } @Override public void readPacketData(DataInputStream data) throws IOException { level = data.readInt(); } }
  15. The suggestions from the guideline there was kinda my train of thought as well. Unfortunately I still have had no success, even after incorporating the datawatchers into the nbt methods. I guess that leaves me with trying a packet, but that is sort of my weak point in coding so far. All my packet does it crash , more likely because I am just plain doing it wrong. I already have the channel and packethandler set up correctly, but if anyone would like to help me write out the actual packet for this mess as something I could go by, I would be extremely grateful.
  16. So, I have started on a journey of making a "level up" of sorts for my entities. The problem is, that everytime that you start the game up, the level resets back to 0. Now this seems like to me that the levels are never reaching the server, or perhaps aren't getting back to the client. I thought that a datawatcher would solve the issue, but that doesn't seem to have worked. Is my understanding of what a datawatcher does incorrect, or have I screwed it up somewhere along the way? Here are all the functions that are relevant to my code. public EntityTest(World world) { super(world); dataWatcher.addObject(2, level); // Level } public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setShort("level", getLevel()); } public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); setLevel(nbt.getShort("level")); } public void onLivingUpdate() { if (getNeededExp() <= 0) { level++; exp = 0; dataWatcher.updateObject(2, level); } public void setLevel(short level) { dataWatcher.updateObject(2, level); } public short getLevel() { return dataWatcher.getWatchableObjectShort(2); } public int getExp() { return exp; } public int getNeededExp() { int maxNeeded = baseExp + level * factor; return maxNeeded - exp; } super.onLivingUpdate(); } Thanks for any insight you may be able to provide.
  17. Going to put one more quick post into this since apparently it got more backlash than needed. It is an easily overlooked error. Believe me. So much that I didn't realize that (half) of my problem was that I hadn't noticed it the function being changed at that point and time. I just copied and pasted here with the first "suggestion" Draco18s made. (while in reality, the nifty Eclipse hover and fix changed the code to Enitplayer getName(), whereas I thought it was still String getName(), but that's what I get for trying to rush around and copy things to the forum for a quick reply) That being said, I made a mistake in copying. My bad. I also stated at least three times that this was probably a stupid question in the original post. I'm not the best programmer in the world, nor did I have any actual teaching. Sometimes I make mistakes. That being said, no need to be a douche when I explicitly state I'm asking a stupid question. Chances are I am asking a stupid question because I know I have made a stupid mistake, and just don't exactly know why. There is no point in making this any more of an ordeal. Feel free to criticize me whenever I do something stupid and I am not ALREADY aware of it.
  18. First, I asked for a return statement, so the facepalm is rather rude considering the ----> Second, vague response was vague. I realize where the username is, I was just puzzled about how to apply it. Third, thank you. I've been fumbling around with this too long to not realize I didn't make it a string function. Stupid me is stupid. Going to give you a thanks, but perhaps you should consider not being rude the next time someone makes an easily looked over error.
  19. The good news is: I had already tried that. The bad news is: I can't quite return that from my function. Function as of now just in case it will help: public EntityPlayer getName() { return EntityPlayer.username; }
  20. I feel pretty stupid for even asking this, but I have skimmed the entityplayer files without finding what I am looking for. It is probably right in front of me, but I'll ask here anyway I was looking to add a player's username to a render. I unfortunately just can't quite seem to find the function that returns it. Again, most likely because I am looking right over it. Poooint me in the right direction Forge forum!!(please) Thanks in advance.
  21. Hello, So I have been trying with no avail to use the decorate function to make a nice looking biome, however I have ran into a problem. I can't really find a way to dictate where things are generated. So my question is, is there a way to make your generated mass spawn directly in the, oh say, the middle of the biome? Thanks for any pointers!
  22. Thanks! This makes a bit more sense now, and I think I see what I have done wrong.
  23. Bump in case anyone can point me in the right direction on the packet handler.
  24. That, or he hasn't written the new name to NBT... That might help if he isn't doing that. The new name should be updated via the dataWatcher, unless I missed something. I'll post those too, incase I am missing something very simple. dataWatcher.addObject(3, ""); //in the constructor nbt.setString("nickname", dataWatcher.getWatchableObjectString(3)); dataWatcher.updateObject(3, nbt.getString("nickname")); // Write and Read NBT functions respectively. public String getNickname() { if (dataWatcher.getWatchableObjectString(3).equals("")) return name; return dataWatcher.getWatchableObjectString(3); } public void setNickname(String nickname) { dataWatcher.updateObject(3, nickname); }
×
×
  • Create New...

Important Information

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