Skip to content

Commit

Permalink
update for deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Sep 20, 2024
1 parent edf1a22 commit f3afc17
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onPlayerDrops(ZLivingDrops.Lowest event) {
.map(ItemEntity::getItem)
.filter(stack -> !stack.isEmpty())
.forEach(totem::addItem);
if (zeta.isModLoaded("curios"))
if (zeta().isModLoaded("curios"))
TotemOfHoldingCuriosCompat.saveCurios(player, totem);
if(!player.level().isClientSide)
player.level().addFreshEntity(totem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public static class Client extends HedgesModule {

@LoadEvent
public void blockColorProviders(ZAddBlockColorHandlers event) {
event.registerNamed(zeta, b -> new AlikeColorHandler((HedgeBlock) b, HedgeBlock::getLeaf), "hedge");
event.registerNamed(zeta(), b -> new AlikeColorHandler((HedgeBlock) b, HedgeBlock::getLeaf), "hedge");
}

@LoadEvent
public void itemColorProviders(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> new AlikeColorHandler(i, HedgeBlock::getLeaf), "hedge");
event.registerNamed(zeta(), i -> new AlikeColorHandler(i, HedgeBlock::getLeaf), "hedge");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public static class Client extends LeafCarpetModule {

@LoadEvent
public void blockColorHandlers(ZAddBlockColorHandlers event) {
event.registerNamed(zeta,b -> new AlikeColorHandler((LeafCarpetBlock) b, LeafCarpetBlock::getBaseState), "leaf_carpet");
event.registerNamed(zeta(), b -> new AlikeColorHandler((LeafCarpetBlock) b, LeafCarpetBlock::getBaseState), "leaf_carpet");
}

@LoadEvent
public void itemColorHandlers(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> new AlikeColorHandler(i, LeafCarpetBlock::getBaseState), "leaf_carpet");
event.registerNamed(zeta(), i -> new AlikeColorHandler(i, LeafCarpetBlock::getBaseState), "leaf_carpet");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final void register(ZRegister event) {
@PlayEvent
public void onRightClick(ZRightClickBlock event) {
ItemStack stack = event.getItemStack();
if(zeta.itemExtensions.get(stack).canShearZeta(stack)) {
if(zeta().itemExtensions.get(stack).canShearZeta(stack)) {
BlockPos pos = event.getPos();
Level world = event.getLevel();
BlockState state = world.getBlockState(pos);
Expand Down Expand Up @@ -88,12 +88,12 @@ public static class Client extends ShearVinesModule {

@LoadEvent
public void blockColors(ZAddBlockColorHandlers event) {
event.registerNamed(zeta, b -> LIKE_VINE, "vine");
event.registerNamed(zeta(), b -> LIKE_VINE, "vine");
}

@LoadEvent
public void itemColors(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> LIKE_VINE, "vine");
event.registerNamed(zeta(), i -> LIKE_VINE, "vine");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public final void register(ZRegister event) {

@LoadEvent
public final void configChanged(ZConfigChanged event) {
zeta.nameChanger.changeBlock(Blocks.BOOKSHELF, "block.quark.oak_bookshelf", changeNames && enabled);
zeta().nameChanger.changeBlock(Blocks.BOOKSHELF, "block.quark.oak_bookshelf", changeNames && enabled);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void loadComplete(ZLoadComplete e) {
@LoadEvent
public final void configChanged(ZConfigChanged event) {
moduleEnabled = this.enabled;
zeta.nameChanger.changeBlock(Blocks.LADDER, "block.quark.oak_ladder", changeNames && enabled);
zeta().nameChanger.changeBlock(Blocks.LADDER, "block.quark.oak_ladder", changeNames && enabled);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public boolean namesMatch(ItemStack stack, String search) {

ResourceLocation itemName = BuiltInRegistries.ITEM.getKey(item);
@Nullable
String modDisplayName = zeta.getModDisplayName(itemName.getNamespace());
String modDisplayName = zeta().getModDisplayName(itemName.getNamespace());

if(modDisplayName != null && matcher.test(modDisplayName.toLowerCase(Locale.ROOT), search))
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void hudPre(ZRenderGuiOverlay.ArmorLevel.Pre event) {
Player player = mc.player;
ItemStack itemstack = player.getItemBySlot(EquipmentSlot.CHEST);

if(zeta.itemExtensions.get(itemstack).canElytraFlyZeta(itemstack, player)) {
if(zeta().itemExtensions.get(itemstack).canElytraFlyZeta(itemstack, player)) {
int armor = player.getArmorValue();
shift = (armor >= 20 ? 0 : 9);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void onSleepCheck(ZSleepingLocationCheck event) {

BlockPos below = pos.below();
BlockState belowState = world.getBlockState(below);
int light = zeta.blockExtensions.get(belowState).getLightEmissionZeta(belowState, world, below);
int light = zeta().blockExtensions.get(belowState).getLightEmissionZeta(belowState, world, below);
if(light > 2)
event.setResult(ZResult.ALLOW);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public void onUseRocket(ZRightClickItem event) {
Player player = event.getEntity();
ItemStack chest = player.getItemBySlot(EquipmentSlot.CHEST);

boolean curiosCheck = zeta.isModLoaded("curios") && BetterElytraRocketCuriosCompat.hasCuriosElytra(player);
boolean curiosCheck = zeta().isModLoaded("curios") && BetterElytraRocketCuriosCompat.hasCuriosElytra(player);

if (!player.isFallFlying() && (zeta.itemExtensions.get(chest).canElytraFlyZeta(chest, player) || curiosCheck)) {
if (!player.isFallFlying() && (zeta().itemExtensions.get(chest).canElytraFlyZeta(chest, player) || curiosCheck)) {
Level world = player.level();
ItemStack itemstack = event.getItemStack();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ public static class Client extends NewStoneTypesModule {

@LoadEvent
public void blockColorProviders(ZAddBlockColorHandlers event) {
event.registerNamed(zeta, block -> MyaliteColorHandler.INSTANCE, "myalite");
event.registerNamed(zeta(), block -> MyaliteColorHandler.INSTANCE, "myalite");
}

@LoadEvent
public void itemColorProviders(ZAddItemColorHandlers event) {
event.registerNamed(zeta, item -> MyaliteColorHandler.INSTANCE, "myalite");
event.registerNamed(zeta(), item -> MyaliteColorHandler.INSTANCE, "myalite");
}

private static class MyaliteColorHandler implements BlockColor, ItemColor {
Expand Down

0 comments on commit f3afc17

Please sign in to comment.