Commit b3431406 authored by Tommy Ang's avatar Tommy Ang 🤣

Fix vehicle not working with non player entities

parent b0156982
......@@ -319,8 +319,8 @@ command /potatotown <text="help"> [<text>]:
set {_number3} to size of {_ptown.online::*}
set {_number3} to ({_numberlist} - {_number3} - 1)
set {_townsize} to size of {ptown.%{_ptownmember::%{_number3}%}%.playerlist::*}
if {ptown.%{_ptownori::%{_sortptownonline::%{_number3}%}%}%.owner} is set:
set {_player} to {ptown.%{_ptownori::%{_sortptownonline::%{_number3}%}%}%.owner} parsed as player
if {ptown.%{_ptownori::%{_ptownmember::%{_number3}%}%}%.owner} is set:
set {_player} to {ptown.%{_ptownori::%{_ptownmember::%{_number3}%}%}%.owner} parsed as player
if {_player} is online:
set {_online} to "&a**%{ptown.%{_ptownori::%{_ptownmember::%{_number3}%}%}%.owner}%&f"
else:
......@@ -1532,6 +1532,7 @@ on rightclick holding LINGERING POTION or SPLASH POTION:
# Boat, Minecart
on vehicle destroy:
entity is a player
set {_chunk} to chunk at event-location
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "build")
......@@ -1539,6 +1540,7 @@ on vehicle destroy:
cancel event
on vehicle enter:
entity is a player
set {_chunk} to chunk at event-location
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "build")
......@@ -1611,20 +1613,20 @@ on damage:
# cancel event
on ignite:
# Protection from lightning based on Fire flag
if "%event.getCause()%" is "LIGHTNING":
# Protection based on Fire flag
#if "%event.getCause()%" is "LIGHTNING":
# This for when we want to expand to specific trident lightning
# if event.getIgnitingEntity() has metadata "cause":
# broadcast "%metadata value ""cause"" of event.getIgnitingEntity()%"
set {_chunk} to chunk at event-location
if {ptownlist.chunk::%{_chunk}%} is "Safezone":
set {_chunk} to chunk at event-location
if {ptownlist.chunk::%{_chunk}%} is "Safezone":
cancel event
else if {ptownlist.chunk::%{_chunk}%} is set:
set {_town} to {ptownlist.chunk::%{_chunk}%}
if {ptown.%{_town}%.flag::fire} is not set:
cancel event
else if {ptown.%{_town}%.flag::fire} is "true":
cancel event
else if {ptownlist.chunk::%{_chunk}%} is set:
set {_town} to {ptownlist.chunk::%{_chunk}%}
if {ptown.%{_town}%.flag::fire} is not set:
cancel event
else if {ptown.%{_town}%.flag::fire} is "true":
cancel event
# This for when we want to expand to specific trident lightning
# on LightningStrikeEvent:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment