Skip to content

Commit

Permalink
some registry/network leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightenom committed Feb 7, 2024
1 parent 38d103a commit 87a08fd
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/minecolonies/api/util/CraftingUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static void forEachCreativeTabItems(@NotNull final CreativeModeTab.ItemDi
final HolderLookup.RegistryLookup<CreativeModeTab> registry = displayParams.holders().lookup(Registries.CREATIVE_MODE_TAB).get();
final Map<CreativeModeTab, ResourceKey<CreativeModeTab>> tabKeys = registry.listElements()
.distinct() // some mods are dumb
.collect(Collectors.toMap(Holder::get, Holder.Reference::key));
.collect(Collectors.toMap(Holder::value, Holder.Reference::key));

for (final CreativeModeTab tab : CreativeModeTabs.allTabs())
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/minecolonies/api/util/SoundUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public static void playSuccessSound(@NotNull final Player player, @NotNull final
}
else
{
player.playNotifySound(SoundEvents.NOTE_BLOCK_BELL.get(), SoundSource.NEUTRAL, 1.0f, 1.0f);
player.playNotifySound(SoundEvents.NOTE_BLOCK_BELL.value(), SoundSource.NEUTRAL, 1.0f, 1.0f);
}
}

Expand All @@ -228,7 +228,7 @@ public static void playErrorSound(@NotNull final Player player, @NotNull final B
}
else
{
player.playNotifySound(SoundEvents.NOTE_BLOCK_DIDGERIDOO.get(), SoundSource.NEUTRAL, 1.0f, 0.3f);
player.playNotifySound(SoundEvents.NOTE_BLOCK_DIDGERIDOO.value(), SoundSource.NEUTRAL, 1.0f, 0.3f);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public PatternButton(int x, int y, int height, Holder<BannerPattern> pattern)
int tempIndex = 0;
for (final Holder<BannerPattern> pat : WindowBannerPicker.this.patterns)
{
if (pat.get().getHashname().equals(pattern.get().getHashname()))
if (pat.value().getHashname().equals(pattern.value().getHashname()))
{
this.index = tempIndex;
break;
Expand Down Expand Up @@ -521,7 +521,7 @@ public void render(final GuiGraphics stack, int p_render_1_, int p_render_2_, fl
}
catch (final Exception ex)
{
Log.getLogger().warn(pattern.get().getHashname());
Log.getLogger().warn(pattern.value().getHashname());
Log.getLogger().error(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void onCreate()
final Player player = Minecraft.getInstance().player;
final Component colonyName = Component.translatable(DEFAULT_COLONY_NAME, player.getName());

new VanillaParticleMessage(pos.getX(), pos.getY(), pos.getZ(), ParticleTypes.DRAGON_BREATH).onExecute(null, false);
new VanillaParticleMessage(pos.getX(), pos.getY(), pos.getZ(), ParticleTypes.DRAGON_BREATH).onExecute(null, player);
Minecraft.getInstance().level.playSound(Minecraft.getInstance().player, Minecraft.getInstance().player.blockPosition(),
SoundEvents.CAMPFIRE_CRACKLE, SoundSource.AMBIENT, 2.5f, 0.8f);
final boolean reactivate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void renderBlueprints(final WorldEventContext ctx)
{
shouldRenderBlueprints = !shouldRenderBlueprints;

ctx.clientPlayer.playNotifySound(SoundEvents.NOTE_BLOCK_PLING.get(), SoundSource.NEUTRAL, 1.0F, shouldRenderBlueprints ? 0.75F : 0.25F);
ctx.clientPlayer.playNotifySound(SoundEvents.NOTE_BLOCK_PLING.value(), SoundSource.NEUTRAL, 1.0F, shouldRenderBlueprints ? 0.75F : 0.25F);
}

if (!ctx.hasNearestColony())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private IState applyCure()


citizen.swing(InteractionHand.MAIN_HAND);
citizen.playSound(SoundEvents.NOTE_BLOCK_HARP.get(), (float) BASIC_VOLUME, (float) SoundUtils.getRandomPentatonic(citizen.getRandom()));
citizen.playSound(SoundEvents.NOTE_BLOCK_HARP.value(), (float) BASIC_VOLUME, (float) SoundUtils.getRandomPentatonic(citizen.getRandom()));
new CircleParticleEffectMessage(citizen.position().add(0, 2, 0), ParticleTypes.HAPPY_VILLAGER, waitingTicks)
.sendToTrackingEntity(citizen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public InteractionResult useOn(final UseOnContext useContext)
{
MessageUtils.format(TOOL_BEEHIVE_SCEPTER_REMOVE_HIVE).sendTo(useContext.getPlayer());
building.removeHive(pos);
SoundUtils.playSoundForPlayer((ServerPlayer) player, SoundEvents.NOTE_BLOCK_BELL.get(), (float) SoundUtils.VOLUME * 2, 0.5f);
SoundUtils.playSoundForPlayer((ServerPlayer) player, SoundEvents.NOTE_BLOCK_BELL.value(), (float) SoundUtils.VOLUME * 2, 0.5f);
new ColonyViewBuildingViewMessage(building).sendToPlayer((ServerPlayer) player);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void toBytes(final FriendlyByteBuf byteBuf)
}

@Override
protected void onExecute(final PlayPayloadContext ctxIn, final Player player)
public void onExecute(final PlayPayloadContext ctxIn, final Player player)
{
spawnParticles(type, player.level(), x, y, z);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public ItemStack getItemClient()
for (Pair<Holder<BannerPattern>, DyeColor> pair : list)
{
CompoundTag pairNBT = new CompoundTag();
pairNBT.putString(TAG_SINGLE_PATTERN, pair.getFirst().get().getHashname());
pairNBT.putString(TAG_SINGLE_PATTERN, pair.getFirst().value().getHashname());
pairNBT.putInt(TAG_PATTERN_COLOR, pair.getSecond().getId());
nbt.add(pairNBT);
}
Expand Down

0 comments on commit 87a08fd

Please # to comment.