summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-04-05 02:38:43 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-04-12 23:35:07 +0200
commit4cd49d7eca5f8fd53eb98577a1f218a5086704bb (patch)
tree09bf29a1d30a37445796ed70867f934435c4261f /src/Blocks
parentFixed generator for the Mega Taiga biome (#5129) (diff)
downloadcuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.gz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.bz2
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.lz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.xz
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.zst
cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockBed.cpp4
-rw-r--r--src/Blocks/BlockButton.h2
-rw-r--r--src/Blocks/BlockPiston.cpp4
-rw-r--r--src/Blocks/WorldInterface.h6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/Blocks/BlockBed.cpp b/src/Blocks/BlockBed.cpp
index 531f88345..4fe22dffd 100644
--- a/src/Blocks/BlockBed.cpp
+++ b/src/Blocks/BlockBed.cpp
@@ -75,7 +75,7 @@ bool cBlockBedHandler::OnUse(
// Sleeping is allowed only during night and thunderstorms:
if (
- !(((a_WorldInterface.GetTimeOfDay() > 12541) && (a_WorldInterface.GetTimeOfDay() < 23458)) ||
+ !(((a_WorldInterface.GetTimeOfDay() > 12541_tick) && (a_WorldInterface.GetTimeOfDay() < 23458_tick)) ||
(a_Player.GetWorld()->GetWeather() == wThunderstorm))
) // Source: https://minecraft.gamepedia.com/Bed#Sleeping
{
@@ -146,7 +146,7 @@ bool cBlockBedHandler::OnUse(
return false;
}
);
- a_WorldInterface.SetTimeOfDay(0);
+ a_WorldInterface.SetTimeOfDay(0_tick);
a_ChunkInterface.SetBlockMeta(a_BlockPos, Meta & 0x0b); // Clear the "occupied" bit of the bed's block
}
return true;
diff --git a/src/Blocks/BlockButton.h b/src/Blocks/BlockButton.h
index 985c1fff9..0c942cb49 100644
--- a/src/Blocks/BlockButton.h
+++ b/src/Blocks/BlockButton.h
@@ -193,7 +193,7 @@ private:
The given block type is checked when the task is executed to ensure the position still contains a button. */
static void QueueButtonRelease(cWorld & a_ButtonWorld, const Vector3i a_Position, const BLOCKTYPE a_BlockType)
{
- const auto TickDelay = (a_BlockType == E_BLOCK_STONE_BUTTON) ? 20 : 30;
+ const auto TickDelay = (a_BlockType == E_BLOCK_STONE_BUTTON) ? 20_tick : 30_tick;
a_ButtonWorld.ScheduleTask(
TickDelay,
[a_Position, a_BlockType](cWorld & a_World)
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index d9deedfc8..31f15a467 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -56,7 +56,7 @@ void cBlockPistonHandler::ExtendPiston(Vector3i a_BlockPos, cWorld & a_World)
// However, we don't confuse animation with the underlying state of the world, so emulate by delaying 1 tick
// (Probably why vanilla has so many dupe glitches with sand and pistons lolol)
- a_World.ScheduleTask(1, [a_BlockPos](cWorld & World)
+ a_World.ScheduleTask(1_tick, [a_BlockPos](cWorld & World)
{
BLOCKTYPE pistonBlock;
NIBBLETYPE pistonMeta;
@@ -108,7 +108,7 @@ void cBlockPistonHandler::RetractPiston(Vector3i a_BlockPos, cWorld & a_World)
a_World.BroadcastBlockAction(a_BlockPos, PistonRetractAction, pistonMeta, pistonBlock);
}
- a_World.ScheduleTask(1, [a_BlockPos](cWorld & World)
+ a_World.ScheduleTask(1_tick, [a_BlockPos](cWorld & World)
{
BLOCKTYPE pistonBlock;
NIBBLETYPE pistonMeta;
diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h
index 4ae3f33c9..b610bd9ac 100644
--- a/src/Blocks/WorldInterface.h
+++ b/src/Blocks/WorldInterface.h
@@ -21,8 +21,8 @@ class cWorldInterface
public:
virtual ~cWorldInterface() {}
- virtual int GetTimeOfDay(void) const = 0;
- virtual Int64 GetWorldAge(void) const = 0;
+ virtual cTickTime GetTimeOfDay(void) const = 0;
+ virtual cTickTimeLong GetWorldAge(void) const = 0;
virtual eDimension GetDimension(void) const = 0;
@@ -70,7 +70,7 @@ public:
If any chunk in the box is missing, ignores the entities in that chunk silently. */
virtual bool ForEachEntityInBox(const cBoundingBox & a_Box, cEntityCallback a_Callback) = 0;
- virtual void SetTimeOfDay(int a_TimeOfDay) = 0;
+ virtual void SetTimeOfDay(cTickTime a_TimeOfDay) = 0;
/** Returns true if it is raining or storming at the specified location. This takes into account biomes. */
virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) = 0;