Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ZetaHunter

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by ZetaHunter

  1. MrArcane111, I followed this http://www.minecraftforge.net/wiki/Server_Command and it worked perfectly fine for me, and I am using 1.7.2. I don't see what else to discuss here even, follow the tutorial, the end. But since I am in good mood, I will share my sample command code with you. package com.zetaworx.proboblyawesome.handler; import java.util.ArrayList; import java.util.List; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; public class CommandHandle implements ICommand { private List<String> aliases; public CommandHandle() { this.aliases = new ArrayList<String>(); this.aliases.add("probobly"); this.aliases.add("awesome"); this.aliases.add("proboblyawesome"); } @Override public String getCommandName() { return "pa"; } @Override public String getCommandUsage(ICommandSender icommandsender) { return "pa <text/help>"; } @Override public List<String> getCommandAliases() { return this.aliases; } @Override public void processCommand(ICommandSender icommandsender, String[] astring) { if(astring.length == 0) { icommandsender.addChatMessage(new ChatComponentText("Invalid Arguments. Usage: " + this.getCommandUsage(icommandsender))); return; } if (astring[0] == "help") { icommandsender.addChatMessage(new ChatComponentText("Usage: " + this.getCommandUsage(icommandsender))); return; } else { ChatComponentText msg = new ChatComponentText("Output: ["); for (int i = 0;i < astring.length; ++i) { msg.appendText(" " + astring[i]); } msg.appendText(" ]"); icommandsender.addChatMessage(msg); } } @Override public boolean canCommandSenderUseCommand(ICommandSender icommandsender) { return true; } @Override public List<?> addTabCompletionOptions(ICommandSender icommandsender, String[] astring) { return null; } @Override public boolean isUsernameIndex(String[] astring, int i) { return false; } @Override public int compareTo(Object o) { return 0; } } and this in your mod file @EventHandler public void serverLoad(FMLServerStartingEvent event) { event.registerServerCommand(new CommandHandle()); } my command is using ICommand interface which is what CommandBase is extending from, but for time being I didn't need CommandBase functions so I didn't use it. Ps. my command also shows how to send user a chat message.
  2. I have an item which I intend to make multi purpose, I have a gui and the gui will have a list of possible modes, I want to make it possible for other mods to add their own modes to the modes list. I suppose just a Map<int, Object> modes; Map<String, int> alliases; and some basic get set add remove function set would be fine aswell though.
  3. I suggest you to take a deeper look into how addExpirence and addExpirenceLevel is realised. for (this.experienceTotal += par1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); this.addExperienceLevel(1); } is designed to increase level when the bar is full, but not the other way around. You might want to make your own function lets say 'public boolean drainExpirence(EntityPlayer player, int exp);' which would return true or false whatever draining succeeded (if user has no exp what's the point to drain it?). you need the EntityPlayer player so you can access the actual player, since the addExpirence was made in EntityPlayer you will need the reference to the player to work with.
  4. So I want to have my own instance of NamespacedRegistry. But when I tried to do so, it didn't work because constructor like this new FMLControlledNamespacedRegistry<Mode>("Mode", MAX_MODE_ID, MIN_MODE_ID, Mode.class,'\u0003'); is not visible for some reason, I suppose I will have to create my own copy of FMLControlledNamespacedRegistry? Since the whole thing is closely connected to MC Block and Item management, and no one seems to have thought of making it usable for other stuff. I might be wrong though, feel free to correct me. Also the Mode class is just a small class with couple string get functions for now. (empty otherwise) I want to make it possible to easily register modes for other modders in future. Also I am not quite sure what's up with \u0003 too, but I just increment it from \u0002 that ItemRegistry had. Any help on this? I know this is quite unexplored direction but still...
  5. I might misunderstand you, but your problem is that you are defining and initializing the variable MyItem in the function. And than trying to access MyItem from some other mod related class but you can't because it doesn't see it? If that is so, your mistake was putting definition of the MyItem inside function. All that is inside function, stays inside. You have to define the variable outside the function boundary to make it visible to other classes. If you are afraid that if flag1 is false and item dosen't get created, and other classes that utilize it fail to find it and error crash on you. Just init it with null first and than when time comes just check if (AwesomeMod.MyItem != null) {/*item exists.*/}
  6. This might be caused by two reasons I could see here. One: The file servers that gradlew is using were down on the moment. (This dosen't have to be neceseraly Forge File's, but rather other libs that MC requires.) Two: Your system is preventing gradlew and/or 1.6.4 src installer from communicating with network at all. (Check your firewall and antivirus.) Feel free to pastebin your install log if any. Ps. I tried installing fresh Forge 1.7.2 Rev1061 src, seems to work perfectly fine. It's most likely your client side issue, do pastebin your log.
  7. You can do as coolAlias suggested. But you can also do this int blockID Block.getIdFromBlock(world.getBlock(i, j, k));
  8. And that did the trick, thank you a lot man, I was fighting this problem for 2 days now. Finally I can enjoy the results Now it's just tweaking it to work properly but that's simple stuff. /thread
  9. Thanks for the reply, appreciate it, but only for mobs I used setVelocity. Which when I replaced with addVelocity (which isn't clientSideOnly) Worked better than before, I could see why now. But it still didn't resolve the issue for the player, it used addVelocity in first place. I will now try writing packet manager to send a packet to server about this stuff. And see if that resolves anything at all.
  10. I don't suppose anyone has any idea or solution to this uncommon issue?
  11. All that would be is just a block with a predefined scheme of structure. An on click event handler that then places blocks are it whatever way you want them to, although can't write you an example since I am on forge 1.7.2. But it would just be an iteration over an array of positions/ids, or just manual line by line code. It's quite simple really.
  12. I have resumed modding, and decide to update my mod to 1.7.2, after updating most of the stuff, while testing I find out that a staff item I had, which fired an entity which then affected entity's in area had partially got broken. The part which I loved the most, the ability to leap up into air is broken, It still works on other living entities. But player? Nope. So I tried addVelocity, setVelocity, manualy change motionX,Y,Z. None of those worked on my player. Here's an extract of my entity's action on detonation. I took out the other 3 type's of action's for sake of size of code. public void specialAttack(MovingObjectPosition var1, int type) { EntityLivingBase p = this.getThrower(); if (p == null) { this.setDead(); return; } switch (type) { case 4: pool = AxisAlignedBB.getAABBPool().getAABB( var1.hitVec.xCoord - getRadius(), var1.hitVec.yCoord - getRadius(), var1.hitVec.zCoord - getRadius(), var1.hitVec.xCoord + getRadius(), var1.hitVec.yCoord + getRadius(), var1.hitVec.zCoord + this.size); entl = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, pool); if ((entl != null) && (entl.size() > 0)) for (EntityLivingBase el : entl) if ((el != null) && (el != p)) try { double xdir = el.posX - this.getThrower().posX; double zdir = el.posZ - this.getThrower().posZ; double motionX = xdir * 0.1F; double motionY = 5F; double motionZ = zdir * 0.1F; el.setVelocity(motionX, motionY, motionZ); } catch (Throwable ex) { } if (var1.typeOfHit == MovingObjectType.ENTITY) { if (!(var1.entityHit instanceof EntityLivingBase)) break; EntityLivingBase el = (EntityLivingBase) var1.entityHit; if ((el != null) && (el != p)) try { double xdir = el.posX - this.getThrower().posX; double zdir = el.posZ - this.getThrower().posZ; motionX = xdir * 0.1F; motionY = 0.1F; motionZ = zdir * 0.1F; el.setVelocity(motionX, motionY, motionZ); } catch (Throwable ex) { } } if (p != null && p instanceof EntityPlayer){ if ((p.getDistanceToEntity(this) < 3) && ((p.rotationPitch > 70) && (p.rotationPitch < 110))) { double ydir = p.posY - this.posY; Vec3 dir = p.getLookVec(); dir.yCoord = 0; dir.normalize(); ((EntityPlayer)p).addVelocity(0, 100, 0); FMLLog.info("Current motion:" + p.motionX + " " + p.motionY + " " + p.motionZ); } } break; case 5: specialAttack(var1, 4); break; default: break; } this.setDead(); }[ /code] So if anyone know's why changing motion dosen't affect player, please do tell me.
  13. Well I guess I will keep it non-solid then. Not going to screw with that -.-
  14. There really isnt any other way to make the entity solid? Cause I want it to be compatibly with everything...
  15. Hello, I am having a problem with my entity's collision box, specificly it lets players go thru the entity, I dont want that. I tried every possible way I saw in the vanilla minecraft logic... sadly couldnt get it to work. Here is my code, Currently everything but the collision box works perfectly so I dont see point posting any other source's. But if needed I will. Before I tried to make the block do what I planed, but it was causing even more trouble...
  16. Ur entity must implement a custom packet system, specificly IEntityAdditionalSpawnData think of it as of NBT Read/write... you also need the nbt read/write too though (if you want entity to carry data thru map save's and load's)
  17. what about someone decompiles some of the existing plugins for it? redpower nei plugin for example...
  18. I do belive making a custom fire block will be alot easier, as in how you plan doing this in a tickHandler anyway? In the case of custom fire you simple override the updateTick (in which case fire block has it overrided already anyway) as this is fire it has its own ticking you could for example if want it to spread do super.updateTick(), or just override it if dont want spreading of ur own fire... also for this to work, you simply set the block, and then schudle the update of the block...
  19. I am sure you will find ur solution here http://www.minecraftforge.net/wiki/Containers_and_GUIs#Opening_the_GUI
  20. yes this may look a bit confusing but how it works is anything that goes to "xxx" is of type string recipes for component indification use characters, and that is writen with singe quotes like this 'x' I had this problem couple times, its anoying but whatcha gonna do...
  21. You might aswell use the way Thaumcraft 3 is having all his info boxes on items, Though its not the same box, this would add one more gui but I guess you can add a toggle to not spam up the screen with windows
  22. Why not set it to custom controls via keybinding them? Just like BMW Car mod does it, they dont override the vannila controls, they present own control setting for users.
  23. That is a bit of problem if you need a specifc air block instance, but if you want to check if its an air or not, world class provides function just for that World.java > 431 Line. Heres cutout of it. Hope I helped in any way, one way you could do this is check every users location via server tick event and check as whatever they are in specifc biom and are in air or whatever and then just do what ever you wanted with them. Just an idea....
×
×
  • Create New...

Important Information

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