Skip to content

Commit

Permalink
Merge branch '1.14.4' of https://github.com/TerraformersMC/Terrestria
Browse files Browse the repository at this point in the history
…into 1.14.4
  • Loading branch information
coderbot16 committed Aug 31, 2019
2 parents b9077d5 + cd10b7e commit 04694ee
Show file tree
Hide file tree
Showing 41 changed files with 610 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ minecraft_version=1.14.4
yarn_mappings=1.14.4+build.9
loader_version=0.4.8+build.159
fabric_version=0.3.0+build.208
terraform_version=1.1.7+build.13
terraform_version=1.1.8+build.15
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void onInitialize() {

TerrestriaBlocks.init();
TerrestriaItems.init();
TerrestriaEntities.init();
TerrestriaFeatures.init();
TerrestriaSurfaces.init();
TerrestriaBiomes.init();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.terraformersmc.terrestria.init;

import com.terraformersmc.terraform.entity.TerraformBoat;
import com.terraformersmc.terraform.entity.TerraformBoatEntity;
import com.terraformersmc.terrestria.Terrestria;
import com.terraformersmc.terrestria.init.helpers.WoodItems;
import net.fabricmc.fabric.api.entity.FabricEntityTypeBuilder;
import net.minecraft.entity.EntityCategory;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.vehicle.BoatEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class TerrestriaEntities {
public static EntityType<TerraformBoatEntity> REDWOOD_BOAT;
public static EntityType<TerraformBoatEntity> HEMLOCK_BOAT;
public static EntityType<TerraformBoatEntity> RUBBER_BOAT;
public static EntityType<TerraformBoatEntity> CYPRESS_BOAT;
public static EntityType<TerraformBoatEntity> WILLOW_BOAT;
public static EntityType<TerraformBoatEntity> JAPANESE_MAPLE_BOAT;
public static EntityType<TerraformBoatEntity> RAINBOW_EUCALYPTUS_BOAT;
public static EntityType<TerraformBoatEntity> SAKURA_BOAT;

public static void init() {
REDWOOD_BOAT = registerBoat("redwood", TerrestriaItems.REDWOOD, BoatEntity.Type.DARK_OAK);
HEMLOCK_BOAT = registerBoat("hemlock", TerrestriaItems.HEMLOCK, BoatEntity.Type.OAK);
RUBBER_BOAT = registerBoat("rubber", TerrestriaItems.RUBBER, BoatEntity.Type.BIRCH);
CYPRESS_BOAT = registerBoat("cypress", TerrestriaItems.CYPRESS, BoatEntity.Type.BIRCH);
WILLOW_BOAT = registerBoat("willow", TerrestriaItems.WILLOW, BoatEntity.Type.SPRUCE);
JAPANESE_MAPLE_BOAT = registerBoat("japanese_maple", TerrestriaItems.JAPANESE_MAPLE, BoatEntity.Type.ACACIA);
RAINBOW_EUCALYPTUS_BOAT = registerBoat("rainbow_eucalyptus", TerrestriaItems.RAINBOW_EUCALYPTUS, BoatEntity.Type.JUNGLE);
SAKURA_BOAT = registerBoat("sakura", TerrestriaItems.SAKURA, BoatEntity.Type.DARK_OAK);
}

private static EntityType<TerraformBoatEntity> registerBoat(String name, WoodItems wood, BoatEntity.Type vanilla) {
Identifier skin = new Identifier(Terrestria.MOD_ID, "textures/entity/boat/" + name + ".png");
TerraformBoat boat = new TerraformBoat(wood.boat, wood.planks, skin, vanilla);

EntityType<TerraformBoatEntity> type = FabricEntityTypeBuilder.<TerraformBoatEntity>create(
EntityCategory.MISC, (entity, world) -> new TerraformBoatEntity(entity, world, boat))
.size(EntityDimensions.fixed(1.375F, 0.5625F))
.build();

return Registry.register(Registry.ENTITY_TYPE, new Identifier(Terrestria.MOD_ID, name + "_boat"), type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public class TerrestriaItems {
public static BlockItem MONSTERAS;

public static void init() {
REDWOOD = WoodItems.register("redwood", TerrestriaBlocks.REDWOOD);
HEMLOCK = WoodItems.register("hemlock", TerrestriaBlocks.HEMLOCK);
RUBBER = WoodItems.register("rubber", TerrestriaBlocks.RUBBER);
CYPRESS = WoodItems.register("cypress", TerrestriaBlocks.CYPRESS);
WILLOW = WoodItems.register("willow", TerrestriaBlocks.WILLOW);
JAPANESE_MAPLE = WoodItems.register("japanese_maple", TerrestriaBlocks.JAPANESE_MAPLE);
RAINBOW_EUCALYPTUS = WoodItems.register("rainbow_eucalyptus", TerrestriaBlocks.RAINBOW_EUCALYPTUS);
SAKURA = WoodItems.register("sakura", TerrestriaBlocks.SAKURA);
REDWOOD = WoodItems.register("redwood", TerrestriaBlocks.REDWOOD, () -> TerrestriaEntities.REDWOOD_BOAT);
HEMLOCK = WoodItems.register("hemlock", TerrestriaBlocks.HEMLOCK, () -> TerrestriaEntities.HEMLOCK_BOAT);
RUBBER = WoodItems.register("rubber", TerrestriaBlocks.RUBBER, () -> TerrestriaEntities.RUBBER_BOAT);
CYPRESS = WoodItems.register("cypress", TerrestriaBlocks.CYPRESS, () -> TerrestriaEntities.CYPRESS_BOAT);
WILLOW = WoodItems.register("willow", TerrestriaBlocks.WILLOW, () -> TerrestriaEntities.WILLOW_BOAT);
JAPANESE_MAPLE = WoodItems.register("japanese_maple", TerrestriaBlocks.JAPANESE_MAPLE, () -> TerrestriaEntities.JAPANESE_MAPLE_BOAT);
RAINBOW_EUCALYPTUS = WoodItems.register("rainbow_eucalyptus", TerrestriaBlocks.RAINBOW_EUCALYPTUS, () -> TerrestriaEntities.RAINBOW_EUCALYPTUS_BOAT);
SAKURA = WoodItems.register("sakura", TerrestriaBlocks.SAKURA, () -> TerrestriaEntities.SAKURA_BOAT);
SAKURA.wood = SAKURA.log;

JAPANESE_MAPLE_SHRUB_LEAVES = TerrestriaRegistry.registerBlockItem("japanese_maple_shrub_leaves", TerrestriaBlocks.JAPANESE_MAPLE_SHRUB_LEAVES);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
package com.terraformersmc.terrestria.init.helpers;

import com.terraformersmc.terraform.entity.TerraformBoatEntity;
import com.terraformersmc.terraform.item.TerraformBoatItem;
import com.terraformersmc.terraform.util.RecipeUtil;
import com.terraformersmc.terrestria.Terrestria;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.SignItem;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import java.util.function.Supplier;

public class TerrestriaRegistry {

public static BlockItem registerBlockItem(String name, Block block) {
BlockItem item = new BlockItem(block, new Item.Settings().group(Terrestria.ITEM_GROUP));
item.appendBlocks(Item.BLOCK_ITEMS, item);

RecipeUtil.registerCompostableBlock(block);
return Registry.register(net.minecraft.util.registry.Registry.ITEM, new Identifier(Terrestria.MOD_ID, name), item);

return Registry.register(Registry.ITEM, new Identifier(Terrestria.MOD_ID, name), item);
}

public static SignItem registerSignItem(String name, Block standing, Block wall) {
return Registry.register(net.minecraft.util.registry.Registry.ITEM, new Identifier(Terrestria.MOD_ID, name), new SignItem(new Item.Settings().group(Terrestria.ITEM_GROUP), standing, wall));
return Registry.register(Registry.ITEM, new Identifier(Terrestria.MOD_ID, name), new SignItem(new Item.Settings().group(Terrestria.ITEM_GROUP), standing, wall));
}

public static TerraformBoatItem registerBoatItem(String name, Supplier<EntityType<TerraformBoatEntity>> boatType) {
return Registry.register(Registry.ITEM, new Identifier(Terrestria.MOD_ID, name), new TerraformBoatItem (
(world, x, y, z) -> {
TerraformBoatEntity entity = boatType.get().create(world);

entity.setPosition(x, y, z);

return entity;
},
new Item.Settings().group(Terrestria.ITEM_GROUP).maxCount(1)
));
}

public static <T extends Block> T register(String name, T block) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.terraformersmc.terrestria.init.helpers;

import com.terraformersmc.terraform.entity.TerraformBoatEntity;
import com.terraformersmc.terraform.item.TerraformBoatItem;
import net.minecraft.entity.EntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.SignItem;

import java.util.function.Supplier;

public class WoodItems {

public BlockItem log;
Expand All @@ -20,11 +25,12 @@ public class WoodItems {
public BlockItem trapdoor;
public BlockItem strippedLog;
public BlockItem strippedWood;
public TerraformBoatItem boat;

private WoodItems() {
}

public static WoodItems register(String name, WoodBlocks blocks) {
public static WoodItems register(String name, WoodBlocks blocks, Supplier<EntityType<TerraformBoatEntity>> boatType) {
WoodItems items = new WoodItems();

items.log = TerrestriaRegistry.registerBlockItem(name + "_log", blocks.log);
Expand All @@ -40,6 +46,7 @@ public static WoodItems register(String name, WoodBlocks blocks) {
items.trapdoor = TerrestriaRegistry.registerBlockItem(name + "_trapdoor", blocks.trapdoor);
items.sign = TerrestriaRegistry.registerSignItem(name + "_sign", blocks.sign, blocks.wallSign);
items.strippedLog = TerrestriaRegistry.registerBlockItem("stripped_" + name + "_log", blocks.strippedLog);
items.boat = TerrestriaRegistry.registerBoatItem(name + "_boat", boatType);

if (blocks.log != blocks.wood) {
items.wood = TerrestriaRegistry.registerBlockItem(name + "_wood", blocks.wood);
Expand Down
18 changes: 17 additions & 1 deletion src/main/resources/assets/terrestria/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"itemGroup.terrestria.items": "Terrestria",
"item.terrestria.cypress_boat": "Cypress Boat",
"item.terrestria.hemlock_boat": "Hemlock Boat",
"item.terrestria.japanese_maple_boat": "Japanese Maple Boat",
"item.terrestria.rainbow_eucalyptus_boat": "Rainbow Eucalyptus Boat",
"item.terrestria.redwood_boat": "Redwood Boat",
"item.terrestria.rubber_boat": "Rubber Wood Boat",
"item.terrestria.sakura_boat": "Sakura Boat",
"item.terrestria.willow_boat": "Willow Boat",
"block.terrestria.redwood_log": "Redwood Log",
"block.terrestria.redwood_wood": "Redwood Wood",
"block.terrestria.redwood_quarter_log": "Redwood Log",
Expand Down Expand Up @@ -221,5 +229,13 @@
"biome.terrestria.caldera_beach": "Caldera Beach",
"biome.terrestria.volcanic_island": "Volcanic Island",
"biome.terrestria.volcanic_island_beach": "Volcanic Island Beach",
"biome.terrestria.volcanic_island_shore": "Volcanic Island Shore"
"biome.terrestria.volcanic_island_shore": "Volcanic Island Shore",
"entity.terrestria.cypress_boat": "Cypress Boat",
"entity.terrestria.hemlock_boat": "Hemlock Boat",
"entity.terrestria.japanese_maple_boat": "Japanese Maple Boat",
"entity.terrestria.rainbow_eucalyptus_boat": "Rainbow Eucalyptus Boat",
"entity.terrestria.redwood_boat": "Redwood Boat",
"entity.terrestria.rubber_boat": "Rubber Wood Boat",
"entity.terrestria.sakura_boat": "Sakura Boat",
"entity.terrestria.willow_boat": "Willow Boat"
}
Loading

0 comments on commit 04694ee

Please sign in to comment.