Add tags supports_beacon and supports_conduit and modify Beacon and Conduit to use these tags (#6266)
This commit is contained in:
parent
5d62261082
commit
d8d70e8b35
9 changed files with 59 additions and 2 deletions
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/tileentity/ConduitTileEntity.java
|
||||
+++ b/net/minecraft/tileentity/ConduitTileEntity.java
|
||||
@@ -131,7 +131,7 @@
|
||||
BlockPos blockpos1 = this.field_174879_c.func_177982_a(j1, k1, l1);
|
||||
BlockState blockstate = this.field_145850_b.func_180495_p(blockpos1);
|
||||
|
||||
- for(Block block : field_205042_e) {
|
||||
+ for(Block block : net.minecraftforge.common.Tags.Blocks.SUPPORTS_CONDUIT.func_199885_a()) {
|
||||
if (blockstate.func_177230_c() == block) {
|
||||
this.field_205046_i.add(blockpos1);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block",
|
||||
"minecraft:gold_block",
|
||||
"minecraft:diamond_block",
|
||||
"minecraft:iron_block"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:prismarine",
|
||||
"minecraft:prismarine_bricks",
|
||||
"minecraft:sea_lantern",
|
||||
"minecraft:dark_prismarine"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block",
|
||||
"minecraft:gold_block",
|
||||
"minecraft:diamond_block",
|
||||
"minecraft:iron_block"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:prismarine",
|
||||
"minecraft:prismarine_bricks",
|
||||
"minecraft:sea_lantern",
|
||||
"minecraft:dark_prismarine"
|
||||
]
|
||||
}
|
|
@ -112,6 +112,9 @@ public class Tags
|
|||
public static final Tag<Block> STORAGE_BLOCKS_QUARTZ = tag("storage_blocks/quartz");
|
||||
public static final Tag<Block> STORAGE_BLOCKS_REDSTONE = tag("storage_blocks/redstone");
|
||||
|
||||
public static final Tag<Block> SUPPORTS_BEACON = tag("supports_beacon");
|
||||
public static final Tag<Block> SUPPORTS_CONDUIT = tag("supports_conduit");
|
||||
|
||||
private static Tag<Block> tag(String name)
|
||||
{
|
||||
return new BlockTags.Wrapper(new ResourceLocation("forge", name));
|
||||
|
@ -266,6 +269,9 @@ public class Tags
|
|||
public static final Tag<Item> STORAGE_BLOCKS_REDSTONE = tag("storage_blocks/redstone");
|
||||
public static final Tag<Item> STRING = tag("string");
|
||||
|
||||
public static final Tag<Item> SUPPORTS_BEACON = tag("supports_beacon");
|
||||
public static final Tag<Item> SUPPORTS_CONDUIT = tag("supports_conduit");
|
||||
|
||||
private static Tag<Item> tag(String name)
|
||||
{
|
||||
return new ItemTags.Wrapper(new ResourceLocation("forge", name));
|
||||
|
|
|
@ -96,6 +96,8 @@ public class ForgeBlockTagsProvider extends BlockTagsProvider
|
|||
getBuilder(STORAGE_BLOCKS_LAPIS).add(Blocks.LAPIS_BLOCK);
|
||||
getBuilder(STORAGE_BLOCKS_QUARTZ).add(Blocks.QUARTZ_BLOCK);
|
||||
getBuilder(STORAGE_BLOCKS_REDSTONE).add(Blocks.REDSTONE_BLOCK);
|
||||
getBuilder(SUPPORTS_BEACON).add(Blocks.EMERALD_BLOCK, Blocks.GOLD_BLOCK, Blocks.DIAMOND_BLOCK, Blocks.IRON_BLOCK);
|
||||
getBuilder(SUPPORTS_CONDUIT).add(Blocks.PRISMARINE, Blocks.PRISMARINE_BRICKS, Blocks.SEA_LANTERN, Blocks.DARK_PRISMARINE);
|
||||
}
|
||||
|
||||
private void addColored(Consumer<Block> consumer, Tag<Block> group, String pattern)
|
||||
|
|
|
@ -141,6 +141,8 @@ public class ForgeItemTagsProvider extends ItemTagsProvider
|
|||
copy(Tags.Blocks.STORAGE_BLOCKS_QUARTZ, Tags.Items.STORAGE_BLOCKS_QUARTZ);
|
||||
copy(Tags.Blocks.STORAGE_BLOCKS_REDSTONE, Tags.Items.STORAGE_BLOCKS_REDSTONE);
|
||||
getBuilder(Tags.Items.STRING).add(Items.STRING);
|
||||
copy(Tags.Blocks.SUPPORTS_BEACON, Tags.Items.SUPPORTS_BEACON);
|
||||
copy(Tags.Blocks.SUPPORTS_CONDUIT, Tags.Items.SUPPORTS_CONDUIT);
|
||||
}
|
||||
|
||||
private void addColored(Consumer<Item> consumer, Tag<Item> group, String pattern)
|
||||
|
|
|
@ -82,6 +82,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -589,8 +590,7 @@ public interface IForgeBlock
|
|||
*/
|
||||
default boolean isBeaconBase(BlockState state, IWorldReader world, BlockPos pos, BlockPos beacon)
|
||||
{
|
||||
return this.getBlock() == Blocks.EMERALD_BLOCK || this.getBlock() == Blocks.GOLD_BLOCK ||
|
||||
this.getBlock() == Blocks.DIAMOND_BLOCK || this.getBlock() == Blocks.IRON_BLOCK;
|
||||
return Tags.Blocks.SUPPORTS_BEACON.contains(state.getBlock());
|
||||
}
|
||||
/**
|
||||
* Gathers how much experience this block drops when broken.
|
||||
|
|
Loading…
Reference in a new issue