Skip to content

Commit

Permalink
v2.1.5 - Add potted saplings, a Traverse Items item group, and fixed …
Browse files Browse the repository at this point in the history
…the Fir Sapling texture
  • Loading branch information
Prospector committed Dec 26, 2019
1 parent ab21aa0 commit 10af811
Show file tree
Hide file tree
Showing 22 changed files with 289 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx1G

mod_version=2.1.4
mod_version=2.1.5
maven_group=com.terraformersmc
archive_name=traverse

Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/terraformersmc/traverse/Traverse.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import com.terraformersmc.traverse.generation.TraverseGeneration;
import com.terraformersmc.traverse.surfacebuilder.TraverseSurfaceBuilders;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class Traverse implements ModInitializer {

Expand All @@ -26,6 +31,12 @@ public static void register() {
TraverseFeatures.register();
TraverseBiomes.register();
TraverseGeneration.register();

FabricItemGroupBuilder.create(new Identifier(MOD_ID, "items")).icon(() -> TraverseBlocks.FIR_SAPLING.asItem().getStackForRender()).appendItems(stacks -> Registry.ITEM.forEach(item -> {
if (Registry.ITEM.getId(item).getNamespace().equals(MOD_ID)) {
item.appendStacks(item.getGroup(), (DefaultedList<ItemStack>) stacks);
}
})).build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public class TraverseBlocks {
public static final Block FIR_WALL_SIGN = add("fir_wall_sign", new TerraformWallSignBlock(FIR_SIGN_TEXTURE, FabricBlockSettings.copy(Blocks.OAK_WALL_SIGN).build()));
public static final Item FIR_SIGN_ITEM = add("fir_sign", new SignItem(new Item.Settings().maxCount(16).group(ItemGroup.DECORATIONS), FIR_SIGN, FIR_WALL_SIGN));

public static final Block POTTED_RED_AUTUMNAL_SAPLING = add("potted_red_autumnal_sapling", new FlowerPotBlock(RED_AUTUMNAL_SAPLING, FabricBlockSettings.copy(Blocks.POTTED_OAK_SAPLING).build()));
public static final Block POTTED_BROWN_AUTUMNAL_SAPLING = add("potted_brown_autumnal_sapling", new FlowerPotBlock(BROWN_AUTUMNAL_SAPLING, FabricBlockSettings.copy(Blocks.POTTED_OAK_SAPLING).build()));
public static final Block POTTED_ORANGE_AUTUMNAL_SAPLING = add("potted_orange_autumnal_sapling", new FlowerPotBlock(ORANGE_AUTUMNAL_SAPLING, FabricBlockSettings.copy(Blocks.POTTED_OAK_SAPLING).build()));
public static final Block POTTED_YELLOW_AUTUMNAL_SAPLING = add("potted_yellow_autumnal_sapling", new FlowerPotBlock(YELLOW_AUTUMNAL_SAPLING, FabricBlockSettings.copy(Blocks.POTTED_OAK_SAPLING).build()));
public static final Block POTTED_FIR_SAPLING = add("potted_fir_sapling", new FlowerPotBlock(FIR_SAPLING, FabricBlockSettings.copy(Blocks.POTTED_OAK_SAPLING).build()));

private static <B extends Block> B add(String name, B block, ItemGroup tab) {
return add(name, block, new BlockItem(block, new Item.Settings().group(tab)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ public void onInitializeClient() {
registerTextures();
}

public static void registerEntityRenderers() {
private static void registerEntityRenderers() {
EntityRendererRegistry.INSTANCE.register(TraverseEntities.FIR_BOAT, (dispatcher, context) -> new BoatEntityRenderer(dispatcher));
}

public static void registerRenderLayers() {
private static void registerRenderLayers() {
RenderLayer cutout = RenderLayer.getCutout();
BlockRenderLayerMap.INSTANCE.putBlocks(cutout, TraverseBlocks.FIR_SAPLING, TraverseBlocks.FIR_DOOR, TraverseBlocks.FIR_TRAPDOOR);
BlockRenderLayerMap.INSTANCE.putBlocks(cutout, TraverseBlocks.POTTED_RED_AUTUMNAL_SAPLING, TraverseBlocks.POTTED_BROWN_AUTUMNAL_SAPLING, TraverseBlocks.POTTED_ORANGE_AUTUMNAL_SAPLING, TraverseBlocks.POTTED_YELLOW_AUTUMNAL_SAPLING, TraverseBlocks.POTTED_FIR_SAPLING);
}

public static void registerTextures() {
private static void registerTextures() {
Identifier texture = TraverseBlocks.FIR_SIGN.getTexture();
SpriteIdentifierRegistry.INSTANCE.addIdentifier(new SpriteIdentifier(TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, texture));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "traverse:block/potted_brown_autumnal_sapling" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "traverse:block/potted_fir_sapling" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "traverse:block/potted_orange_autumnal_sapling" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "traverse:block/potted_red_autumnal_sapling" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "traverse:block/potted_yellow_autumnal_sapling" }
}
}
11 changes: 11 additions & 0 deletions src/main/resources/assets/traverse/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"itemGroup.traverse.items": "Traverse Items",

"biome.traverse.arid_highlands": "Arid Highlands",
"biome.traverse.autumnal_wooded_hills": "Autumnal Wooded Hills",
"biome.traverse.autumnal_woods": "Autumnal Woods",
Expand All @@ -19,20 +21,29 @@
"biome.traverse.wooded_island": "Wooded Island",
"biome.traverse.wooded_plateau": "Wooded Plateau",
"biome.traverse.woodlands": "Woodlands",

"block.traverse.red_autumnal_leaves": "Red Autumnal Leaves",
"block.traverse.brown_autumnal_leaves": "Brown Autumnal Leaves",
"block.traverse.orange_autumnal_leaves": "Orange Autumnal Leaves",
"block.traverse.yellow_autumnal_leaves": "Yellow Autumnal Leaves",

"block.traverse.red_autumnal_sapling": "Red Autumnal Sapling",
"block.traverse.brown_autumnal_sapling": "Brown Autumnal Sapling",
"block.traverse.orange_autumnal_sapling": "Orange Autumnal Sapling",
"block.traverse.yellow_autumnal_sapling": "Yellow Autumnal Sapling",

"block.traverse.potted_red_autumnal_sapling": "Potted Red Autumnal Sapling",
"block.traverse.potted_brown_autumnal_sapling": "Potted Brown Autumnal Sapling",
"block.traverse.potted_orange_autumnal_sapling": "Potted Orange Autumnal Sapling",
"block.traverse.potted_yellow_autumnal_sapling": "Potted Yellow Autumnal Sapling",

"block.traverse.fir_log": "Fir Log",
"block.traverse.stripped_fir_log": "Stripped Fir Log",
"block.traverse.stripped_fir_wood": "Stripped Fir Wood",
"block.traverse.fir_wood": "Fir Wood",
"block.traverse.fir_leaves": "Fir Leaves",
"block.traverse.fir_sapling": "Fir Sapling",
"block.traverse.potted_fir_sapling": "Potted Fir Sapling",
"block.traverse.fir_planks": "Fir Planks",
"block.traverse.fir_stairs": "Fir Stairs",
"block.traverse.fir_slab": "Fir Slab",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/flower_pot_cross",
"textures": {
"plant": "traverse:block/brown_autumnal_sapling"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/flower_pot_cross",
"textures": {
"plant": "traverse:block/fir_sapling"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/flower_pot_cross",
"textures": {
"plant": "traverse:block/orange_autumnal_sapling"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/flower_pot_cross",
"textures": {
"plant": "traverse:block/red_autumnal_sapling"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/flower_pot_cross",
"textures": {
"plant": "traverse:block/yellow_autumnal_sapling"
}
}
Binary file modified src/main/resources/assets/traverse/textures/block/fir_sapling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/main/resources/data/minecraft/tags/blocks/flower_pots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"values": [
"minecraft:flower_pot",
"minecraft:potted_poppy",
"minecraft:potted_blue_orchid",
"minecraft:potted_allium",
"minecraft:potted_azure_bluet",
"minecraft:potted_red_tulip",
"minecraft:potted_orange_tulip",
"minecraft:potted_white_tulip",
"minecraft:potted_pink_tulip",
"minecraft:potted_oxeye_daisy",
"minecraft:potted_dandelion",
"minecraft:potted_oak_sapling",
"minecraft:potted_spruce_sapling",
"minecraft:potted_birch_sapling",
"minecraft:potted_jungle_sapling",
"minecraft:potted_acacia_sapling",
"minecraft:potted_dark_oak_sapling",
"minecraft:potted_red_mushroom",
"minecraft:potted_brown_mushroom",
"minecraft:potted_dead_bush",
"minecraft:potted_fern",
"minecraft:potted_cactus",
"minecraft:potted_cornflower",
"minecraft:potted_lily_of_the_valley",
"minecraft:potted_wither_rose",
"minecraft:potted_bamboo",

"traverse:potted_red_autumnal_sapling",
"traverse:potted_brown_autumnal_sapling",
"traverse:potted_orange_autumnal_sapling",
"traverse:potted_yellow_autumnal_sapling",
"traverse:potted_fir_sapling"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "traverse:brown_autumnal_sapling"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "traverse:fir_sapling"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "traverse:brown_autumnal_sapling"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "traverse:red_autumnal_sapling"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:flower_pot"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "traverse:yellow_autumnal_sapling"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

0 comments on commit 10af811

Please sign in to comment.