coolboy4531
-
Posts
584 -
Joined
-
Last visited
Posts posted by coolboy4531
-
-
Why not just override the method?
-
Thank you, I actually learned a lot with reflection.
Now, here's the problem, I don't know how to implement it to the events.
Too much .... Exceptions (NoSuchFieldException, IllegalArgumentException, etc.) idk.
I feel so retarded.
-
Okay, hold it.
I need you to restate that, because my brain - just too much work and stress happenin' right now .
So you are trying to tell me that the "instance" is the SRG name ("field_****")?
If so, would Forge automatically change that when the srg name is changed - to the actual value instead of field_**** to (e.g. getBlockName() )?
Also, how would I use it with the event?
@SubscribeEvent public void onEntityJoinedWorld(EntityJoinWorldEvent event) { if (event.entity instanceof EntitySkeleton) { //what do I do here? //do I do -- Field.set(instance, value) -- ? } }
-
Yep, made perfect sense
Although you can replace that field via reflection every time a skeleton is spawned (EntityJoinWorldEvent)
Yeah, I was leaning towards that, I learned a few things about Java reflection but not so deep into that.
If you can teach me a thing or two about how to replace that field, that would be greatful.
(You don't have to show me like noob codes, just need to get some advice )
If you would like to know how little I know about reflection I'll be happy to show what I know.
I know how to use "Field" to get the private value.
public class RandomClass { private String s = "hi"; }
public class RandomClazz { public static void main(String[] args) throws Exception { RandomClass randClass = new RandomClass (); Field f = randClass.getClass().getDeclaredField("s"); f.setAccessible(true); System.out.println(f.get(randClass)); } }
In my opinion, I don't even THINK this would work, because it was a long time ago that I learned this
-
Learnt how to change methods in ASM, was worth it. lol
Now, I'm trying to learn how to change fields.
They're probably extremely similar, and probably easy to grab on to but I don't know where to learn
What I'm trying to do is lower the skeleton attack speed (I probably don't need to make a coremod, imo I don't know any alternatives)
Converting:
private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F);
to
private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 60, 60, 15.0F);
Any suggestions?
-
Code please.
-
We can't do anything without your code.
Base class, the items you use to craft the item, etc.
-
Look dude, wrong forum.
But I'll help you out
*hint* version =/= Server Version *hint*
-
editing the GameRegistry a bit
You did what? No no no no no no no no no no no no no no no. NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO. lol, just don't edit base classes pls.
Okay I'll help you with your item and block names, including your ores (I'm 100% positive they won't generate) What's the problem?
-
Have you used NBT tags to save your inventory slots?
-
Break points are to separate things (its kinda complex don't want to explain now)
Switches are used to do different things if the value of what is inside the switch corresponds to your case.
For example, you should make your code like this:
switch(ID){ case mainRegistry.guiIDSaltFurnace: if(entity instanceof TileEntitySaltFurnace){ return new ContainerSaltFurnace(player.inventory, (TileEntitySaltFurnace) entity); } break; case mainRegistry.guiIDgrinder: if(entity instanceof TileEntityGrinder){ return new ContainerGrinder(player.inventory, (TileEntityGrinder) entity); } break;
In my opinion, I think you 'ought to know more Java before jumping into complex things.
-
You don't get your item object from Items, because you never put it in there (its for vanilla items). You have to get the item object, from your OWN main class.
Give us code, please. It was hard to understand what you were talking about, without code of course.
-
Misread, let me see what I can do.
-
Then why do it?
mainRegistry:guiIDgrinder
What is this suppose to be? The ID of the block/item?
Come on dude, you should know that IDs were removed in 1.7 and uses the Block/Item object itself.
Also, never use @SupressWarnings("unused") or other things that you have NO IDEA does.
Another thing is to use context clues ("unused") = not being used.
So why do you think it says "Connection lost?"
If you give me more information of what you are trying to do with your switches, then I'll gladly help you out
-
PlayerInteractEvent is posted on the MinecraftForge bus not the FML bus.
FML Bus = FMLCommonHandler.instance().bus()
MinecraftForge Bus = MinecraftForge.EVENT_BUS
In other words, use the MinecraftForge EventBus.
-
player.openGui(ExampleMod.instance, 0, world, x, y,z);
dafuq is this, you are calling your mods instance and then doing nothing?
-
@SuppressWarnings("unused")
-
Should work unless you are using the wrong color (hex).
If you look into your BiomeGenBase you can look at the other biome's { .setColor(int) }
Also, have you registered your Biome? If so, can I take a peek at it?
-
Give us your main class.
-
Why the **** do you have 4 characters?
_ ##
Underscore, space, numbersign, numbersign?
-
Use MinecraftForge events.
PlayerEvent.ItemCraftedEvent - for crafting an item (applying the enchantment)
TickEvents - for making the item enchanted no matter what (creative inventory, etc.)
-
From what I remember, I don't think you need to set it.
Completely remove:
this.setLightOpacity(0);
-
Dirt = new Achievement("Dirt", "Dirt", 0, 0, Blocks.dirt, null).registerAchievement();
Source files as in Vanilla Minecraft run:
gradlew.bat setupDevWorkspace
-
You don't OPEN gradlew.bat (you need to follow the instructions on this post)
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
[1.6.4] my textures are not loaded by minecraft
in Modder Support
Posted
Is your object a Block or an Item? You decide.