Skip to content

Commit

Permalink
Added assets for Temperature Gauge and Thermometer (Not functional yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Jan 1, 2024
1 parent 2a83bae commit f19d272
Show file tree
Hide file tree
Showing 46 changed files with 199 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// 1.20.4 2023-12-25T10:07:37.6375031 Loot Tables
// 1.20.4 2024-01-01T08:38:05.3377628 Loot Tables
8fca2e50f9df3893ec7ecb84fb15e5f83b33508a data/toughasnails/loot_tables/blocks/rain_collector.json
5b982875ef4148c8acb507e82e690b7ffd814749 data/toughasnails/loot_tables/blocks/temperature_gauge.json
1410cb58946442b13107a7153298bdcdc8ccaacc data/toughasnails/loot_tables/blocks/water_purifier.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2023-12-25T10:07:37.6380033 Recipes
// 1.20.4 2024-01-01T08:38:05.3377628 Recipes
09252bd5a872203de304820e8d5c5493afe96cf4 data/toughasnails/advancements/recipes/combat/leaf_boots.json
2da825265e95f5dfc0dd4026e0dafee70c17512c data/toughasnails/advancements/recipes/combat/leaf_chestplate.json
6d96cd4baff66d426c9405852ceed3aa8a3cde8f data/toughasnails/advancements/recipes/combat/leaf_helmet.json
Expand All @@ -16,6 +16,7 @@ db0a08a7c6ccc69ca4625db57d678ce644fdfe49 data/toughasnails/advancements/recipes/
938ed87afb45ab9596ddcb2435f32472a880e6bd data/toughasnails/advancements/recipes/food/melon_juice.json
1441a8289dbc285c34bf874d6976315fb41001f0 data/toughasnails/advancements/recipes/food/pumpkin_juice.json
1b3828862b65dcfb0a1e6d99070287e896379558 data/toughasnails/advancements/recipes/food/sweet_berry_juice.json
12ff7cdfde84ded584c6dd340468d1ea34b2afa1 data/toughasnails/advancements/recipes/redstone/temperature_gauge.json
8b0e1899a965cbcf725172709f9f7f7062c43a5c data/toughasnails/advancements/recipes/tools/empty_canteen.json
715184d6dfbadc65234a787d2e8271dce076e7b1 data/toughasnails/recipes/apple_juice.json
7aefc36c9cb1e7393660e57c9bfe2f47e9c472b9 data/toughasnails/recipes/cactus_juice.json
Expand All @@ -33,6 +34,7 @@ e4a98b0325be4fb27194eb56a079871cdc8d4114 data/toughasnails/recipes/pumpkin_juice
351a2d892d1bc8eaf091aa41c732953c85b661b0 data/toughasnails/recipes/purified_water_canteen.json
454a67d0df9042690154a1b3b372a5fff586b47d data/toughasnails/recipes/rain_collector.json
2512026dc3a027f39db7e77e023a7017de386b9c data/toughasnails/recipes/sweet_berry_juice.json
114b28980e7fe554a5d673093f323d73b4497447 data/toughasnails/recipes/temperature_gauge.json
9e06d792260bac7da2725c0b4ab95e165f6ffbec data/toughasnails/recipes/water_canteen.json
26985bc2361f55479fce0f342c9c2b7573237c7f data/toughasnails/recipes/water_purifier.json
30229579a58927cae7011781b0936f7ca87888a4 data/toughasnails/recipes/wool_boots.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2023-12-25T10:07:37.6365035 Tags for minecraft:block mod id toughasnails
bffb0fdf09ac6cfbed64666a723e8a78cb784bbd data/minecraft/tags/blocks/mineable/pickaxe.json
// 1.20.4 2024-01-01T08:38:05.3367638 Tags for minecraft:block mod id toughasnails
bdcc25ec3d77d0540777147a5b124a1e15619160 data/minecraft/tags/blocks/mineable/pickaxe.json
eed9ca8217c04724f67008aba1a0a5edde5697c2 data/toughasnails/tags/blocks/cooling_blocks.json
d4134d307e68e7865444c0d1d1ab81babc6a27ff data/toughasnails/tags/blocks/heating_blocks.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"toughasnails:temperature_gauge",
"toughasnails:rain_collector",
"toughasnails:water_purifier"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_redstone": {
"conditions": {
"items": [
{
"items": [
"minecraft:redstone"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "toughasnails:temperature_gauge"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_redstone"
]
],
"rewards": {
"recipes": [
"toughasnails:temperature_gauge"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "toughasnails:temperature_gauge"
}
],
"rolls": 1.0
}
],
"random_sequence": "toughasnails:blocks/temperature_gauge"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"B": {
"item": "minecraft:brick_slab"
},
"G": {
"item": "minecraft:glass"
},
"R": {
"item": "minecraft:redstone"
}
},
"pattern": [
"GGG",
"RRR",
"BBB"
],
"result": {
"item": "toughasnails:temperature_gauge"
}
}
1 change: 1 addition & 0 deletions common/src/main/java/toughasnails/api/block/TANBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

public class TANBlocks
{
public static Block TEMPERATURE_GAUGE;
public static Block RAIN_COLLECTOR;
public static Block WATER_PURIFIER;
}
1 change: 1 addition & 0 deletions common/src/main/java/toughasnails/api/item/TANItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TANItems
public static Item TAN_ICON;

// Block items
public static Item TEMPERATURE_GAUGE;
public static Item RAIN_COLLECTOR;
public static Item WATER_PURIFIER;
}
76 changes: 76 additions & 0 deletions common/src/main/java/toughasnails/block/TemperatureGaugeBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*******************************************************************************
* Copyright 2021, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package toughasnails.block;

import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class TemperatureGaugeBlock extends Block
{
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D);
public static final BooleanProperty INVERTED = BlockStateProperties.INVERTED;

public TemperatureGaugeBlock(Properties properties)
{
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(INVERTED, false));
}

@Override
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult rayTraceResult)
{
if (player.mayBuild())
{
if (world.isClientSide)
{
return InteractionResult.SUCCESS;
}
else
{
BlockState blockstate = (BlockState)state.cycle(INVERTED);
world.setBlock(pos, blockstate, 2);
world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, blockstate));
// TODO: REPLACE WITH SIGNAL STRENGTH UPDATE
// updateSignalStrength(blockstate, world, pos);
return InteractionResult.CONSUME;
}
}
else
{
return super.use(state, world, pos, player, hand, rayTraceResult);
}
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext selectionContext)
{
return SHAPE;
}

@Override
public boolean useShapeForLightOcclusion(BlockState state)
{
return true;
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder)
{
builder.add(INVERTED);
}
}
4 changes: 2 additions & 2 deletions common/src/main/java/toughasnails/init/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package toughasnails.init;

import glitchcore.event.client.RegisterColorsEvent;
import glitchcore.util.Environment;
import glitchcore.util.RenderTypeHelper;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -15,8 +14,8 @@
import toughasnails.api.TANAPI;
import toughasnails.api.block.TANBlocks;
import toughasnails.block.RainCollectorBlock;
import toughasnails.block.TemperatureGaugeBlock;
import toughasnails.block.WaterPurifierBlock;
import toughasnails.core.ToughAsNails;

import java.util.function.BiConsumer;

Expand All @@ -27,6 +26,7 @@ public class ModBlocks
{
public static void registerBlocks(BiConsumer<ResourceLocation, Block> func)
{
TANBlocks.TEMPERATURE_GAUGE = register(func, "temperature_gauge", new TemperatureGaugeBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).requiresCorrectToolForDrops().strength(1.0F)));
TANBlocks.RAIN_COLLECTOR = register(func, "rain_collector", new RainCollectorBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).requiresCorrectToolForDrops().strength(2.0F).noOcclusion()));
TANBlocks.WATER_PURIFIER = register(func, "water_purifier", new WaterPurifierBlock(BlockBehaviour.Properties.of().requiresCorrectToolForDrops().strength(3.5F).noOcclusion()));
}
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/toughasnails/init/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static void registerItems(BiConsumer<ResourceLocation, Item> func)

TANItems.TAN_ICON = register(func, "tan_icon", new Item(new Item.Properties()));

TANItems.TEMPERATURE_GAUGE = register(func, "temperature_gauge", new BlockItem(TANBlocks.TEMPERATURE_GAUGE, new Item.Properties()));
TANItems.RAIN_COLLECTOR = register(func, "rain_collector", new BlockItem(TANBlocks.RAIN_COLLECTOR, new Item.Properties()));
TANItems.WATER_PURIFIER = register(func, "water_purifier", new BlockItem(TANBlocks.WATER_PURIFIER, new Item.Properties()));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"variants": {
"inverted=false": {
"model": "toughasnails:block/temperature_gauge"
},
"inverted=true": {
"model": "toughasnails:block/temperature_gauge_inverted"
}
}
}
2 changes: 2 additions & 0 deletions common/src/main/resources/assets/toughasnails/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"enchantment.toughasnails.thermal_tuning": "Thermal Tuning",

"block.toughasnails.rain_collector": "Rain Collector",
"block.toughasnails.temperature_gauge": "Temperature Gauge",
"block.toughasnails.water_purifier": "Water Purifier",

"item.toughasnails.apple_juice": "Apple Juice",
Expand All @@ -46,6 +47,7 @@
"item.toughasnails.purified_water_canteen": "Purified Water Canteen",
"item.toughasnails.sweet_berry_juice": "Sweet Berry Juice",
"item.toughasnails.tan_icon": "TAN Icon",
"item.toughasnails.thermometer": "Thermometer",
"item.toughasnails.water_canteen": "Water Canteen",
"item.toughasnails.wool_boots": "Wool Boots",
"item.toughasnails.wool_chestplate": "Wool Parka",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_daylight_detector",
"textures": {
"side": "toughasnails:block/temperature_gauge_side",
"top": "toughasnails:block/temperature_gauge_top"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/template_daylight_detector",
"textures": {
"side": "toughasnails:block/temperature_gauge_side",
"top": "toughasnails:block/temperature_gauge_inverted_top"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "toughasnails:block/temperature_gauge"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public TANBlockLoot()
@Override
protected void generate()
{
this.dropSelf(TANBlocks.TEMPERATURE_GAUGE);
this.dropSelf(TANBlocks.RAIN_COLLECTOR);
this.dropSelf(TANBlocks.WATER_PURIFIER);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TANBlockTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Pr
protected void addTags(HolderLookup.Provider provider)
{
// Vanilla tags
this.tag(BlockTags.MINEABLE_WITH_PICKAXE).add(TANBlocks.RAIN_COLLECTOR, TANBlocks.WATER_PURIFIER);
this.tag(BlockTags.MINEABLE_WITH_PICKAXE).add(TANBlocks.TEMPERATURE_GAUGE, TANBlocks.RAIN_COLLECTOR, TANBlocks.WATER_PURIFIER);

// TAN tags
this.tag(ModTags.Blocks.COOLING_BLOCKS).add(Blocks.SOUL_FIRE, Blocks.SOUL_CAMPFIRE, Blocks.SOUL_LANTERN, Blocks.PACKED_ICE, Blocks.BLUE_ICE, Blocks.POWDER_SNOW_CAULDRON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected void buildRecipes(RecipeOutput output)
ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, TANItems.SWEET_BERRY_JUICE).requires(TANItems.PURIFIED_WATER_BOTTLE).requires(Items.SUGAR).requires(Items.SWEET_BERRIES).group("juice").unlockedBy("has_sweet_berries", has(Items.SWEET_BERRIES)).save(output);

// Blocks
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, TANBlocks.TEMPERATURE_GAUGE).define('G', Items.GLASS).define('R', Items.REDSTONE).define('B', Items.BRICK_SLAB).pattern("GGG").pattern("RRR").pattern("BBB").unlockedBy("has_redstone", has(Items.REDSTONE)).save(output);
ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, TANBlocks.RAIN_COLLECTOR).define('S', Items.STRING).define('I', Items.IRON_INGOT).define('B', Items.BARREL).pattern("ISI").pattern("IBI").unlockedBy("has_barrel", has(Items.BARREL)).save(output);
ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, TANBlocks.WATER_PURIFIER).define('W', ItemTags.PLANKS).define('S', ItemTags.SAND).define('C', Items.CHARCOAL).define('G', Items.GLASS).pattern("WSW").pattern("GCG").pattern("GGG").unlockedBy("has_charcoal", has(Items.CHARCOAL)).save(output);

Expand Down

0 comments on commit f19d272

Please sign in to comment.