forked from cafeberry/cafeberry
fix(TU20): Piston and StemTile fixes (#6)
- fixed "Two pistons stacked facing up and the top piston is powered with a repeater will cause the top piston to lock in place." - fixed "Fix for issue where destroying planted pumpkin and melon seeds drops an incorrect number of seeds." --------- Co-authored-by: pieeebot <10+pieeebot@noreply.neolegacy.dev> Reviewed-on: https://git.neolegacy.dev/pieeebot/mc_pieLCE/pulls/6 Co-authored-by: qloak <realminecart@gmail.com> Co-committed-by: qloak <realminecart@gmail.com>
This commit is contained in:
1 parent
b1189eb6c9
commit
b08d478d73
2 files changed
+13
-1
No files matched your search
@@ -218,10 +218,12 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
|
|||||||
if (extend && param1 == TRIGGER_CONTRACT)
|
if (extend && param1 == TRIGGER_CONTRACT)
|
||||||
{
|
{
|
||||||
level->setData(x, y, z, facing | EXTENDED_BIT, UPDATE_CLIENTS);
|
level->setData(x, y, z, facing | EXTENDED_BIT, UPDATE_CLIENTS);
|
||||||
|
ignoreUpdate(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (!extend && param1 == TRIGGER_EXTEND)
|
else if (!extend && param1 == TRIGGER_EXTEND)
|
||||||
{
|
{
|
||||||
|
ignoreUpdate(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,6 +249,7 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ignoreUpdate(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PIXEndNamedEvent();
|
PIXEndNamedEvent();
|
||||||
@@ -340,6 +343,12 @@ bool PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1,
|
|||||||
|
|
||||||
ignoreUpdate(false);
|
ignoreUpdate(false);
|
||||||
|
|
||||||
|
level->updateNeighborsAt(x, y, z, id);
|
||||||
|
int stepX = x + Facing::STEP_X[facing];
|
||||||
|
int stepY = y + Facing::STEP_Y[facing];
|
||||||
|
int stepZ = z + Facing::STEP_Z[facing];
|
||||||
|
level->updateNeighborsAt(stepX, stepY, stepZ, id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,10 @@ void StemTile::spawnResources(Level *level, int x, int y, int z, int data, float
|
|||||||
if (fruit == Tile::melon) seed = Item::seeds_melon;
|
if (fruit == Tile::melon) seed = Item::seeds_melon;
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(seed)));
|
if (level->random->nextInt(15) <= data)
|
||||||
|
{
|
||||||
|
popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(seed)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user