Jump to content

Elix_x

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by Elix_x

  1. *Facepalm* Thanks for that tip.. I didn't realize that before. And also, i don't reccomend defining these as fields in class. Probably just in method...
  2. I was searching a lot in code, and i haven't found anything else usefull... So any more ideas??? Or this is +-hardly doable?
  3. Do you know that you can Configuration.class???
  4. Then show how, where and exact error log... And also you don't even need this method! I'm serious!
  5. You don't need that special separate class. Seriously, why do you think it's needed???
  6. Any ideas at least???
  7. field.get(instance) is the equal to instance.fieldName, with one but: You can access private fields like that... Some examples of reflection. These will be true: 1) this.a == getClass().getField("a").get(this); if a is public field 2) this.a == getClass().getDeclaredField("a").get(this); if a is not super field If a is private super field ( SuperClass{private Object a; ChildClass extends SuperClass{} ) , 1ststatement will give compile error, 2nd will throw null pinter, 3rd will throw null pinter, 4th will work: 1) Object b = a; 2) Object b = getClass().getField("a").get(this); 3) Object b = Class.forName("SuperClass").getField("a").get(this); 4) Object b = Class.forName("SuperClass").getDeclaredField("a").get(this); So it total, your method should probably look like this: Get super map with reflection Do all stuff and thigs with this map that you just got (get values, add, remove...) Set set super map using reflection to this changed map (just to be sure it changed) Return needed value
  8. In this case, you have to reflect a private field, it s done like so: 1) Get class (by name or in any way). 2) Call class.getDeclaredField(name) method to get private field (getField does not return private fields, but return super defined fields (getDeclaredField does not)). 3) Call field.setAcessible(true), this will make this field value acessible. 4) Now call either: 4.1) get(instance), where instance is instance of object from which you want to get this field (can be null for static fields)... 4.2) set(instance, value), where instance is instance of object from which you want to get this field (can be null for static fields) and value - value you want to set it to...
  9. Same thing applies for Configuration class: fields can not override or be overriden. Categories map in yor config is different from one from Configuration... Again: reflection/complete override...
  10. Your config is empty because, your private Map<String, Property> properties = new TreeMap<String, Property>(); that is defined in new class is empty... (because fields can't be overrided like methods)... You have 3 options to avoid this: - Override all emthods and fields in order to fill your porperties and not super one - Use reflection to get private field - getValues(), returns this private list without sorting. All you want to do now is convert Map<String, Property> into List<Property>...
  11. Oooops... Thanks! Haven't noticed that...
  12. Hello there, i encountered strange issue: world.getEntitiesWithinAABB returns empty list even if within this bounding box there are entities... For example if i give as args: Entity.class, AxisAlignedBB.getBoundingBox(127.99876129051927, 94.54184844685155, 270.3603175168877, 87.99876129051927, 54.541848446851546, 230.36031751688765) And go to that location in world, spawn pigs around me, run code then list returned will be empty... Any ideas of what is going wrong??? Thanks for help! If you have any questions - just ask!!!
  13. Ok, i was digging a lot and if found interesting thing: You can do what you want by: Creating new class that extends Configuration Creating another new class extending ConfigCategory In 2nd class override getOrderedValues(), this is method responsible for sorting. Sort here your values in any way Than in first class, override getCategory, and where it calls new ConfigCategory, call new YourConfigCategory instead And the last thing: in your config handler, instead of calling new Configuration, call new YourConfiguration That should work ...
  14. Ok, so go to your class that extends ModelBiped, where you render your piece of armor. Go to constructor, and add: final IModelCustom objModel = AdvancedModelLoader.loadModel(objModelResource); ModelRenderer objModelAttach = new ModelRenderer(this){ @Override public void render(float f) { objModel.renderAll(); } }; //set offset here bipedHead.addChild(objModelAttach); This is code with correct names... This should work...
  15. One idea is to add new child model to head model, which is going to be sub method class, which will render obj instead of model... Something like this: ObjModel model = ...; head.addChild(new Model(){ public void render(float f){ model.render(); } } );
  16. Are you sure that pngs are correct? (I mean that leg png has legs, etc...) Also, how exactly is it rendered: black&purple or wierd missplaced squares? If all above is correct, add printin to this method, and check for item - type - texture...
  17. Nope, it's written like that, but: you can pass null as Entity in excludingEntity, this will give you all entities, including subentities.... EDIT: for more info, here 2 core methods from Chunk class, that are doing that, take look at them: getEntitiesOfTypeWithinAAAB, getEntitiesWithinAABBForEntity (=excluding)
  18. 2 as before... Show your whole class and place where you register all parts...
  19. Show the code and error's place... Also, you can create non static final fileds and initialize them in constructor taking value from config (or config handler)...
  20. What is the difficulty there??? Create normal forge config, get ids from it and pass as args for biome/dimension...
  21. Hi, this is my question: Is it possible, and yes - how, to sync long between containers (server-client)? Or i have to use packets??? Why i am using longs: in my tileentity, because of use of big numbers, multiplications of integers wre going wrong (10000*989000=-216578532), so i decided to use longs instead... Thanks for help! If you have any questions - just ask!!!
  22. Yes, i can, but there something that doesn't allow you to try yourself? MCF community can always help, if you have problems...
  23. its a custom minecraft axe i created that i want to cut down the entire tree but i cant find anything on how to do that As i said above, it's +- complicated algortihm... If you're good at both java and mc modding, then you can do this... If not, begin with easier things...
  24. Not completely, just have to wrap and reunwrap ints in each loop... Tehre's 2 sub types: one that works for logs and only "hardcoded" logs, and one that works on all wooden blocks... (But still, both will cut only same block)...
×
×
  • Create New...

Important Information

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