Ok since no1 has posted one useful thing about minecart physics I'm gunna ask here.
I'm modding, using mcp, to make powered minecarts better. I've got them running indefinitely but I'm having trouble changing the physics to make it so powered minecarts run faster, and can push a mounted minecart (or several) up a 1:1 slope. I think I understand where in entityminecart that physics is applied (on update gives powered minecarts push, and applyentitycollision for bumping into minecarts). Any help is appreciated
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Ok since no1 has posted one useful thing about minecart physics I'm gunna ask here.
I'm modding, using mcp, to make powered minecarts better. I've got them running indefinitely but I'm having trouble changing the physics to make it so powered minecarts run faster, and can push a mounted minecart (or several) up a 1:1 slope. I think I understand where in entityminecart that physics is applied (on update gives powered minecarts push, and applyentitycollision for bumping into minecarts). Any help is appreciated
package net.minecraft.src;
public class ItemToolIron extends ItemTool
{
public ItemToolIron(int i, int j, EnumToolMaterialIron enumtoolmaterialiron, Block ablock[])
{
Item(i);
efficiencyOnProperMaterial = 12F;
toolMaterial = enumtoolmaterialiron;
blocksEffectiveAgainst = ablock;
maxStackSize = 1;
setMaxDamage(enumtoolmaterialiron.getMaxUses());
efficiencyOnProperMaterial = enumtoolmaterialiron.getEfficiencyOnProperMaterial();
damageVsEntity = j + enumtoolmaterialiron.getDamageVsEntity();
}
public float getStrVsBlock(ItemStack itemstack, Block block)
{
for(int i = 0; i < blocksEffectiveAgainst.length; i++)
{
if(blocksEffectiveAgainst[i] == block)
{
return efficiencyOnProperMaterial;
}
}
return 1.0F;
}
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
{
itemstack.func_25190_a(2, entityliving1);
return true;
}
public boolean func_25008_a(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving)
{
itemstack.func_25190_a(1, entityliving);
return true;
}
public int getDamageVsEntity(Entity entity)
{
return damageVsEntity;
}
public boolean isFull3D()
{
return true;
}
private Block blocksEffectiveAgainst[];
private float efficiencyOnProperMaterial;
private int damageVsEntity;
protected EnumToolMaterialIron toolMaterial;
}
*** Minecraft Coder Pack Version 2.11 ***
MCP 2.11 running in C:\Documents and Settings\Administrator.ILIA\Desktop\mcp2
Compiling Minecraft
sources\minecraft\net\minecraft\src\ItemToolIron.java:7: cannot find symbol
symbol : constructor ItemTool()
location: class net.minecraft.src.ItemTool
{
^
sources\minecraft\net\minecraft\src\ItemToolIron.java:8: cannot find symbol
symbol : method Item(int)
location: class net.minecraft.src.ItemToolIron
Item(i);
^
2 errors
*** minecraft_server.jar was not found, skipping
=== MCP 2.11 recompile script finished ===
Press any key to continue . . .
Hm...
Well if you copied everything exactly then I'm not sure what to do...
Unfortunately, It is the redstone wire that decides how far it is powered... not what is powering it.
You may want to add something to check the id of the power source and if it is your block's id l1=5.
But it might be a little more complicated than that.
Ah. Again there seems to be a misunderstanding. I meant 5 blocks in a given direction wirelessly, not reducing the current strength of the wire.
Oh in that case try adding something like this:
public boolean isIndirectlyPoweringTo(World world, int i, int j, int k, int l)
{
if(l == 0)
{
return isPoweringTo(world, i, j, k, l);
} else if(l >0 && l <= 5)
{
return true;
}else
{
return false;
}
}
But thats just a guess...
I have no clue what l does.
EDIT:
Well now I'm just guessing... I don't think I can help you :S
Well now I'm just guessing... I don't think I can help you :S
Most people seem clueless when it comes to modding redstone. I've seen very few mods that tackle things like this. I have seen one wireless transmitter before, but it was quite different from what I need.
Well now I'm just guessing... I don't think I can help you :S
Most people seem clueless when it comes to modding redstone. I've seen very few mods that tackle things like this. I have seen one wireless transmitter before, but it was quite different from what I need.
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
lol well i checked out the code, they literally just multiplied the physics of powered minecarts by 5000 for both x and z coords, and it produces a funny bug (or maybe thats a bug on mine from screwing with the physics so much) that when i applied what they did, a sudden turn on the track or a push to it makes the minecart SHOOOOT away from you and the track.. i made it so my physics basically can jump a ramp and fly away (diagonally however)
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
lol well i checked out the code, they literally just multiplied the physics of powered minecarts by 5000 for both x and z coords, and it produces a funny bug (or maybe thats a bug on mine from screwing with the physics so much) that when i applied what they did, a sudden turn on the track or a push to it makes the minecart SHOOOOT away from you and the track.. i made it so my physics basically can jump a ramp and fly away (diagonally however)
Hehe I'll have to see that when your done.
Can we think... the next glider mod?!?!? :biggrin.gif:
Lol possibly, i could probably replicate how that happened. I think i removed a line of code was supposed to make your Y axis (height) velocity decrease every update tick (assuming its not 0), which caused my minecart to float in mid air after i ramped off the side of a hill i lead the tracks up after traveling a short distance and then losing its X and Z velocitys, so if you used those physics and maybe controlling your x & z movements with normal movement keys and your Y with your jump to go up and another button to go down, i think it would be entirely possible.
As for the minecarts shooting away, i never did find 2 of them.. not quite sure how far they went but with the speed multiplied by 5000 like in the mod you linked, and with me jumping out and pushing or doing something they just flew away, not quite sure if i could replicate that result
edit : the first time i stayed inside and removed the track causing it to fly off, the 2nd time was when they flew far off on a closed track when i jumped out at the top of the hill
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
i realy want to learn modding but all the tutorialals are too complicated, could u find me a starter tutorial, i tried but i didnt find anything like that
This is the tutorial i used to start out, its a great one imo.
Edit: if you take a look at the tutorial on that link for creating a new item type if should direct you to exactly what you need for your mod, his example is making a new food type
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
i realy want to learn modding but all the tutorialals are too complicated, could u find me a starter tutorial, i tried but i didnt find anything like that
This is the tutorial i used to start out, its a great one imo.
Edit: if you take a look at the tutorial on that link for creating a new item type if should direct you to exactly what you need for your mod, his example is making a new food type
Yeah that one was very helpful.
Here are two others at the bottom of this post -> Here
Thanks for helping me in my last problem, any idea abbout this...
ok so i made my gem block generate in the world at depth 64 (ground level) however i want to make this random like diamond, but i want it only appear ATLEAST at 16 all the way down to bedrock. also if its possible, make the ore only on the side of caves instead of in the middle of a cave. (if you get what i mean)
-snip-
i found a tutorial that said do this...
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 120; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(16);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(gem.blockID, 4)).generate(world, rand, randPosX , randPosY , randPosZ );
}
}
}
and it works however i dont reely understand it and its not much good if i dont understand what the code means so can you explain these...
for(int i = 0; i < 120; i++)
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(16);
int randPosZ = chunkZ + rand.nextInt(16);
thanks in advance. your a great guy!
for(int i = 0; i < 120; i++)
Is creating a loop that will run 120 times. i = 0 and while i is less then 120... each round i gets 1 added to it.
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(16);
int randPosZ = chunkZ + rand.nextInt(16);
Creates a random number from 0 to 15 (because the number is exclusive) and adds it to the x and z cords given by the method. The y cord is only a random number because the bottom of the world is 0 so rand.nextInt(16) will create a random number from 0-15 blocks up from the bottom of the world.
(new WorldGenMinable(gem.blockID, 4)).generate(world, rand, randPosX , randPosY , randPosZ );
Generates a max of 4 blocks of gems in 1 group according to the generate rules of WorldGenMinable.
To get your gem to spawn near air you need to make your own gen class.
Here is one that is a copy of WorldGenMinable but with your spawning conditions added:
I added the method check(World world, int i, int j, int k) to check if 1 of the 6 block surrounding your block is stone and if 1 of the 6 blocks is air (not opaque).
If it meets the conditions... it will generate.
Here it is added to your modloader code:
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 120; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(16);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenYourMinable(gem.blockID, 4)).generate(world, rand, randPosX , randPosY , randPosZ );
}
}
I've noticed that also, there's something to do with the number 256 in coding I've seen it in other things, it is 16x16 so I think it has to do with the pixels
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Is creating a loop that will run 120 times. i = 0 and while i is less then 120... each round i gets 1 added to it.
Keep in mind that this loop controls the probability of your ore occurring. The smaller the loop, the rarer the ore will be. 120 makes it extraordinarily common. Diamond uses 1, Gold uses 2 and Coal uses 20.
Also the number 256 is not to do with pixels, it's the number of bits of information one memory unit in a computer can store, or something like that. It's why colours and such are usually between 0 and 255 when defining their levels on a computer.
Keep in mind that this loop controls the probability of your ore occurring. The smaller the loop, the rarer the ore will be. 120 makes it extraordinarily common. Diamond uses 1, Gold uses 2 and Coal uses 20.
Also the number 256 is not to do with pixels, it's the number of bits of information one memory unit in a computer can store, or something like that. It's why colours and such are usually between 0 and 255 when defining their levels on a computer.
Well I knew that, I just didnt think it pertained to that code. Also I was thinking, it may have to do with there being 256 slots in terrain.png since it has 16x16 rows and columns, so those id's are reserved. Arg trying to reply and read code on a phone browser sucks
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Well I knew that, I just didnt think it pertained to that code. Also I was thinking, it may have to do with there being 256 slots in terrain.png since it has 16x16 rows and columns, so those id's are reserved. Arg trying to reply and read code on a phone browser sucks
It's because there are 256 slots in the terrain.png, yes, so 256 IDs are set aside to account for one per slot.
Hey Th3Guy, my Gem mod is coming along nicley thanks to you! just want to say thanks again, also i was wondering...
When the GemBlock is destroyed with my hand or any other non-pickaxe item no item is dropped (this is good)
But when the GemBlock is destroyed with only a wooden pickaxe the item is dropped (this is bad)
i would like people to have to use ATLEAST a iron pickaxe but i cant figure out how to change this...
im guessing its something to do with
super (i, j, Material.rock);
thanks again! I will put your name on my Mod Thread when i finish! =)
You were correct with your guess, change "Material.rock" to "Material.iron"
edit: wait that may be wrong, test it but im gunna look at something else real quick
edit2: ok well yeah i think i was wrong with the first answer, go into ItemPickaxe.Java and add this into the canHarvestBlock(Block block) function
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
how would i go about doing that, i asked on the thread but could i decompile that with MCP? i wasnt sure if u could decompile a modded game
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
I don't think it can... :S
Since arys wrote the code most of it will be readable but some of it will be Notch's obfuscated junk.
Here is the decompiler I use:
http://download.cnet.com/Cavaj-Java-Decompiler/3000-2213_4-10071619.html
Hm...
Well if you copied everything exactly then I'm not sure what to do...
Sorry I wasn't much help.
Oh in that case try adding something like this:
But thats just a guess...
I have no clue what l does.
EDIT:
Well now I'm just guessing... I don't think I can help you :S
Most people seem clueless when it comes to modding redstone. I've seen very few mods that tackle things like this. I have seen one wireless transmitter before, but it was quite different from what I need.
This is the best I've seen: http://www.minecraftforum.net/viewtopic.php?f=25&t=162515
But your right in that it doesn't look like what you want.
That and this: http://www.minecraftforum.net/viewtopic.php?f=25&t=84500
alright ill try it out, i think what the velocity goes off of will be inside of Notch's obfuscated junk so ill just compare for differences
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Hehe I'll have to see that when your done.
Can we think... the next glider mod?!?!? :biggrin.gif:
As for the minecarts shooting away, i never did find 2 of them.. not quite sure how far they went but with the speed multiplied by 5000 like in the mod you linked, and with me jumping out and pushing or doing something they just flew away, not quite sure if i could replicate that result
edit : the first time i stayed inside and removed the track causing it to fly off, the 2nd time was when they flew far off on a closed track when i jumped out at the top of the hill
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
http://www.minecraftforum.net/viewtopic.php?f=25&t=103030
This is the tutorial i used to start out, its a great one imo.
Edit: if you take a look at the tutorial on that link for creating a new item type if should direct you to exactly what you need for your mod, his example is making a new food type
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Yeah that one was very helpful.
Here are two others at the bottom of this post -> Here
Is creating a loop that will run 120 times. i = 0 and while i is less then 120... each round i gets 1 added to it.
Creates a random number from 0 to 15 (because the number is exclusive) and adds it to the x and z cords given by the method. The y cord is only a random number because the bottom of the world is 0 so rand.nextInt(16) will create a random number from 0-15 blocks up from the bottom of the world.
Generates a max of 4 blocks of gems in 1 group according to the generate rules of WorldGenMinable.
To get your gem to spawn near air you need to make your own gen class.
Here is one that is a copy of WorldGenMinable but with your spawning conditions added:
I added the method check(World world, int i, int j, int k) to check if 1 of the 6 block surrounding your block is stone and if 1 of the 6 blocks is air (not opaque).
If it meets the conditions... it will generate.
Here it is added to your modloader code:
Yeah 256 always gets added on.
I'm not sure why...
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
Keep in mind that this loop controls the probability of your ore occurring. The smaller the loop, the rarer the ore will be. 120 makes it extraordinarily common. Diamond uses 1, Gold uses 2 and Coal uses 20.
Also the number 256 is not to do with pixels, it's the number of bits of information one memory unit in a computer can store, or something like that. It's why colours and such are usually between 0 and 255 when defining their levels on a computer.
Well I knew that, I just didnt think it pertained to that code. Also I was thinking, it may have to do with there being 256 slots in terrain.png since it has 16x16 rows and columns, so those id's are reserved. Arg trying to reply and read code on a phone browser sucks
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU
It's because there are 256 slots in the terrain.png, yes, so 256 IDs are set aside to account for one per slot.
You were correct with your guess, change "Material.rock" to "Material.iron"
edit: wait that may be wrong, test it but im gunna look at something else real quick
edit2: ok well yeah i think i was wrong with the first answer, go into ItemPickaxe.Java and add this into the canHarvestBlock(Block block) function
Bored enough to watch some vanilla lets plays? http://www.youtube.com/user/Crump3txxix
Need a good universal mob farm? Check out the Double Shift Towers. Designed for 1.9 and gets 22,000 Items / Hour with a very simple redstone set up - https://www.youtube.com/watch?v=jL8aoJpjjgU