mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Obfuscation helpers
This commit is contained in:
@@ -1,25 +1,38 @@
|
||||
From efdbf6479d70b20959933d43eae954e9d1d2b9c9 Mon Sep 17 00:00:00 2001
|
||||
From a0a4abaa7e4b3ee773d5ed33d845fc743dbdf541 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 16:20:21 -0500
|
||||
Subject: [PATCH] Campfires should fall with gravity
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockCampfire.java | 20 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 24 insertions(+), 1 deletion(-)
|
||||
src/main/java/net/minecraft/server/Block.java | 1 +
|
||||
.../net/minecraft/server/BlockCampfire.java | 26 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
3 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 8e16162a7..47a3ddd7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -375,6 +375,7 @@ public class Block implements IMaterial {
|
||||
PacketDebug.a(world, blockposition);
|
||||
}
|
||||
|
||||
+ public int tickRate(IWorldReader world) { return this.a(world); } // Purpur - OBFHELPER
|
||||
public int a(IWorldReader iworldreader) {
|
||||
return 10;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 5cbe8e68e..904bf47b8 100644
|
||||
index 5cbe8e68e..eca3487b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -72,8 +72,26 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
@@ -72,8 +72,32 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.j(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f());
|
||||
}
|
||||
|
||||
+ // Purpur start - Campfires should fall with gravity
|
||||
+ @Override
|
||||
+ public void onPlace(IBlockData iblockdata, World world, BlockPosition pos, IBlockData iblockdata1, boolean flag) {
|
||||
+ world.getBlockTickList().a(pos, this, this.a((IWorldReader) world));
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -30,16 +43,22 @@ index 5cbe8e68e..904bf47b8 100644
|
||||
+ if (iblockdata.get(BlockCampfire.d) && iblockdata.get(BlockCampfire.b)) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(BlockCampfire.b, false), 3);
|
||||
+ }
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int tickRate(IWorldReader world) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ generatoraccess.getBlockTickList().a(blockposition, this, this.a((IWorldReader) generatoraccess)); // Purpur - Campfires should fall with gravity
|
||||
+ generatoraccess.getBlockTickList().a(blockposition, this, tickRate(generatoraccess)); // Purpur - Campfires should fall with gravity
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess));
|
||||
}
|
||||
@@ -107,7 +125,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
@@ -107,7 +131,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) {
|
||||
@@ -49,7 +68,7 @@ index 5cbe8e68e..904bf47b8 100644
|
||||
|
||||
if (flag) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5e9c633ac..6e6d6defd 100644
|
||||
index cea2bcad5..dc2da586e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -61,6 +61,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user