Anvil and chain prototype
45
src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.AnvilBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndAnvilBlock extends AnvilBlock implements BlockPatterned {
|
||||
public EndAnvilBlock(MaterialColor color) {
|
||||
super(FabricBlockSettings.copyOf(Blocks.ANVIL).materialColor(color));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterns.createJson(data, blockId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterns.createJson(Patterns.BLOCK_ANVIL, blockId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterns.STATE_ANVIL;
|
||||
}
|
||||
}
|
55
src/main/java/ru/betterend/blocks/basis/EndChainBlock.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ChainBlock;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndChainBlock extends ChainBlock implements BlockPatterned, IRenderTypeable {
|
||||
public EndChainBlock(MaterialColor color) {
|
||||
super(FabricBlockSettings.copyOf(Blocks.CHAIN).materialColor(color));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterns.createJson(data, blockId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
if (block.contains("item")) {
|
||||
return Patterns.createJson(Patterns.ITEM_GENERATED, "item/" + blockId.getPath());
|
||||
}
|
||||
return Patterns.createJson(Patterns.BLOCK_CHAIN, blockId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterns.STATE_CHAIN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,10 @@ import net.minecraft.block.MaterialColor;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.tag.BlockTags;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.blocks.basis.EndAnvilBlock;
|
||||
import ru.betterend.blocks.basis.EndChainBlock;
|
||||
import ru.betterend.blocks.basis.EndDoorBlock;
|
||||
import ru.betterend.blocks.basis.EndMetalPaneBlock;
|
||||
import ru.betterend.blocks.basis.EndTrapdoorBlock;
|
||||
|
@ -22,6 +25,7 @@ import ru.betterend.recipe.builders.FurnaceRecipe;
|
|||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.util.TagHelper;
|
||||
|
||||
public class MetalMaterial {
|
||||
public final Block ore;
|
||||
|
@ -31,6 +35,8 @@ public class MetalMaterial {
|
|||
public final Block plate;
|
||||
public final Block door;
|
||||
public final Block trapdoor;
|
||||
public final Block anvil;
|
||||
public final Block chain;
|
||||
|
||||
public final Item ingot;
|
||||
public final Item shovel;
|
||||
|
@ -49,6 +55,8 @@ public class MetalMaterial {
|
|||
plate = EndBlocks.registerBlock(name + "_plate", new EndWoodenPlateBlock(block));
|
||||
door = EndBlocks.registerBlock(name + "_door", new EndDoorBlock(block));
|
||||
trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new EndTrapdoorBlock(block));
|
||||
anvil = EndBlocks.registerBlock(name + "_anvil", new EndAnvilBlock(color));
|
||||
chain = EndBlocks.registerBlock(name + "_chain", new EndChainBlock(color));
|
||||
|
||||
ingot = EndItems.registerItem(name + "_ingot");
|
||||
shovel = EndItems.registerTool(name + "_shovel", new EndShovelItem(material, 1.0F, -3.0F, EndItems.makeItemSettings()));
|
||||
|
@ -73,5 +81,7 @@ public class MetalMaterial {
|
|||
GridRecipe.make(name + "_hoe", hoe).setShape("##", " I", " I").addMaterial('#', ingot).addMaterial('I', Items.STICK).build();
|
||||
GridRecipe.make(name + "_pickaxe", pickaxe).setShape("###", " I ", " I ").addMaterial('#', ingot).addMaterial('I', Items.STICK).build();
|
||||
GridRecipe.make(name + "_sword", sword).setShape("#", "#", "I").addMaterial('#', ingot).addMaterial('I', Items.STICK).build();
|
||||
|
||||
TagHelper.addTag(BlockTags.ANVIL, anvil);
|
||||
}
|
||||
}
|
|
@ -39,6 +39,8 @@ public class Patterns {
|
|||
public final static Identifier STATE_BULB_LANTERN = BetterEnd.makeID("patterns/blockstate/bulb_lantern.json");
|
||||
public final static Identifier STATE_COMPOSTER = BetterEnd.makeID("patterns/blockstate/composter.json");
|
||||
public final static Identifier STATE_BARS = BetterEnd.makeID("patterns/blockstate/bars.json");
|
||||
public final static Identifier STATE_ANVIL = BetterEnd.makeID("patterns/blockstate/anvil.json");
|
||||
public final static Identifier STATE_CHAIN = BetterEnd.makeID("patterns/blockstate/chain.json");
|
||||
|
||||
//Models Block
|
||||
public final static Identifier BLOCK_EMPTY = BetterEnd.makeID("patterns/block/empty.json");
|
||||
|
@ -87,6 +89,8 @@ public class Patterns {
|
|||
public final static Identifier BLOCK_COLORED = BetterEnd.makeID("patterns/block/block_colored.json");
|
||||
public final static Identifier BLOCK_BARS_POST = BetterEnd.makeID("patterns/block/bars_post.json");
|
||||
public final static Identifier BLOCK_BARS_SIDE = BetterEnd.makeID("patterns/block/bars_side.json");
|
||||
public final static Identifier BLOCK_ANVIL = BetterEnd.makeID("patterns/block/anvil.json");
|
||||
public final static Identifier BLOCK_CHAIN = BetterEnd.makeID("patterns/block/chain.json");
|
||||
|
||||
//Models Item
|
||||
public final static Identifier ITEM_WALL = BetterEnd.makeID("patterns/item/pattern_wall.json");
|
||||
|
|
|
@ -192,6 +192,13 @@ public class CraftingRecipes {
|
|||
|
||||
GridRecipe.make("thallasium_chandelier", EndBlocks.THALLASIUM_CHANDELIER).setShape("I#I", " # ")
|
||||
.addMaterial('#', EndBlocks.THALLASIUM.ingot).addMaterial('I', EndItems.LUMECORN_ROD).build();
|
||||
|
||||
GridRecipe.make("ender_eye_amber", Items.ENDER_EYE)
|
||||
.setShape("SAS", "APA", "SAS")
|
||||
.addMaterial('S', EndItems.CRYSTAL_SHARDS)
|
||||
.addMaterial('A', EndItems.AMBER_GEM)
|
||||
.addMaterial('P', Items.ENDER_PEARL)
|
||||
.build();
|
||||
}
|
||||
|
||||
private static void registerLantern(String name, Block lantern, Block slab) {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_anvil",
|
||||
"textures": {
|
||||
"top": "betterend:block/%block%_top",
|
||||
"body": "betterend:block/%block%",
|
||||
"particle": "#body"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/chain",
|
||||
"textures": {
|
||||
"particle": "betterend:block/%block%",
|
||||
"all": "betterend:block/%block%"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east": {
|
||||
"model": "betterend:pattern/%block%",
|
||||
"y": 270
|
||||
},
|
||||
"facing=north": {
|
||||
"model": "betterend:pattern/%block%",
|
||||
"y": 180
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "betterend:pattern/%block%"
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "betterend:pattern/%block%",
|
||||
"y": 90
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x": {
|
||||
"model": "betterend:pattern/%block%",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y": {
|
||||
"model": "betterend:pattern/%block%"
|
||||
},
|
||||
"axis=z": {
|
||||
"model": "betterend:pattern/%block%",
|
||||
"x": 90
|
||||
}
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 380 B |
After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 557 B |
After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 396 B |