Skip to content

Conversation

@501warhead
Copy link
Owner

No description provided.

501warhead and others added 30 commits July 10, 2019 20:03
Build indexes properly & prevent any non-utf8 character from being saved

See merge request 501warhead/omniscience!36
Port "Fix bamboo crash" into 1.15

See merge request lotc-master/omniscience!38

public class MessageParameter extends BaseParameterHandler {
private final Pattern pattern = Pattern.compile("[\\w!,:-\\\\*]+");
private final Pattern pattern = Pattern.compile("[\\w!,'-_.:-\\\\*]+");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about this change here to the regex


import io.github.warhead501.omniscience.Omniscience;

public class WorldParameter extends BaseParameterHandler {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be dangerous if used in rollbacks


@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onBlockBreak(BlockBreakEvent event) {
//System.out.println("Block Break - " + event.getBlock().getType());
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused comments

Comment on lines 23 to 39
OEntry.create().source(e.getPlayer()).grewBlock(new LocationTransaction<>(block.getLocation(), null, block)).save();
OEntry.create().source(e.getPlayer()).grewBlock(new LocationTransaction<>(block.getLocation(), block, null)).save();
}
}
}

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onBlockGrow(BlockGrowEvent e) {
if (isEnabled("grow")) {
OEntry.create().source(null).grewBlock(new LocationTransaction<>(e.getBlock().getLocation(), e.getBlock().getState(), e.getNewState())).save();
OEntry.create().source(null).grewBlock(new LocationTransaction<>(e.getBlock().getLocation(), e.getNewState(), e.getBlock().getState())).save();
}
}

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onBlockSpread(BlockSpreadEvent e) {
if (isEnabled("grow")) {
OEntry.create().source(null).grewBlock(new LocationTransaction<>(e.getBlock().getLocation(), e.getNewState(), e.getBlock().getState())).save();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an incorrect change. The state should be from -> to, so for newly grown blocks the original must be air, or null. Also, this may need adjustment for the aquatic update because I believe things can "grow" underwater now, yes?

return;
}

if (event.getBlockPlaced().getType().equals(Material.LECTERN) || event.getBlockPlaced().getType().equals(Material.SOUL_LANTERN) && event.getBlockPlaced().getState() instanceof Lectern &&
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soul Lantern? This seems strange

}
OEntry.create().source(event.getPlayer()).placedBlock(new LocationTransaction<>(event.getBlock().getLocation(), null, sign)).save();
} else {
Omniscience.getPluginInstance().getLogger().info("Unaple to parse changed sign for; " + event.getBlock());
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Unaple"

import org.jetbrains.annotations.Nullable;

@RequiredArgsConstructor
public enum OmniVersionHelper {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta be a better approach than this. Surely the plugin.yml stops this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants