I find it funny when you guys post code to show off. You obviously know that opti can do this stuff so the code you put in the topic is purely to show off.
Started by 2468avc, April 05, 2013, 09:43:54 PM
Quote from: andersad on April 13, 2013, 06:16:36 AM
This sounds like a VERY good idea to me, I mean like many others have said, If there's a way to prevent us from placing it but still let us pick it up and use it as fuel. This would be my solution to having to use all my coal to smelt connlestone into stone for stone bricks, instead, I could just use this, MUCH easier? But then again, that would defeat the whole point of us all even collection coal other than for torches? I support this idea anyways, It would make my life MUCH MUCH simpler.
Quote from: WoodenSlime on April 13, 2013, 06:16:36 AMYou could always only be able to get lava buckets at the market for $100. Myabe
Quote from: Nick3306 on April 13, 2013, 06:07:22 AM
I find it funny when you guys post code to show off. You obviously know that opti can do this stuff so the code you put in the topic is purely to show off.
Quote from: Nick3306 on April 13, 2013, 06:07:22 AM
I find it funny when you guys post code to show off. You obviously know that opti can do this stuff so the code you put in the topic is purely to show off.
Quote from: Chief149 on April 13, 2013, 08:48:36 PMWriting code is not a supporting argument. No one in this topic said it would be hard to code. The question is should we add it, showing us how to add it is irrelevant to the discussion.Quote from: Nick3306 on April 13, 2013, 06:07:22 AM
I find it funny when you guys post code to show off. You obviously know that opti can do this stuff so the code you put in the topic is purely to show off.
Way to be an ass. Just assume I'm being a showoff when I did not have that intention. It was purely to show that the implementation wouldn't be that difficult. In other words, just a supporting argument for why this should be implemented.
Its like saying that xDeeKay is a showoff because opti also knows what binary is.
Tiggy, to answer your question about flowing lava, that isn't an issue. Flowing lava must originate from the source block placed by the player holding a lava bucket. Basically each "event" which is triggered somehow has a state that says whether or not it should be cancelled. These events are created before any info about them is sent to the player. When the server finally processes each event, it looks at the cancelled state. If the cancelled state is true then the event is never processed. Because of this, the lava block is never placed, and therefore flowing lava is never created.
The game client on the other hand places a lava block as that is what it thinks should happen. But the lava block immediately disappears because the server says "No that isn't supposed to be there" so the placed block disappears.

Quote from: Chief149 on April 13, 2013, 10:14:02 PM
Is this necessary? Not really. We have coal and blaze rods.
Quote from: tiggy26668 on April 13, 2013, 04:35:52 AMQuote from: Chief149 on April 13, 2013, 02:40:31 AM
Basically to implement this:
1) Register a BlockPlaceEvent handler to the Opticraft server plugin (if not already done).
2) On the onBlockPlace method call add this:
public void onBlockPlace(BlockPlaceEvent bpEvent)
{
if(bpEvent.getBlockPlaced().getType() == Material.STATIONARY_LAVA)
{
if(!bpEvent.getPlayer().hasPermission("some.override.permission.for.moderators")))
{
bpEvent.setCancelled(true);
}
}
}
Personally I would have preffered to combine the two IF statements into one using &&, but since the forum text editor was being wierd I found it to look nicer for viewing with two seperate statements.
Basically, on each and every block placement, the above method is called. Then we check if the block placed is STATIONARY_LAVA, or a lava source block which is what is placed by a filled lava bucket. If I'm wrong then simply change the Material.<material> part on the first IF statement.
If it is a lava block, then check to see if the player who placed the lava has the override permission (such as a moderator permission). Notice I have the ! in front of the hasPermission() call. For those who don't know how to program, that simply stands for if the player DOESNT have the permission. If not, then we set the event state to be cancelled, and Bukkit does the rest.
Add that to the opticraft plugin, and allow lava buckets to be used. That code will block lava placement, but not picking up lava. So long as we can fill a lava bucket, we can use it in a furnace. No harm can be done as long as players can't place the lava.
lol you made the same mistake as cschurz
what about lava that isn't stationary?

Quote from: Chief149 on April 13, 2013, 02:40:31 AM
Basically to implement this:
1) Register a BlockPlaceEvent handler to the Opticraft server plugin (if not already done).
2) On the onBlockPlace method call add this:
public void onBlockPlace(BlockPlaceEvent bpEvent)
{
if(bpEvent.getBlockPlaced().getType() == Material.STATIONARY_LAVA)
{
if(!bpEvent.getPlayer().hasPermission("some.override.permission.for.moderators")))
{
bpEvent.setCancelled(true);
}
}
}
Quote from: cschurz on April 14, 2013, 12:06:06 AMOptical made it that way because they cant place it. We were getting tons of complaints about people wasting iron on buckets to have them filled with lava and then they can't do anything with it. Of course this suggestion gives it a use. There were also a lot of bugs with stopping members from placing water/lava. We had numerous cases where placing lava or water was possible even with the restriction.Quote from: tiggy26668 on April 13, 2013, 04:35:52 AMQuote from: Chief149 on April 13, 2013, 02:40:31 AM
Basically to implement this:
1) Register a BlockPlaceEvent handler to the Opticraft server plugin (if not already done).
2) On the onBlockPlace method call add this:
public void onBlockPlace(BlockPlaceEvent bpEvent)
{
if(bpEvent.getBlockPlaced().getType() == Material.STATIONARY_LAVA)
{
if(!bpEvent.getPlayer().hasPermission("some.override.permission.for.moderators")))
{
bpEvent.setCancelled(true);
}
}
}
Personally I would have preffered to combine the two IF statements into one using &&, but since the forum text editor was being wierd I found it to look nicer for viewing with two seperate statements.
Basically, on each and every block placement, the above method is called. Then we check if the block placed is STATIONARY_LAVA, or a lava source block which is what is placed by a filled lava bucket. If I'm wrong then simply change the Material.<material> part on the first IF statement.
If it is a lava block, then check to see if the player who placed the lava has the override permission (such as a moderator permission). Notice I have the ! in front of the hasPermission() call. For those who don't know how to program, that simply stands for if the player DOESNT have the permission. If not, then we set the event state to be cancelled, and Bukkit does the rest.
Add that to the opticraft plugin, and allow lava buckets to be used. That code will block lava placement, but not picking up lava. So long as we can fill a lava bucket, we can use it in a furnace. No harm can be done as long as players can't place the lava.
lol you made the same mistake as cschurz
what about lava that isn't stationary?
optical made that mistake, not meQuote from: Chief149 on April 13, 2013, 02:40:31 AM
Basically to implement this:
1) Register a BlockPlaceEvent handler to the Opticraft server plugin (if not already done).
2) On the onBlockPlace method call add this:
public void onBlockPlace(BlockPlaceEvent bpEvent)
{
if(bpEvent.getBlockPlaced().getType() == Material.STATIONARY_LAVA)
{
if(!bpEvent.getPlayer().hasPermission("some.override.permission.for.moderators")))
{
bpEvent.setCancelled(true);
}
}
}
this prevents users from placing stationary lava, yes. we already have that. the problem is that we have code that prevents members from collecting water/lava into buckets. i just removed that, but it's up to optical to approve it and update the server. i don't see why members shouldn't be allowed to collect stuff into buckets.
Quote from: Chief149 on April 14, 2013, 01:27:25 AMHey, I'm just telling you what was happening. I don't have an explanation for it.
The only way the restriction could be bypassed would be if another plugin is setting the cancelled state to false. Otherwise its impossible for that bug to be happening.
Quote from: Nick3306 on April 14, 2013, 01:28:38 AMQuote from: Chief149 on April 14, 2013, 01:27:25 AMHey, I'm just telling you what was happening. I don't have an explanation for it.
The only way the restriction could be bypassed would be if another plugin is setting the cancelled state to false. Otherwise its impossible for that bug to be happening.