Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2afb62d6c8
2 changed files with 21 additions and 6 deletions
|
@ -1,6 +1,9 @@
|
|||
package ru.betterend.registry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.fabricmc.fabric.impl.tool.attribute.ToolManagerImpl;
|
||||
import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocksToolHandler;
|
||||
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor;
|
||||
|
@ -30,8 +33,6 @@ import ru.betterend.blocks.basis.EndTerrainBlock;
|
|||
import ru.betterend.blocks.basis.PedestalBlock;
|
||||
import ru.betterend.item.tool.EndHammerItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EndTags {
|
||||
// Table with common (c) tags:
|
||||
// https://fabricmc.net/wiki/tutorial:tags
|
||||
|
@ -43,6 +44,12 @@ public class EndTags {
|
|||
public static final Tag.Named<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
|
||||
public static final Tag.Named<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
|
||||
public static final Tag.Named<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
|
||||
|
||||
private static void allowCompost(float chance, Item item){
|
||||
if (item!=null && item != Items.AIR) {
|
||||
ComposterBlockAccessor.callAdd(chance, item);
|
||||
}
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
TagAPI.addEndGround(EndBlocks.THALLASIUM.ore);
|
||||
|
@ -52,6 +59,7 @@ public class EndTags {
|
|||
EndBlocks.getModBlocks().forEach(block -> {
|
||||
Properties properties = ((AbstractBlockAccessor) block).getSettings();
|
||||
Material material = ((AbstractBlockSettingsAccessor) properties).getMaterial();
|
||||
final Item item = block.asItem();
|
||||
|
||||
if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) {
|
||||
TagAPI.addTag(TagAPI.MINEABLE_PICKAXE, block);
|
||||
|
@ -73,7 +81,10 @@ public class EndTags {
|
|||
}
|
||||
else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) {
|
||||
TagAPI.addTag(BlockTags.LEAVES, block);
|
||||
ComposterBlockAccessor.callAdd(0.3F, block);
|
||||
|
||||
//TODO: for BCLib 0.5.3
|
||||
//ComposterAPI.allowCompost(0.3f, item);
|
||||
allowCompost(0.3F, item);
|
||||
}
|
||||
else if (block instanceof BaseVineBlock) {
|
||||
TagAPI.addTag(BlockTags.CLIMBABLE, block);
|
||||
|
@ -84,7 +95,9 @@ public class EndTags {
|
|||
|
||||
Material mat = block.defaultBlockState().getMaterial();
|
||||
if (mat.equals(Material.PLANT) || mat.equals(Material.REPLACEABLE_PLANT)) {
|
||||
ComposterBlockAccessor.callAdd(0.1F, block);
|
||||
//TODO: for BCLib 0.5.3
|
||||
//ComposterAPI.allowCompost(0.3f, item);
|
||||
allowCompost(0.1F, item);
|
||||
}
|
||||
});
|
||||
TagAPI.addEndGround(EndBlocks.CAVE_MOSS);
|
||||
|
@ -99,7 +112,9 @@ public class EndTags {
|
|||
FoodProperties food = item.getFoodProperties();
|
||||
if (food != null) {
|
||||
float compost = food.getNutrition() * food.getSaturationModifier() * 0.18F;
|
||||
ComposterBlockAccessor.callAdd(compost, item);
|
||||
//TODO: for BCLib 0.5.3
|
||||
//ComposterAPI.allowCompost(0.3f, item);
|
||||
allowCompost(compost, item);
|
||||
}
|
||||
}
|
||||
if (item instanceof EndHammerItem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue