Skip to content

Commit

Permalink
Make slime dirt and leaves a bit tougher, and use harvest tools for v…
Browse files Browse the repository at this point in the history
…arious dirt types

Logs also use tougher harvest tiers now, lets really make people use their diamond tipped axes and shovels
  • Loading branch information
KnightMiner committed Feb 14, 2022
1 parent 4dfd985 commit 39f7ebd
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"replace": false,
"values": [
"tconstruct:greenheart_log",
"tconstruct:greenheart_wood",
"tconstruct:sky_slime_dirt",
"tconstruct:sky_sky_slime_grass",
"tconstruct:blood_sky_slime_grass",
"tconstruct:sky_vanilla_slime_grass",
"tconstruct:skyroot_log",
"tconstruct:skyroot_wood",
"tconstruct:bloodshroom_log",
"tconstruct:bloodshroom_wood",
"tconstruct:seared_stone",
"tconstruct:seared_stone_slab",
"tconstruct:seared_stone_stairs",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"tconstruct:blood_vanilla_slime_grass"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"tconstruct:nahuatl_slab",
"tconstruct:nahuatl_stairs",
"tconstruct:nahuatl_fence",
"tconstruct:greenheart_log",
"tconstruct:greenheart_wood",
"tconstruct:skyroot_log",
"tconstruct:skyroot_wood",
"tconstruct:greenheart_log",
"tconstruct:greenheart_wood",
"tconstruct:bloodshroom_log",
"tconstruct:bloodshroom_wood",
"tconstruct:sky_slime_vine",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
"tconstruct:hepatizon_block",
"tconstruct:soulsteel_block",
"tconstruct:silky_jewel_block",
"tconstruct:ender_slime_dirt",
"tconstruct:ender_earth_slime_grass",
"tconstruct:ender_sky_slime_grass",
"tconstruct:ender_ichor_slime_grass",
"tconstruct:earth_ender_slime_grass",
"tconstruct:sky_ender_slime_grass",
"tconstruct:ichor_ender_slime_grass",
"tconstruct:ender_ender_slime_grass",
"tconstruct:blood_ender_slime_grass",
"tconstruct:ender_vanilla_slime_grass",
"tconstruct:scorched_drain",
"tconstruct:scorched_duct",
"tconstruct:foundry_controller"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
"tconstruct:tinkers_bronze_block",
"tconstruct:rose_gold_block",
"tconstruct:pig_iron_block",
"tconstruct:ichor_slime_dirt",
"tconstruct:ichor_earth_slime_grass",
"tconstruct:ichor_sky_slime_grass",
"tconstruct:earth_ichor_slime_grass",
"tconstruct:sky_ichor_slime_grass",
"tconstruct:ichor_ichor_slime_grass",
"tconstruct:blood_ichor_slime_grass",
"tconstruct:ichor_vanilla_slime_grass",
"tconstruct:bloodshroom_log",
"tconstruct:bloodshroom_wood",
"tconstruct:seared_duct",
"tconstruct:scorched_duct",
"tconstruct:tinkers_anvil",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"values": [
"tconstruct:iron_platform",
"#tconstruct:copper_platforms",
"tconstruct:earth_slime_dirt",
"tconstruct:earth_earth_slime_grass",
"tconstruct:sky_earth_slime_grass",
"tconstruct:blood_earth_slime_grass",
"tconstruct:earth_sky_slime_grass",
"tconstruct:earth_vanilla_slime_grass",
"tconstruct:greenheart_log",
"tconstruct:greenheart_wood",
"tconstruct:seared_drain",
"tconstruct:seared_chute",
"tconstruct:smeltery_controller",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.Tag;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.common.Tags;
Expand All @@ -30,6 +31,7 @@
import slimeknights.tconstruct.world.TinkerHeadType;
import slimeknights.tconstruct.world.TinkerWorld;

import java.util.Objects;
import java.util.function.Supplier;

import static net.minecraft.tags.BlockTags.MINEABLE_WITH_AXE;
Expand Down Expand Up @@ -335,8 +337,27 @@ private void addHarvest() {

// slime
tagBlocks(MINEABLE_WITH_SHOVEL, TinkerWorld.congealedSlime, TinkerWorld.slimeDirt, TinkerWorld.vanillaSlimeGrass, TinkerWorld.earthSlimeGrass, TinkerWorld.skySlimeGrass, TinkerWorld.enderSlimeGrass, TinkerWorld.ichorSlimeGrass);
// harvest tiers on shovel blocks
TinkerWorld.slimeDirt.forEach((type, block) -> this.tag((Tag.Named<Block>)Objects.requireNonNull(type.getHarvestTier().getTag())).add(block));
for (SlimeType dirt : SlimeType.values()) {
for (SlimeType grass : SlimeType.values()) {
Tiers dirtTier = dirt.getHarvestTier();
Tiers grassTier = grass.getHarvestTier();
// cannot use tier sorting registry as its not init during datagen, stuck comparing levels and falling back to ordinal for gold
Tiers tier;
if (dirtTier.getLevel() == grassTier.getLevel()) {
tier = dirtTier.ordinal() > grassTier.ordinal() ? dirtTier : grassTier;
} else {
tier = dirtTier.getLevel() > grassTier.getLevel() ? dirtTier : grassTier;
}
this.tag((Tag.Named<Block>)Objects.requireNonNull(tier.getTag())).add(TinkerWorld.slimeGrass.get(dirt).get(grass));
}
}

tagBlocks(MINEABLE_WITH_HOE, TinkerWorld.slimeLeaves);
tagLogs(MINEABLE_WITH_AXE, NEEDS_GOLD_TOOL, TinkerWorld.greenheart, TinkerWorld.skyroot, TinkerWorld.bloodshroom);
tagLogs(MINEABLE_WITH_AXE, NEEDS_GOLD_TOOL, TinkerWorld.skyroot);
tagLogs(MINEABLE_WITH_AXE, NEEDS_STONE_TOOL, TinkerWorld.greenheart);
tagLogs(MINEABLE_WITH_AXE, NEEDS_IRON_TOOL, TinkerWorld.bloodshroom);
tagPlanks(MINEABLE_WITH_SHOVEL, TinkerWorld.greenheart, TinkerWorld.skyroot, TinkerWorld.bloodshroom);
tagBlocks(MINEABLE_WITH_AXE, TinkerWorld.skySlimeVine, TinkerWorld.enderSlimeVine);
tagBlocks(MINEABLE_WITH_PICKAXE, TinkerWorld.earthGeode, TinkerWorld.skyGeode, TinkerWorld.ichorGeode, TinkerWorld.enderGeode);
Expand Down
24 changes: 14 additions & 10 deletions src/main/java/slimeknights/tconstruct/shared/block/SlimeType.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
package slimeknights.tconstruct.shared.block;

import lombok.Getter;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.item.Item;
import net.minecraft.util.StringRepresentable;
import net.minecraftforge.common.Tags.IOptionalNamedTag;
import slimeknights.tconstruct.common.TinkerTags;

import java.util.Locale;

@Getter
public enum SlimeType implements StringRepresentable {
EARTH(0x01cd4e, 0x8CD782, MaterialColor.GRASS, false),
SKY(0x01cbcd, 0x00F4DA, MaterialColor.DIAMOND, false),
ICHOR(0xff970d, 0xd09800, MaterialColor.COLOR_ORANGE, true, 10),
ENDER(0xaf4cf6, 0xa92dff, MaterialColor.COLOR_PURPLE, false),
BLOOD(0xb50101, 0xb80000, MaterialColor.COLOR_RED, true);
EARTH(0x01cd4e, 0x8CD782, Tiers.STONE, MaterialColor.GRASS, false),
SKY (0x01cbcd, 0x00F4DA, Tiers.GOLD, MaterialColor.DIAMOND, false),
ICHOR(0xff970d, 0xd09800, Tiers.IRON, MaterialColor.COLOR_ORANGE, true, 10),
ENDER(0xaf4cf6, 0xa92dff, Tiers.DIAMOND, MaterialColor.COLOR_PURPLE, false),
BLOOD(0xb50101, 0xb80000, Tiers.WOOD, MaterialColor.COLOR_RED, true);

/** Slime types added by the mod */
public static final SlimeType[] TINKER = {SKY, ENDER, BLOOD, ICHOR};
Expand All @@ -34,6 +35,8 @@ public enum SlimeType implements StringRepresentable {
/** Default color for this foliage, used in inventory */
private final int defaultFoliageColor;

private final Tiers harvestTier;

private final MaterialColor mapColor;
/** If true, this block type has fungus foliage instead of grass */
private final boolean nether;
Expand All @@ -48,9 +51,10 @@ public enum SlimeType implements StringRepresentable {
/** Tag for slime balls of this type */
private final IOptionalNamedTag<Item> slimeballTag;

SlimeType(int color, int defaultFoliageColor, MaterialColor mapColor, boolean nether, int lightLevel) {
SlimeType(int color, int defaultFoliageColor, Tiers harvestTier, MaterialColor mapColor, boolean nether, int lightLevel) {
this.color = color;
this.defaultFoliageColor = defaultFoliageColor;
this.harvestTier = harvestTier;
this.mapColor = mapColor;
this.nether = nether;
this.lightLevel = lightLevel;
Expand All @@ -61,8 +65,8 @@ public enum SlimeType implements StringRepresentable {
slimeballTag = TinkerTags.Items.forgeTag("slimeball/" + name);
}

SlimeType(int color, int defaultFoliageColor, MaterialColor mapColor, boolean nether) {
this(color, defaultFoliageColor, mapColor, nether, 0);
SlimeType(int color, int defaultFoliageColor, Tiers harvestTier, MaterialColor mapColor, boolean nether) {
this(color, defaultFoliageColor, harvestTier, mapColor, nether, 0);
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/slimeknights/tconstruct/world/TinkerWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public final class TinkerWorld extends TinkerModule {
case ENDER -> MaterialColor.TERRACOTTA_LIGHT_BLUE;
case ICHOR -> MaterialColor.TERRACOTTA_ORANGE;
};
return BLOCKS.registerEnum(SlimeType.TRUE_SLIME, "slime_dirt", (type) -> new SlimeDirtBlock(builder(Material.DIRT, color.apply(type), SoundType.SLIME_BLOCK).strength(0.55F)), TOOLTIP_BLOCK_ITEM);
return BLOCKS.registerEnum(SlimeType.TRUE_SLIME, "slime_dirt", (type) -> new SlimeDirtBlock(builder(Material.DIRT, color.apply(type), SoundType.SLIME_BLOCK).strength(1.9f)), TOOLTIP_BLOCK_ITEM);
});
public static final EnumObject<SlimeType, Block> allDirt = new EnumObject.Builder<SlimeType, Block>(SlimeType.class).put(SlimeType.BLOOD, Blocks.DIRT.delegate).putAll(slimeDirt).build();

Expand All @@ -166,7 +166,7 @@ public final class TinkerWorld extends TinkerModule {
public static final Map<SlimeType, EnumObject<SlimeType, Block>> slimeGrass = new EnumMap<>(SlimeType.class);

static {
Function<SlimeType,BlockBehaviour.Properties> slimeGrassProps = type -> builder(Material.GRASS, type.getMapColor(), SoundType.SLIME_BLOCK).strength(0.65F).randomTicks();
Function<SlimeType,BlockBehaviour.Properties> slimeGrassProps = type -> builder(Material.GRASS, type.getMapColor(), SoundType.SLIME_BLOCK).strength(2.0f).requiresCorrectToolForDrops().randomTicks();
Function<SlimeType, Block> slimeGrassRegister = type -> type.isNether() ? new SlimeNyliumBlock(slimeGrassProps.apply(type), type) : new SlimeGrassBlock(slimeGrassProps.apply(type), type);
// blood is not an exact match for vanilla, but close enough
vanillaSlimeGrass = BLOCKS.registerEnum(SlimeType.values(), "vanilla_slime_grass", slimeGrassRegister, TOOLTIP_BLOCK_ITEM);
Expand Down Expand Up @@ -223,15 +223,15 @@ private static Function<WoodVariant,BlockBehaviour.Properties> createSlimewood(M
});
public static final EnumObject<SlimeType, Block> slimeLeaves = BLOCKS.registerEnum(SlimeType.values(), "slime_leaves", type -> {
if (type.isNether()) {
return new SlimeWartBlock(builder(Material.GRASS, type.getMapColor(), SoundType.WART_BLOCK).strength(1.0F).isValidSpawn((s, w, p, e) -> false), type);
return new SlimeWartBlock(builder(Material.GRASS, type.getMapColor(), SoundType.WART_BLOCK).strength(1.5F).isValidSpawn((s, w, p, e) -> false), type);
}
return new SlimeLeavesBlock(builder(Material.LEAVES, type.getMapColor(), SoundType.GRASS).strength(0.3f).randomTicks().noOcclusion().isValidSpawn((s, w, p, e) -> false), type);
return new SlimeLeavesBlock(builder(Material.LEAVES, type.getMapColor(), SoundType.GRASS).strength(1.0f).randomTicks().noOcclusion().isValidSpawn((s, w, p, e) -> false), type);
}, DEFAULT_BLOCK_ITEM);

// slime vines
public static final ItemObject<SlimeVineBlock> skySlimeVine, enderSlimeVine;
static {
Function<SlimeType,BlockBehaviour.Properties> props = type -> builder(Material.REPLACEABLE_PLANT, type.getMapColor(), SoundType.GRASS).strength(0.3F).noCollission().randomTicks();
Function<SlimeType,BlockBehaviour.Properties> props = type -> builder(Material.REPLACEABLE_PLANT, type.getMapColor(), SoundType.GRASS).strength(0.75F).noCollission().randomTicks();
skySlimeVine = BLOCKS.register("sky_slime_vine", () -> new SlimeVineBlock(props.apply(SlimeType.SKY), SlimeType.SKY), DEFAULT_BLOCK_ITEM);
enderSlimeVine = BLOCKS.register("ender_slime_vine", () -> new SlimeVineBlock(props.apply(SlimeType.ENDER), SlimeType.ENDER), DEFAULT_BLOCK_ITEM);
}
Expand Down

0 comments on commit 39f7ebd

Please sign in to comment.