2014-07-21 22:46:54 +02:00
|
|
|
From c4877d01ec94b74594b67ec8562dd9ae171235cc Mon Sep 17 00:00:00 2001
|
2014-07-06 09:50:09 +02:00
|
|
|
From: gsand <gsandowns@gmail.com>
|
2014-07-06 09:47:46 +02:00
|
|
|
Date: Sun, 6 Jul 2014 02:46:20 -0500
|
2014-06-22 22:44:13 +02:00
|
|
|
Subject: [PATCH] Inverted Daylight Detector Toggle
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockDaylightDetector.java b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
|
2014-07-03 03:47:25 +02:00
|
|
|
index 96e9c37..dc84635 100644
|
2014-06-22 22:44:13 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockDaylightDetector.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
|
2014-06-24 14:21:58 +02:00
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
package net.minecraft.server;
|
2014-06-22 22:44:13 +02:00
|
|
|
|
2014-07-03 03:47:25 +02:00
|
|
|
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
|
2014-06-24 14:21:58 +02:00
|
|
|
+
|
2014-06-22 22:44:13 +02:00
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class BlockDaylightDetector extends BlockContainer {
|
2014-06-24 14:21:58 +02:00
|
|
|
@@ -38,14 +40,27 @@ public class BlockDaylightDetector extends BlockContainer {
|
2014-06-22 22:44:13 +02:00
|
|
|
f += (6.2831855F - f) * 0.2F;
|
|
|
|
}
|
|
|
|
|
|
|
|
- i1 = Math.round((float) i1 * MathHelper.cos(f));
|
|
|
|
- if (i1 < 0) {
|
|
|
|
- i1 = 0;
|
2014-06-24 14:21:58 +02:00
|
|
|
- }
|
2014-06-22 22:44:13 +02:00
|
|
|
+ // PaperSpigot start - Inverted Daylight Detectors
|
2014-07-03 03:47:25 +02:00
|
|
|
+ if (PaperSpigotWorldConfig.InvertedDaylightDetectors) {
|
2014-06-22 22:44:13 +02:00
|
|
|
+ i1 = Math.round((float) i1 * MathHelper.cos(f) * -1 + 15);
|
|
|
|
+ if (i1 < 10) {
|
|
|
|
+ i1 = 0;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (i1 > 15) {
|
|
|
|
- i1 = 15;
|
2014-06-24 14:21:58 +02:00
|
|
|
+ if (i1 > 9) {
|
|
|
|
+ i1 = 15;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
2014-06-22 22:44:13 +02:00
|
|
|
+ i1 = Math.round((float) i1 * MathHelper.cos(f));
|
|
|
|
+ if (i1 < 0) {
|
|
|
|
+ i1 = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (i1 > 15) {
|
|
|
|
+ i1 = 15;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
+ // PaperSpigot end
|
|
|
|
|
|
|
|
if (l != i1) {
|
|
|
|
i1 = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, i, j, k, l, i1).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent
|
2014-07-03 03:47:25 +02:00
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
2014-07-06 09:47:46 +02:00
|
|
|
index 29863cd..c219cab 100644
|
2014-07-03 03:47:25 +02:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
2014-07-06 09:47:46 +02:00
|
|
|
@@ -109,4 +109,11 @@ public class PaperSpigotWorldConfig
|
2014-06-24 14:21:58 +02:00
|
|
|
{
|
2014-07-06 09:47:46 +02:00
|
|
|
babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D );
|
2014-06-22 22:44:13 +02:00
|
|
|
}
|
2014-06-24 14:21:58 +02:00
|
|
|
+
|
2014-06-22 22:44:13 +02:00
|
|
|
+ public static boolean InvertedDaylightDetectors;
|
|
|
|
+ private void InvertedDaylightDetectors()
|
|
|
|
+ {
|
2014-07-03 03:47:25 +02:00
|
|
|
+ InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false );
|
2014-06-22 22:44:13 +02:00
|
|
|
+ log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors );
|
|
|
|
+ }
|
2014-06-24 14:21:58 +02:00
|
|
|
}
|
2014-06-22 22:44:13 +02:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|