Closed lukeeexd closed 5 years ago
Well, your syntax is broken and I believe you're using StatSumMatchReader
wrong. First is a path (which is minecraft:mined
), second is one array of patterns to match.
Try it like this:
from mcstats import mcstats
mcstats.registry.append(
mcstats.MinecraftStat(
'break_glass',
{
'title': 'Glassbreaker',
'desc': 'Glass broken',
'unit': 'int',
},
mcstats.StatSumMatchReader(
['minecraft:mined'],
['minecraft:glass','minecraft:.*glass_pane','minecraft:.*stained_glass']),
))
It also appears that stained glass is missing from my "place glass" stat, eh?
from mcstats import mcstats mcstats.registry.append( mcstats.MinecraftStat( 'break_glass', { 'title': 'Glassbreaker', 'desc': 'Glass broken', 'unit': 'int', }, mcstats.StatSumMatchReader( ['minecraft:mined'], ['minecraft:glass','minecraft:.*glass_pane','minecraft:.*stained_glass']), ]) ))
Using that gives. And yes it is missing from place glass :P
File "update.py", line 17, in <module>
from mcstats.stats import *
File "/home/www/html/stats/mcstats/stats/break_glass.py", line 13
])
^
SyntaxError: invalid syntax
minecraft@TWS:~/scripts$
And sublime has these red https://i.imgur.com/sscXECM.png
Yeah that whole line needs to be gone. Updated my previous reply.
Yeah that whole line needs to be gone. Updated my previous reply.
Yeah that worked. How would I add stained glass to the place_glass stat?
Same way, add 'minecraft:.*stained_glass'
to the stat reader's second array.
Will open an issue and fix it soon.
Same way, add
'minecraft:.*stained_glass'
to the stat reader's second array. Will open an issue and fix it soon.
tyty
Trying to track all glass blocks and glass panes broken. Trying to use other stats as templates but just cant get it to work. Could you help?