Advertisement
Earthcomputer

diffs

Aug 16th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. diff --git a/src/net/earthcomputer/lightningtool/AbstractManipulator.java b/src/net/earthcomputer/lightningtool/AbstractManipulator.java
  2. index 816edf3..1f863cf 100644
  3. --- a/src/net/earthcomputer/lightningtool/AbstractManipulator.java
  4. +++ b/src/net/earthcomputer/lightningtool/AbstractManipulator.java
  5. @@ -22,7 +22,7 @@ public abstract class AbstractManipulator {
  6.  
  7. protected SearchResult bestResult;
  8. public static final Property<Integer> DISTANCE = Property.create("distance", Integer.MAX_VALUE, Integer.MAX_VALUE,
  9. - Property.minimize());
  10. + Property.indifferent());
  11.  
  12. protected RNGAdvancer<?> advancer;
  13. protected RNGAdvancer.ParameterHandler advancerParameterHandler;
  14. @@ -121,8 +121,10 @@ public abstract class AbstractManipulator {
  15. });
  16. }
  17.  
  18. - if (result.isIdeal())
  19. + if (result.isIdeal()) {
  20. + System.out.println(result);
  21. stop();
  22. + }
  23. });
  24.  
  25. long currentTime = System.nanoTime();
  26. diff --git a/src/net/earthcomputer/lightningtool/FortuneManipulator.java b/src/net/earthcomputer/lightningtool/FortuneManipulator.java
  27. index 61efda3..5d2b4d8 100644
  28. --- a/src/net/earthcomputer/lightningtool/FortuneManipulator.java
  29. +++ b/src/net/earthcomputer/lightningtool/FortuneManipulator.java
  30. @@ -19,6 +19,11 @@ public class FortuneManipulator extends AbstractManipulator {
  31. private Property<Integer> dropAmountProperty;
  32. private Property<Integer> xpDropAmountProperty;
  33.  
  34. + private static final Property<Integer> LAPIS_DROP_AMOUNT = Property.create("lapis amount", 32, 4,
  35. + Property.maximize());
  36. + private static final Property<Integer> REDSTONE_DROP_AMOUNT = Property.create("redstone amount", 8, 4,
  37. + Property.maximize());
  38. +
  39. public static final RNGAdvancer<?>[] ADVANCERS = { RNGAdvancer.HOPPER };
  40.  
  41. @Override
  42. @@ -59,11 +64,18 @@ public class FortuneManipulator extends AbstractManipulator {
  43.  
  44. @Override
  45. protected SearchResult testRegion(int x, int z) {
  46. + rand.saveState();
  47. + int lapisDropped = Ore.LAPIS.quantityDropped(fortuneLevel, rand);
  48. + rand.restoreState();
  49. + rand.saveState();
  50. + int redstoneDropped = Ore.REDSTONE.quantityDropped(fortuneLevel, rand);
  51. + rand.restoreState();
  52. int quantityDropped = ore.quantityDropped(fortuneLevel, rand);
  53. int xpDropped = ore.xpDropped(rand);
  54.  
  55. - return createSearchResult().withProperty(dropAmountProperty, quantityDropped).withProperty(xpDropAmountProperty,
  56. - xpDropped);
  57. + return createSearchResult().withProperty(LAPIS_DROP_AMOUNT, lapisDropped)
  58. + .withProperty(REDSTONE_DROP_AMOUNT, redstoneDropped).withProperty(dropAmountProperty, quantityDropped)
  59. + .withProperty(xpDropAmountProperty, xpDropped);
  60. }
  61.  
  62. @Override
  63. @@ -90,6 +102,8 @@ public class FortuneManipulator extends AbstractManipulator {
  64. }
  65. }
  66. properties.add(xpDropAmountProperty);
  67. + properties.add(LAPIS_DROP_AMOUNT);
  68. + properties.add(REDSTONE_DROP_AMOUNT);
  69. advancer.addExtraProperties(properties);
  70. return new SearchResult(properties);
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement