Skip to content

Commit

Permalink
Content Registries: javadoc and small refactor (#3347)
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j authored Oct 1, 2023
1 parent 9650955 commit 285022b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ public non-sealed interface StaticPathNodeTypeProvider extends PathNodeTypeProvi
* <p>You can specify what to return if the block state is a direct target of an entity path,
* or a neighbor block of the entity path.
*
* <p>For example, for a cactus-like block you should use {@link PathNodeType#DAMAGE_CACTUS} if the block
* <p>For example, for a cactus-like block you should use {@link PathNodeType#DAMAGE_OTHER} if the block
* is a direct target in the entity path ({@code neighbor == false}) to specify that an entity should not pass
* through or above the block because it will cause damage, and you should use{@link PathNodeType#DANGER_CACTUS}
* through or above the block because it will cause damage, and you should use {@link PathNodeType#DANGER_OTHER}
* if the block is a neighbor block in the entity path ({@code neighbor == true}) to specify that the entity
* should not get close to the block because it is dangerous.
*
Expand All @@ -211,9 +211,9 @@ public non-sealed interface DynamicPathNodeTypeProvider extends PathNodeTypeProv
* <p>You can specify what to return if the block state is a direct target of an entity path,
* or a neighbor block of the entity path.
*
* <p>For example, for a cactus-like block you should specify {@link PathNodeType#DAMAGE_CACTUS} if the block
* <p>For example, for a cactus-like block you should specify {@link PathNodeType#DAMAGE_OTHER} if the block
* is a direct target ({@code neighbor == false}) to specify that an entity should not pass through or above
* the block because it will cause damage, and {@link PathNodeType#DANGER_CACTUS} if the cactus will be found
* the block because it will cause damage, and {@link PathNodeType#DANGER_OTHER} if the cactus will be found
* as a neighbor block in the entity path ({@code neighbor == true}) to specify that the entity should not get
* close to the block because is dangerous.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
/**
* Registries for modifying villager interactions that
* villagers have with the world.
* @see VillagerPlantableRegistry for registering plants that farmers can plant
*/
public final class VillagerInteractionRegistries {
private static final Logger LOGGER = LoggerFactory.getLogger(VillagerInteractionRegistries.class);
Expand All @@ -58,7 +57,7 @@ public static void registerCollectable(ItemConvertible item) {
}

/**
* Registers an item to be use in a composter by farmer villagers.
* Registers an item to be used in a composter by farmer villagers.
* @param item the item to register
*/
public static void registerCompostable(ItemConvertible item) {
Expand All @@ -73,7 +72,6 @@ public static void registerCompostable(ItemConvertible item) {
*/
public static void registerFood(ItemConvertible item, int foodValue) {
Objects.requireNonNull(item.asItem(), "Item cannot be null!");
Objects.requireNonNull(foodValue, "Food value cannot be null!");
Integer oldValue = getFoodRegistry().put(item.asItem(), foodValue);

if (oldValue != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Includes methods for registering in-game logics.
*/
package net.fabricmc.fabric.api.registry;
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class FlammableBlockRegistryImpl implements FlammableBlockRegistry {
private FlammableBlockRegistryImpl(Block key) {
this.key = key;

// Reset computed values after tags change since they depends on tags.
// Reset computed values after tags change since they depend on tags.
CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> {
computedEntries = null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void onInitialize() {
// - copper ore, iron ore, gold ore, and diamond ore can be waxed into their deepslate variants and scraped back again
// - aforementioned ores can be scraped from diamond -> gold -> iron -> copper
// - villagers can now collect, consume (at the same level of bread) and compost apples
// - villagers can now collect and plant oak saplings
// - villagers can now collect oak saplings
// - assign a loot table to the nitwit villager type
// - right-clicking a 'test_event' block will emit a 'test_event' game event, which will have a sculk sensor frequency of 2
// - instant health potions can be brewed from awkward potions with any item in the 'minecraft:small_flowers' tag
Expand Down

0 comments on commit 285022b

Please sign in to comment.