Closed SamNosliw closed 9 years ago
This would be better suited as a pull request so it can be more easily reviewed. From your description, you've identified a possible problem with Glowstone which may be valid, but the lengthy amount of code presented is simply unreviewable because it would be too time consuming.
If possible, please link/create a ticket for the issue and open a pull request with these changes. Thanks!
Yes, seems like a waste of all that work to put it into a non-met gable issue lol
Non mergable issue
Ok, I didn't really understand how GitHub worked with this, but now I've looked into it a little more. Although I still don't understand I made a pull request (I hope).. https://github.com/GlowstoneMC/Glowstone/pull/636
Hey man, I have great respect for what your doing with Project Glowstone, and I've had a look at the project, modifier it a bit and such, and I've managed to get water/lava working pretty well, I believe the same as vanilla Minecraft. I don't know what your plans are, but I would just like to offer this to you.
I also added a couple requestPulse functions into the world, these allow water to update in a similar manor to normal Minecraft, they are a way to regulate updates. Anyway, here is the code if you want to have a look, please tell me if I missed out any code or haven't explained it well, the lack of comments is a bad habit of mine, thanks for your time:
net.glowstone.block.blocktype.BlockLiquid.java
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import net.custom.sliwco.Util; import net.glowstone.block.GlowBlock; import net.glowstone.block.GlowBlockState; import net.glowstone.entity.GlowPlayer; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector;
public abstract class BlockLiquid extends BlockType {
}
I added a physics update to block breaking/placing, as well as a pulse method for receiving the regular pulses:
net.glowstone.block.blocktype.BlockType.java
public void afterDestroy(GlowPlayer player, GlowBlock block, GlowBlockState oldState) {
// Cancel if pulse sent to empty block data (caused when updated and not removed). me.getWorld().cancelPulse(me); }
Here is also my pulse framework that I added into the world
net.glowstone.GlowWorld.java
private final Map<Location, Integer> tickMap = new HashMap<>();
private void pulseTickMap() { ItemTable itemTable = ItemTable.instance(); Map<Location, Integer> map = getTickMap(); for (Map.Entry<Location, Integer> entry : map.entrySet()) { if (worldAge % entry.getValue() == 0) { GlowBlock block = this.getBlockAt(entry.getKey()); BlockType notifyType = itemTable.getBlock(block.getTypeId()); if (notifyType != null) notifyType.recievePulse(block); } } }
and this wad added inside the GlowWorld.pulse() method, allowing it to function.
Thanks for your time, Nosliw