PaperMC/CraftBukkit-Patches/0013-Inverted-Daylight-Detector-Toggle.patch

69 lines
2.6 KiB
Diff
Raw Normal View History

2014-06-22 22:44:13 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
Date: Tue, 24 Jun 2014 08:01:42 -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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockDaylightDetector.java
+++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
2014-06-22 22:44:13 +02:00
+import org.spigotmc.SpigotWorldConfig; // PaperSpigot
+
2014-06-22 22:44:13 +02:00
import java.util.Random;
public class BlockDaylightDetector extends BlockContainer {
@@ -0,0 +0,0 @@ public class BlockDaylightDetector extends BlockContainer {
f += (6.2831855F - f) * 0.2F;
}
- i1 = Math.round((float) i1 * MathHelper.cos(f));
- if (i1 < 0) {
- i1 = 0;
- }
2014-06-22 22:44:13 +02:00
+ // PaperSpigot start - Inverted Daylight Detectors
+ if (SpigotWorldConfig.InvertedDaylightDetectors) {
+ i1 = Math.round((float) i1 * MathHelper.cos(f) * -1 + 15);
+ if (i1 < 10) {
+ i1 = 0;
+ }
- if (i1 > 15) {
- i1 = 15;
+ 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
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
{
babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D );
2014-06-22 22:44:13 +02:00
}
+
2014-06-22 22:44:13 +02:00
+ public static boolean InvertedDaylightDetectors;
+ private void InvertedDaylightDetectors()
+ {
+ InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false);
+ log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors );
+ }
}
2014-06-22 22:44:13 +02:00
--