So I was doing some Legend of Zelda stuff and came across one of the block puzzles in the game, and it sparked an idea.
I just have a few questions for all of you.
1. Are sliding block puzzles something the community might be interested in?
2. If anybody can explain to me why the blocks turn white when they are pushed, that would be greatly appreciated. I haven't been able to find anything in EntityFallingSand that shows what makes the blocks look like sand and not white blocks like mine.
3. I want the blocks to only move one block for every push; I was thinking of doing it so that once its position is very close to what the block itself would actually be, stop moving, center the block, and do a check on what block it's sitting on to determine what it does. I'm worried this would make the movement appear jerky.
I'm not interested in the puzzles, as a modder I'm interested in the blocks :biggrin.gif: Dude make a tutorial on how to do blocks like that, that move when you click them. That is really cool.
Also for the blocks, make them power stuff so you can use redstone logic gates to make cool and complex sequences to have it be more like puzzles.
I'm not interested in the puzzles, as a modder I'm interested in the blocks :biggrin.gif: Dude make a tutorial on how to do blocks like that, that move when you click them. That is really cool.
Also for the blocks, make them power stuff so you can use redstone logic gates to make cool and complex sequences to have it be more like puzzles.
I'm going to eventually make them arrive on top of blocks that put out a redstone signal so long as they have one of those blocks on them. It's a learning experience though; I'm practically diving into this blind.
Here are the parts of my block that have anything to do with the rendering of the moving entity.
public class EntityPushingBlock extends Entity
{
public int blockID;
public int b1;
public int c1;
public int rising = 0;
public String texture;
public EntityPushingBlock(World world, double d, double d1, double d2, int i, int b, int c)
{
super(world);
double startPosX = d;
double startPosY = d1;
double startPosZ = d2;
b1 = b;
c1 = c;
blockID = i;
preventEntitySpawning = true;
setSize(1F, 1F);
yOffset = height / 2.0F;
setPosition(d, d1, d2);
motionX = 0.1D * b;
motionY = 0.0D;
motionZ = 0.1D * c;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}
public String getEntityTexture()
{
return texture;
}
Which is near-identical to what appears in EntityFallingSand, the moving sand block that i'm using to learn from. I use ModLoader to override my block's texture with a custom one in the mod_ file:
Here are the parts of my block that have anything to do with the rendering of the moving entity.
public class EntityPushingBlock extends Entity
{
public int blockID;
public int b1;
public int c1;
public int rising = 0;
public String texture;
public EntityPushingBlock(World world, double d, double d1, double d2, int i, int b, int c)
{
super(world);
double startPosX = d;
double startPosY = d1;
double startPosZ = d2;
b1 = b;
c1 = c;
blockID = i;
preventEntitySpawning = true;
setSize(1F, 1F);
yOffset = height / 2.0F;
setPosition(d, d1, d2);
motionX = 0.1D * b;
motionY = 0.0D;
motionZ = 0.1D * c;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}
public String getEntityTexture()
{
return texture;
}
Which is near-identical to what appears in EntityFallingSand, the moving sand block that i'm using to learn from. I use ModLoader to override my block's texture with a custom one in the mod_ file:
is this your first mod? Well done for thinking high. I personally would start with a block, then an item, then a special block (speed or bouncy or w.e) then tool then armor and so on
I dont know. The only thing I know is that its going white because you didn't have a render file. You might have to edit base files but I really don't know. I was just suggesting that you at the falling sand render file, because it might be able to hep you
I know the general idea of the reason why it would turn white.
If you look at the block file for furnace, it shows that once it turns into a new block temporarily (burning furnace, 62) and then it would change bank when done
I just played around with it some, KMeister, and got it to work. Turns out that part can still be written as RenderFallingSand without causing problems.
@schoolboy
Thanks! I figured I would be able to learn the whole block, item, etc. process while making this.
I just played around with it some, KMeister, and got it to work. Turns out that part can still be written as RenderFallingSand without causing problems.
@schoolboy
Thanks! I figured I would be able to learn the whole block, item, etc. process while making this.
Gerhard I tried doing something similar to your code but it won't let me move blocks in any direction on the X axis and I'm not sure why. Can I PM you to take a quick look at my code?
NVM I got it working, I did something predictable retarded.
Your block inspired me to try to make something similar. I don't know how to embed videos, but .
Trying to make a handheld piston that pushes 1 block distance. I used beer as a placeholder texture because, well... beer is awesome. Still trying to figure out if I can set the texture for the entity based on what block was pushed.
First Video - Basics, bug testing, etc.
Second Video - Fixed bugs, added some content.
Third Video - Added detector, but new bug.
EDIT: Got most of the things worked out and added stuff to it. Anyone have comments, ideas, etc?
EDIT2: Unfortunately, whenever I place a detector next to / on top of / under a detector the whole game crashes. Gonna have to fix that soon.
I'm not interested in the puzzles, as a modder I'm interested in the blocks :biggrin.gif: Dude make a tutorial on how to do blocks like that, that move when you click them. That is really cool.
Also for the blocks, make them power stuff so you can use redstone logic gates to make cool and complex sequences to have it be more like puzzles.
Follow @jamolnng
The best way to contact me is via twitter.
I'm going to eventually make them arrive on top of blocks that put out a redstone signal so long as they have one of those blocks on them. It's a learning experience though; I'm practically diving into this blind.
Cool, but seriously make a tutorial or a code example on how to make those in java, I could have fun with them.
Follow @jamolnng
The best way to contact me is via twitter.
Which is near-identical to what appears in EntityFallingSand, the moving sand block that i'm using to learn from. I use ModLoader to override my block's texture with a custom one in the mod_ file:
Can anyone see why my entity is a white box?
Try changing this:
To This:
Also can I see how you have it set up in your block class to see how you get it to move?
Follow @jamolnng
The best way to contact me is via twitter.
You can probably use most of the stuff in there. I basically sets the light and texture while it moves.
Also, you'll probably have to put this outside the constructor in your mod_ file:
PS: This is awesome :biggrin.gif:
Never mind! I did a little messing around and got it working. Many thanks, KMeister, you're a great help. Your suggestion worked.
If you look at the block file for furnace, it shows that once it turns into a new block temporarily (burning furnace, 62) and then it would change bank when done
Follow @jamolnng
The best way to contact me is via twitter.
@schoolboy
Thanks! I figured I would be able to learn the whole block, item, etc. process while making this.
@jammolnng
I may have the code in a .zip soon.
Also, progress!
Ok thanks and you spelled my name wrong lol
jamolnng
Follow @jamolnng
The best way to contact me is via twitter.
PS: Let me know when you release it i would love to make a puzzle map with this
NVM I got it working, I did something predictable retarded.
Trying to make a handheld piston that pushes 1 block distance. I used beer as a placeholder texture because, well... beer is awesome. Still trying to figure out if I can set the texture for the entity based on what block was pushed.