larsgerrits
Members-
Posts
3462 -
Joined
-
Last visited
-
Days Won
17
Everything posted by larsgerrits
-
Maybe you could make it when the client needs the propertie, the server sends a packet to the client with that propertie, instead of synchronizing the all the time.
-
[1.7.2] Best way to approcah making a power system
larsgerrits replied to KeeganDeathman's topic in Modder Support
Take a look at my source, i created a custom power system: https://github.com/Larsg310/PowerCraft/blob/master/src/main/java/larsg310/mods/powercraft/energy/EnergyNet.java In that class is a utility method for distributing enrgy to surrounding block/cables. It also uses my IEnergy interface that have some methods for connecting and distributing, and my EnergyBar class which actually holds the max power it can hold, the current power it holds and some method for manipulating the energy. P.S. If you see something wrong with my system, please say so so i can make it better. -
@knokko, Why do you pass in null in the Magic.get() method? You need to pass in a EntityPlayer object. (Hint: You got that as a parameter in the method)
-
In the BlockEvent (the class that BreakEvent extends) is a EntityPlayer object which you can get the angles from.
-
[1.7.2][unsolved] save mana in world [mana is glitching]
larsgerrits replied to knokko's topic in Modder Support
You probably mean the Magic.get method because the class is called Magic... -
[1.7.2][unsolved] save mana in world [mana is glitching]
larsgerrits replied to knokko's topic in Modder Support
A call to .markDirty() makes Minecraft save the WorldSavedData. -
So how would then that go, X Y Z. isnt "Z" for UP and DOWN ?! da hell, was i looking at google pictures. if(world.getBlock(x, y, z) != Blocks.dirt || world.getBlock(x + 0, y + 0, z + 1) != Blocks.dirt || world.getBlock(x, y + 0, z + 1) != Blocks.dirt|| world.getBlock(x + 0, y, z) != Blocks.dirt) Like this then ?! In Minecraft, the coordinate system is weird. X is for east/west, Y is for up/down and Z is for north/south.
-
[1.7.10]Custom pig throwing errors and not spawning
larsgerrits replied to The_Fireplace's topic in Modder Support
@proalt That doesn't have anything to do with the error. @F1repl4ce Caused by: java.lang.NullPointerException at f1repl4ce.unlogic.entities.CustomPig.applyEntityAttributes(CustomPig.java:44) Can you post line 44 of CustomPig.java? -
My entity extend EntityCreature, and this are the AI tasks: this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIRobotBuild(this)); this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); The thing i want is that when the EntityAIRobotBuild is running, i don't want the EntityAIWander to execute, as that messes up the placement of the blocks. If you want to see more code, like EntityAIRobotBuild, you can use the link in the main post to go to my GitHub.
-
You don't add the World as a parameter... You can get the world by using event.player.worldObj
-
You need to override the method public int getBlockColor() and public int getRenderColor(int) to return 16777215, so it won't get colored, but use your texture. (Don't ask me how you get this number, found it in Block.getBlockColor())
-
FMLCommonHandler.instance().bus() vs MinecraftForge.EVENT_BUS
larsgerrits replied to WorldsEnder's topic in Modder Support
FMLCommonHandler.instance().bus() is used for FML events, and MinecraftForge.EVENT_BUS for Forge events. -
Code would be usefull....
-
Crafting Table GUI immediately closes on open
larsgerrits replied to Yamajac's topic in Modder Support
I'll give up. I guess you don't want to follow the official Java Conventions... -
Crafting Table GUI immediately closes on open
larsgerrits replied to Yamajac's topic in Modder Support
About 2: Here's a quoute from Wikipedia: So why areyou saying that isn't CamelCased? That is defenitly CamelCased. Please use those conventions! -
[1.7.10][Solved] Item modifies terrain, but blocks keep changing back
larsgerrits replied to UFIOES's topic in Modder Support
You are doing things client side, do those server side. Hint: Use world.isRemote , that will return true if it's client and false if it's server. -
WTF Does this code mean: Block.getBlockById(Block.getIdFromBlock(this) You are basicly getting a block from a id which you get from a block. You could've just used this instead of that chain of code....
-
[1.7.2/1.7.10] Make mod compatible with BuildCraft MJ
larsgerrits replied to KeeganDeathman's topic in Modder Support
Use Buildcrafts API.