Skip to content

Commit

Permalink
Added base block for Thermoregulator and fixed models
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Jan 4, 2024
1 parent 06a6a92 commit 48d73eb
Show file tree
Hide file tree
Showing 37 changed files with 364 additions and 219 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// 1.20.4 2024-01-01T08:38:05.3377628 Loot Tables
// 1.20.4 2024-01-04T10:16:03.4651007 Loot Tables
8fca2e50f9df3893ec7ecb84fb15e5f83b33508a data/toughasnails/loot_tables/blocks/rain_collector.json
5b982875ef4148c8acb507e82e690b7ffd814749 data/toughasnails/loot_tables/blocks/temperature_gauge.json
3014cc41e7b43922f50ec3eb6c2eb83fbf3201d2 data/toughasnails/loot_tables/blocks/thermoregulator.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 2024-01-02T16:58:35.4468401 Recipes
// 1.20.4 2024-01-04T10:16:03.4651007 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 @@ -8,6 +8,7 @@ e8c549cdadb494e5854491524dbb6404aeb7f9a9 data/toughasnails/advancements/recipes/
55e82e2e3092ccc58b5747ed2bafb449eccf091f data/toughasnails/advancements/recipes/combat/wool_helmet.json
71aaf601361469d6104d38fb81aebd32861df055 data/toughasnails/advancements/recipes/combat/wool_leggings.json
40c2eb94d0593910a7114f2695c5f3f129f7d035 data/toughasnails/advancements/recipes/decorations/rain_collector.json
4e1355c9b87cc165d6d32640aa49f30dcec6a55a data/toughasnails/advancements/recipes/decorations/thermoregulator.json
852c89cb611b30ccdcd1608dd261f33c5f600fb9 data/toughasnails/advancements/recipes/decorations/water_purifier.json
5f76369328acf2e24354a8918957059d62c035bc data/toughasnails/advancements/recipes/food/apple_juice.json
a566bf835d6a75c46dd173af19b9dd0f4fe7469c data/toughasnails/advancements/recipes/food/cactus_juice.json
Expand Down Expand Up @@ -68,6 +69,7 @@ fb03395b2b66dc861d110435b0d5c63a351123cd data/toughasnails/recipes/rain_collecto
2512026dc3a027f39db7e77e023a7017de386b9c data/toughasnails/recipes/sweet_berry_juice.json
e636bfd4fab8d516083454e872c8115f5c15cf27 data/toughasnails/recipes/temperature_gauge.json
b75d1caa0b1dcb9ae14dc02e47bba2a3c4b4a4dc data/toughasnails/recipes/thermometer.json
ec555eb461e41d183f1663ce4f9be35d3036d72d data/toughasnails/recipes/thermoregulator.json
cbfb7c82bd9547a1a134e3814136fbdbcdd5dc79 data/toughasnails/recipes/water_purifier.json
30229579a58927cae7011781b0936f7ca87888a4 data/toughasnails/recipes/wool_boots.json
25ff54ef0230fd94b0f881f7866b571f4729d254 data/toughasnails/recipes/wool_chestplate.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 1.20.4 2024-01-04T08:50:19.999926 Tags for minecraft:block mod id toughasnails
// 1.20.4 2024-01-04T10:16:03.4641005 Tags for minecraft:block mod id toughasnails
dfed6a08d97cca915d349d312f18532c01063afa data/minecraft/tags/blocks/mineable/axe.json
204b99a448ab27dca7519b0ea2c4e0a422b1f12a data/minecraft/tags/blocks/mineable/pickaxe.json
2268290ab36d87a8ceacfe6fdbf187ed29a4dc80 data/minecraft/tags/blocks/mineable/pickaxe.json
eed9ca8217c04724f67008aba1a0a5edde5697c2 data/toughasnails/tags/blocks/cooling_blocks.json
658fab0118eb1ac9896e1b9ab89f2d5ed055a967 data/toughasnails/tags/blocks/heating_blocks.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"toughasnails:thermoregulator",
"toughasnails:temperature_gauge",
"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_the_recipe": {
"conditions": {
"recipe": "toughasnails:thermoregulator"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_thermometer": {
"conditions": {
"items": [
{
"items": [
"toughasnails:thermometer"
]
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_the_recipe",
"has_thermometer"
]
],
"rewards": {
"recipes": [
"toughasnails:thermoregulator"
]
}
}
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:thermoregulator"
}
],
"rolls": 1.0
}
],
"random_sequence": "toughasnails:blocks/thermoregulator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"G": {
"item": "minecraft:glass"
},
"I": {
"item": "minecraft:iron_ingot"
},
"S": {
"item": "minecraft:smooth_stone"
},
"T": {
"item": "toughasnails:thermometer"
}
},
"pattern": [
"SGS",
"ITI",
"SGS"
],
"result": {
"item": "toughasnails:thermoregulator"
}
}
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 THERMOREGULATOR;
public static Block TEMPERATURE_GAUGE;
public static Block RAIN_COLLECTOR;
public static Block WATER_PURIFIER;
Expand Down
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 @@ -10,6 +10,7 @@
public class TANItems
{
// Block Items
public static Item THERMOREGULATOR;
public static Item TEMPERATURE_GAUGE;
public static Item RAIN_COLLECTOR;
public static Item WATER_PURIFIER;
Expand Down
40 changes: 40 additions & 0 deletions common/src/main/java/toughasnails/block/ThermoregulatorBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*******************************************************************************
* Copyright 2021, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package toughasnails.block;

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.BooleanProperty;

import java.util.function.ToIntFunction;

public class ThermoregulatorBlock extends Block
{
public static final BooleanProperty COOLING = BooleanProperty.create("cooling");
public static final BooleanProperty HEATING = BooleanProperty.create("heating");

public ThermoregulatorBlock(Properties properties)
{
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(COOLING, false).setValue(HEATING, false));
}

public static ToIntFunction<BlockState> lightLevel(int level)
{
return (state) -> {
boolean cooling = state.getValue(COOLING);
boolean heating = state.getValue(HEATING);

return ((cooling ? 1: 0) + (heating ? 1: 0)) * level;
};
}

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

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.CaveVines;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
Expand All @@ -14,6 +15,7 @@
import toughasnails.api.block.TANBlocks;
import toughasnails.block.RainCollectorBlock;
import toughasnails.block.TemperatureGaugeBlock;
import toughasnails.block.ThermoregulatorBlock;
import toughasnails.block.WaterPurifierBlock;

import java.util.function.BiConsumer;
Expand All @@ -22,6 +24,7 @@ public class ModBlocks
{
public static void registerBlocks(BiConsumer<ResourceLocation, Block> func)
{
TANBlocks.THERMOREGULATOR = register(func, "thermoregulator", new ThermoregulatorBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(3.5F).lightLevel(ThermoregulatorBlock.lightLevel(6))));
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.COLOR_BLUE).instrument(NoteBlockInstrument.BASS).strength(2.5F).sound(SoundType.WOOD).noOcclusion()));
TANBlocks.WATER_PURIFIER = register(func, "water_purifier", new WaterPurifierBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_ORANGE).requiresCorrectToolForDrops().strength(3.0F, 6.0F).sound(SoundType.COPPER).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 @@ -22,6 +22,7 @@ public class ModItems
public static void registerItems(BiConsumer<ResourceLocation, Item> func)
{
// Block Items
TANItems.THERMOREGULATOR = register(func, "thermoregulator", new BlockItem(TANBlocks.THERMOREGULATOR, 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,16 @@
{
"variants": {
"cooling=false,heating=false": {
"model": "toughasnails:block/thermoregulator_inactive"
},
"cooling=true,heating=false": {
"model": "toughasnails:block/thermoregulator_cooling_active"
},
"cooling=false,heating=true": {
"model": "toughasnails:block/thermoregulator_heating_active"
},
"cooling=true,heating=true": {
"model": "toughasnails:block/thermoregulator_active"
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parent": "block/block",
"textures": {
"particle": "toughasnails:block/thermoregulator_side_active",
"side": "toughasnails:block/thermoregulator_side_active",
"top": "toughasnails:block/thermoregulator_top_active",
"bottom": "minecraft:block/blast_furnace_top"
},
"elements": [
{
"from": [0, 16, 0],
"to": [8, 16, 16],
"faces": {
"up": {"uv": [0, 0, 8, 16], "texture": "#top"}
}
},
{
"from": [8, 16, 0],
"to": [16, 16, 16],
"faces": {
"up": {"uv": [8, 0, 16, 16], "texture": "#top"}
}
},
{
"from": [0, 8, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 8], "texture": "#side"},
"east": {"uv": [0, 0, 16, 8], "texture": "#side"},
"south": {"uv": [0, 0, 16, 8], "texture": "#side"},
"west": {"uv": [0, 0, 16, 8], "texture": "#side"}
}
},
{
"from": [0, 0, 0],
"to": [16, 8, 16],
"faces": {
"north": {"uv": [0, 8, 16, 16], "texture": "#side"},
"east": {"uv": [0, 8, 16, 16], "texture": "#side"},
"south": {"uv": [0, 8, 16, 16], "texture": "#side"},
"west": {"uv": [0, 8, 16, 16], "texture": "#side"},
"down": {"uv": [0, 0, 16, 16], "texture": "#bottom"}
}
}
]
}
Loading

0 comments on commit 48d73eb

Please sign in to comment.