0 Members and 1 Guest are viewing this topic.
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.
You could always only be able to get lava buckets at the market for $100. Myabe
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.
I'm Much more smarter admin than whoever banned me.
Quote from: Nick3306 on April 13, 2013, 06:07:22 amI 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.
Is this necessary? Not really. We have coal and blaze rods.
Quote from: Chief149 on April 13, 2013, 02:40:31 amBasically 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?
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.
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: tiggy26668 on April 13, 2013, 04:35:52 amQuote from: Chief149 on April 13, 2013, 02:40:31 amBasically 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 me Quote from: Chief149 on April 13, 2013, 02:40:31 amBasically 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.
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: Chief149 on April 14, 2013, 01:27:25 amThe 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.Hey, I'm just telling you what was happening. I don't have an explanation for it.