fix Counter

This commit is contained in:
CreepyCre 2021-02-14 13:25:06 +01:00
parent 693b9d59c1
commit ea945981de
2 changed files with 6 additions and 2 deletions

View file

@ -94,7 +94,7 @@ public class RiftConfigurationToolItem extends ModItem {
return TypedActionResult.success(false);
}
} else if (Counter.get(stack).count() != -1) {
// Counter.get(stack).set(-1); TODO
Counter.get(stack).set(-1);
sync(stack, player, hand);
EntityUtils.chat(player, Text.of("Counter has been reset."));
@ -116,7 +116,7 @@ public class RiftConfigurationToolItem extends ModItem {
@Override
public ItemStack getDefaultStack() {
ItemStack defaultStack = super.getDefaultStack();
// Counter.get(defaultStack).set(-1); TODO
Counter.get(defaultStack).set(-1);
return defaultStack;
}

View file

@ -22,6 +22,10 @@ public class Counter implements Component {
return this.counter;
}
public void set(int value) {
this.counter = value;
}
public static <T> Counter get(T provider) {
return DimensionalDoorsComponents.COUNTER_COMPONENT_KEY.get(provider);
}