Skip to content

Commit

Permalink
Fix particletypes for 1.13.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro authored and Pokechu22 committed Nov 12, 2020
1 parent 6823acd commit 0302707
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion burger/toppings/particletypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class ParticleTypesTopping(Topping):
def act(aggregate, classloader, verbose=False):
particletypes = []
cf = classloader[aggregate["classes"]["particletypes"]]
ops = tuple(cf.methods.find_one(name = '<clinit>').code.disassemble())
# Method is either <clinit> or a void with no parameters, check both
# until we find one that loads constants
for meth in cf.methods.find(args = '', returns = 'V'):
ops = tuple(meth.code.disassemble())
if(next(x for x in ops if 'ldc' in x.name), False):
break
for idx, op in enumerate(ops):
if 'ldc' in op.name:
str_val = op.operands[0].string.value
Expand Down

0 comments on commit 0302707

Please sign in to comment.