Skip to content

Commit

Permalink
Update mapped sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jun 15, 2024
1 parent 583274e commit 63dc52e
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private ConventionalBiomeTags() {
* side effects from {@link net.minecraft.tags.BiomeTags#IS_OVERWORLD}.
* <p></p>
* NOTE: If you do not add to the vanilla Overworld tag, be sure to add to
* {@link net.minecraft.tags.BiomeTags#STRONGHOLD_HAS_STRUCTURE} so
* {@link net.minecraft.tags.BiomeTags#HAS_STRONGHOLD} so
* some Strongholds do not go missing.)
*/
public static final TagKey<Biome> IS_OVERWORLD = register("is_overworld");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void generateTranslations(HolderLookup.Provider registryLookup, Translati
translationBuilder.add(SIMPLE_BLOCK, "Simple Block");
translationBuilder.add(ResourceLocation.fromNamespaceAndPath(MOD_ID, "identifier_test"), "Identifier Test");
translationBuilder.add(EntityType.ALLAY, "Allay");
translationBuilder.add(Attributes.GENERIC_ARMOR, "Generic Armor");
translationBuilder.add(Attributes.ARMOR, "Generic Armor");

try {
Optional<Path> path = dataOutput.getModContainer().findPath("assets/testmod/lang/en_us.base.json");
Expand Down Expand Up @@ -406,13 +406,13 @@ public void generate() {

private static class TestBarterLootTableProvider extends SimpleFabricLootTableProvider {
private TestBarterLootTableProvider(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registryLookup) {
super(output, registryLookup, LootContextParamSets.BARTER);
super(output, registryLookup, LootContextParamSets.PIGLIN_BARTER);
}

@Override
public void generate(BiConsumer<ResourceKey<LootTable>, LootTable.Builder> consumer) {
withConditions(consumer, ALWAYS_LOADED).accept(
BuiltInLootTables.PIGLIN_BARTERING_GAMEPLAY,
BuiltInLootTables.PIGLIN_BARTERING,
LootTable.lootTable().withPool(
LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)).add(LootItem.lootTableItem(SIMPLE_BLOCK))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private static ArmorMaterial createTestArmorMaterial() {
map.put(ArmorItem.Type.BODY, 3);
}),
0,
SoundEvents.ITEM_ARMOR_EQUIP_LEATHER,
SoundEvents.ARMOR_EQUIP_LEATHER,
() -> Ingredient.of(Items.LEATHER),
List.of(new ArmorMaterial.Layer(ResourceLocation.fromNamespaceAndPath("fabric-item-api-v1-testmod", "wood"))),
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void onInitialize() {
FuelRegistry.INSTANCE.add(WEIRD_PICK, 200);
FabricBrewingRecipeRegistryBuilder.BUILD.register(builder -> builder.addMix(Potions.WATER, WEIRD_PICK, Potions.AWKWARD));
EnchantmentEvents.ALLOW_ENCHANTING.register(((enchantment, target, enchantingContext) -> {
if (target.is(Items.DIAMOND_PICKAXE) && enchantment.is(Enchantments.SHARPNESS) && EnchantmentHelper.hasTag(target, EnchantmentTags.MINING_EXCLUSIVE_SET)) {
if (target.is(Items.DIAMOND_PICKAXE) && enchantment.is(Enchantments.SHARPNESS) && EnchantmentHelper.hasTag(target, EnchantmentTags.MINING_EXCLUSIVE)) {
return TriState.TRUE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class UpdatingItem extends Item {
public UpdatingItem(boolean allowUpdateAnimation) {
super(new Properties()
.component(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.builder()
.add(Attributes.GENERIC_ATTACK_DAMAGE, PLUS_FIVE, EquipmentSlotGroup.MAINHAND)
.add(Attributes.ATTACK_DAMAGE, PLUS_FIVE, EquipmentSlotGroup.MAINHAND)
.build()
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public final class BlockSetTypeBuilder {
private boolean buttonActivatedByArrows = true;
private BlockSetType.PressurePlateSensitivity pressurePlateActivationRule = BlockSetType.PressurePlateSensitivity.EVERYTHING;
private SoundType soundGroup = SoundType.WOOD;
private SoundEvent doorCloseSound = SoundEvents.BLOCK_WOODEN_DOOR_CLOSE;
private SoundEvent doorOpenSound = SoundEvents.BLOCK_WOODEN_DOOR_OPEN;
private SoundEvent trapdoorCloseSound = SoundEvents.BLOCK_WOODEN_TRAPDOOR_CLOSE;
private SoundEvent trapdoorOpenSound = SoundEvents.BLOCK_WOODEN_TRAPDOOR_OPEN;
private SoundEvent pressurePlateClickOffSound = SoundEvents.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF;
private SoundEvent pressurePlateClickOnSound = SoundEvents.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON;
private SoundEvent buttonClickOffSound = SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_OFF;
private SoundEvent buttonClickOnSound = SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON;
private SoundEvent doorCloseSound = SoundEvents.WOODEN_DOOR_CLOSE;
private SoundEvent doorOpenSound = SoundEvents.WOODEN_DOOR_OPEN;
private SoundEvent trapdoorCloseSound = SoundEvents.WOODEN_TRAPDOOR_CLOSE;
private SoundEvent trapdoorOpenSound = SoundEvents.WOODEN_TRAPDOOR_OPEN;
private SoundEvent pressurePlateClickOffSound = SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_OFF;
private SoundEvent pressurePlateClickOnSound = SoundEvents.WOODEN_PRESSURE_PLATE_CLICK_ON;
private SoundEvent buttonClickOffSound = SoundEvents.WOODEN_BUTTON_CLICK_OFF;
private SoundEvent buttonClickOnSound = SoundEvents.WOODEN_BUTTON_CLICK_ON;

/**
* Sets whether this block set type's door and trapdoor can be opened by hand.
Expand Down Expand Up @@ -107,7 +107,7 @@ public BlockSetTypeBuilder soundGroup(SoundType soundGroup) {
/**
* Sets this block set type's door close sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_DOOR_CLOSE}.
* <p>Defaults to {@link SoundEvents#WOODEN_DOOR_CLOSE}.
*
* @return this builder for chaining
*/
Expand All @@ -119,7 +119,7 @@ public BlockSetTypeBuilder doorCloseSound(SoundEvent doorCloseSound) {
/**
* Sets this block set type's door open sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_DOOR_OPEN}.
* <p>Defaults to {@link SoundEvents#WOODEN_DOOR_OPEN}.
*
* @return this builder for chaining
*/
Expand All @@ -131,7 +131,7 @@ public BlockSetTypeBuilder doorOpenSound(SoundEvent doorOpenSound) {
/**
* Sets this block set type's trapdoor close sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_TRAPDOOR_CLOSE}.
* <p>Defaults to {@link SoundEvents#WOODEN_TRAPDOOR_CLOSE}.
*
* @return this builder for chaining
*/
Expand All @@ -143,7 +143,7 @@ public BlockSetTypeBuilder trapdoorCloseSound(SoundEvent trapdoorCloseSound) {
/**
* Sets this block set type's trapdoor open sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_TRAPDOOR_OPEN}.
* <p>Defaults to {@link SoundEvents#WOODEN_TRAPDOOR_OPEN}.
*
* @return this builder for chaining
*/
Expand All @@ -155,7 +155,7 @@ public BlockSetTypeBuilder trapdoorOpenSound(SoundEvent trapdoorOpenSound) {
/**
* Sets this block set type's pressure plate click off sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF}.
* <p>Defaults to {@link SoundEvents#WOODEN_PRESSURE_PLATE_CLICK_OFF}.
*
* @return this builder for chaining
*/
Expand All @@ -167,7 +167,7 @@ public BlockSetTypeBuilder pressurePlateClickOffSound(SoundEvent pressurePlateCl
/**
* Sets this block set type's pressure plate click on sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON}.
* <p>Defaults to {@link SoundEvents#WOODEN_PRESSURE_PLATE_CLICK_ON}.
*
* @return this builder for chaining
*/
Expand All @@ -179,7 +179,7 @@ public BlockSetTypeBuilder pressurePlateClickOnSound(SoundEvent pressurePlateCli
/**
* Sets this block set type's button click off sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_BUTTON_CLICK_OFF}.
* <p>Defaults to {@link SoundEvents#WOODEN_BUTTON_CLICK_OFF}.
*
* @return this builder for chaining
*/
Expand All @@ -191,7 +191,7 @@ public BlockSetTypeBuilder buttonClickOffSound(SoundEvent buttonClickOffSound) {
/**
* Sets this block set type's button click on sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_WOODEN_BUTTON_CLICK_ON}.
* <p>Defaults to {@link SoundEvents#WOODEN_BUTTON_CLICK_ON}.
*
* @return this builder for chaining
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
public final class WoodTypeBuilder {
private SoundType soundGroup = SoundType.WOOD;
private SoundType hangingSignSoundGroup = SoundType.HANGING_SIGN;
private SoundEvent fenceGateCloseSound = SoundEvents.BLOCK_FENCE_GATE_CLOSE;
private SoundEvent fenceGateOpenSound = SoundEvents.BLOCK_FENCE_GATE_OPEN;
private SoundEvent fenceGateCloseSound = SoundEvents.FENCE_GATE_CLOSE;
private SoundEvent fenceGateOpenSound = SoundEvents.FENCE_GATE_OPEN;

/**
* Sets this wood type's sound group.
Expand Down Expand Up @@ -66,7 +66,7 @@ public WoodTypeBuilder hangingSignSoundGroup(SoundType hangingSignSoundGroup) {
/**
* Sets this wood type's fence gate close sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_FENCE_GATE_CLOSE}.
* <p>Defaults to {@link SoundEvents#FENCE_GATE_CLOSE}.
*
* @return this builder for chaining
*/
Expand All @@ -78,7 +78,7 @@ public WoodTypeBuilder fenceGateCloseSound(SoundEvent fenceGateCloseSound) {
/**
* Sets this wood type's fence gate open sound.
*
* <p>Defaults to {@link SoundEvents#BLOCK_FENCE_GATE_OPEN}.
* <p>Defaults to {@link SoundEvents#FENCE_GATE_OPEN}.
*
* @return this builder for chaining
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void buildMobEntityType() {

private static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes()
.add(Attributes.GENERIC_MAX_HEALTH, 10.0)
.add(Attributes.GENERIC_MOVEMENT_SPEED, 0.25);
.add(Attributes.MAX_HEALTH, 10.0)
.add(Attributes.MOVEMENT_SPEED, 0.25);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected float getExplosionResistance() {

@Override
public Optional<SoundEvent> getPickupSound() {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL);
return Optional.of(SoundEvents.BUCKET_FILL);
}

public static class Flowing extends CustomFluid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected float getExplosionResistance() {

@Override
public Optional<SoundEvent> getPickupSound() {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL);
return Optional.of(SoundEvents.BUCKET_FILL);
}

public static class Flowing extends NoOverlayFluid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected float getExplosionResistance() {

@Override
public Optional<SoundEvent> getPickupSound() {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL);
return Optional.of(SoundEvents.BUCKET_FILL);
}

public static class Flowing extends OverlayFluid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected float getExplosionResistance() {

@Override
public Optional<SoundEvent> getPickupSound() {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL);
return Optional.of(SoundEvents.BUCKET_FILL);
}

public static class Flowing extends UnregisteredFluid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static ArmorMaterial createTestArmorMaterial() {
map.put(ArmorItem.Type.BODY, 3);
}),
0,
SoundEvents.ITEM_ARMOR_EQUIP_LEATHER,
SoundEvents.ARMOR_EQUIP_LEATHER,
() -> Ingredient.of(Items.LEATHER),
List.of(new ArmorMaterial.Layer(ResourceLocation.fromNamespaceAndPath("fabric-rendering-v1-testmod", "test_material"))),
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SoundButton extends AbstractButton {

@Override
public void onPress() {
final SoundEvent event = BuiltInRegistries.SOUND_EVENT.getRandom(RANDOM).map(Holder::value).orElse(SoundEvents.ENTITY_GENERIC_EXPLODE.value());
final SoundEvent event = BuiltInRegistries.SOUND_EVENT.getRandom(RANDOM).map(Holder::value).orElse(SoundEvents.GENERIC_EXPLODE.value());
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(event, 1.0F, 1.0F));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ private static boolean moveWithSound(Storage<FluidVariant> from, Storage<FluidVa
// Temporary workaround to use the correct sound for water bottles.
// TODO: Look into providing a proper item-aware fluid sound API.
if (resource.isOf(Fluids.WATER)) {
if (fill && handItem == Items.GLASS_BOTTLE) sound = SoundEvents.ITEM_BOTTLE_FILL;
if (!fill && handItem == Items.POTION) sound = SoundEvents.ITEM_BOTTLE_EMPTY;
if (fill && handItem == Items.GLASS_BOTTLE) sound = SoundEvents.BOTTLE_FILL;
if (!fill && handItem == Items.POTION) sound = SoundEvents.BOTTLE_EMPTY;
}

player.level().playSound(player, player.getX(), player.getEyeY(), player.getZ(), sound, SoundSource.PLAYERS, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ public static Component getName(FluidVariant variant) {
public static SoundEvent getFillSound(FluidVariant variant) {
return getHandlerOrDefault(variant.getFluid()).getFillSound(variant)
.or(() -> variant.getFluid().getPickupSound())
.orElse(SoundEvents.ITEM_BUCKET_FILL);
.orElse(SoundEvents.BUCKET_FILL);
}

/**
* Return the sound corresponding to a container of this fluid variant being emptied if available,
* or the default (water) emptying sound otherwise.
*/
public static SoundEvent getEmptySound(FluidVariant variant) {
return getHandlerOrDefault(variant.getFluid()).getEmptySound(variant).orElse(SoundEvents.ITEM_BUCKET_EMPTY);
return getHandlerOrDefault(variant.getFluid()).getEmptySound(variant).orElse(SoundEvents.BUCKET_EMPTY);
}

/**
Expand Down Expand Up @@ -172,7 +172,7 @@ public Component getName(FluidVariant fluidVariant) {

@Override
public Optional<SoundEvent> getEmptySound(FluidVariant variant) {
return Optional.of(SoundEvents.ITEM_BUCKET_EMPTY);
return Optional.of(SoundEvents.BUCKET_EMPTY);
}
});
register(Fluids.LAVA, new FluidVariantAttributeHandler() {
Expand All @@ -187,12 +187,12 @@ public Component getName(FluidVariant fluidVariant) {

@Override
public Optional<SoundEvent> getFillSound(FluidVariant variant) {
return Optional.of(SoundEvents.ITEM_BUCKET_FILL_LAVA);
return Optional.of(SoundEvents.BUCKET_FILL_LAVA);
}

@Override
public Optional<SoundEvent> getEmptySound(FluidVariant variant) {
return Optional.of(SoundEvents.ITEM_BUCKET_EMPTY_LAVA);
return Optional.of(SoundEvents.BUCKET_EMPTY_LAVA);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected void onFinalCommit() {
// Mimic ComposterBlock#emptyComposter logic.
location.setBlockState(location.getBlockState().setValue(ComposterBlock.LEVEL, 0));
// Play the sound
location.world.playSound(null, location.pos, SoundEvents.BLOCK_COMPOSTER_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
location.world.playSound(null, location.pos, SoundEvents.COMPOSTER_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F);
} else if (increaseProbability > 0) {
BlockState state = location.getBlockState();
// Always increment on first insert (like vanilla).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ static void beforeAll() {
public void testWater() {
FluidVariant water = FluidVariant.of(Fluids.WATER);

assertEquals(SoundEvents.ITEM_BUCKET_FILL, FluidVariantAttributes.getFillSound(water));
assertEquals(SoundEvents.ITEM_BUCKET_EMPTY, FluidVariantAttributes.getEmptySound(water));
assertEquals(SoundEvents.BUCKET_FILL, FluidVariantAttributes.getFillSound(water));
assertEquals(SoundEvents.BUCKET_EMPTY, FluidVariantAttributes.getEmptySound(water));
assertEquals(0, FluidVariantAttributes.getLuminance(water));
assertEquals(FluidConstants.WATER_TEMPERATURE, FluidVariantAttributes.getTemperature(water));
assertEquals(FluidConstants.WATER_VISCOSITY, FluidVariantAttributes.getViscosity(water, null));
Expand All @@ -51,8 +51,8 @@ public void testWater() {
public void testLava() {
FluidVariant lava = FluidVariant.of(Fluids.LAVA);

assertEquals(SoundEvents.ITEM_BUCKET_FILL_LAVA, FluidVariantAttributes.getFillSound(lava));
assertEquals(SoundEvents.ITEM_BUCKET_EMPTY_LAVA, FluidVariantAttributes.getEmptySound(lava));
assertEquals(SoundEvents.BUCKET_FILL_LAVA, FluidVariantAttributes.getFillSound(lava));
assertEquals(SoundEvents.BUCKET_EMPTY_LAVA, FluidVariantAttributes.getEmptySound(lava));
assertEquals(15, FluidVariantAttributes.getLuminance(lava));
assertEquals(FluidConstants.LAVA_TEMPERATURE, FluidVariantAttributes.getTemperature(lava));
assertEquals(FluidConstants.LAVA_VISCOSITY, FluidVariantAttributes.getViscosity(lava, null));
Expand Down

0 comments on commit 63dc52e

Please sign in to comment.