Skip to content

Commit

Permalink
Add feature to fill and empty non-fluid handlers
Browse files Browse the repository at this point in the history
Uses JSON to add "recipes" for filling and emptying. In the future, might also add potions using this feature
  • Loading branch information
KnightMiner committed Apr 24, 2022
1 parent 0267d22 commit 39d607a
Show file tree
Hide file tree
Showing 62 changed files with 1,095 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#tconstruct:beetroot_soup"
]
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/forge/tags/fluids/honey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#tconstruct:honey"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#tconstruct:mushroom_stew"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#tconstruct:rabbit_stew"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "tconstruct:casting_basin",
"fluid": {
"tag": "forge:honey",
"amount": 1000
},
"result": "minecraft:honey_block",
"cooling_time": 94
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "tconstruct:casting_table",
"cast": {
"item": "minecraft:glass_bottle"
},
"cast_consumed": true,
"fluid": {
"tag": "forge:honey",
"amount": 250
},
"result": "minecraft:honey_bottle",
"cooling_time": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "tconstruct:casting_table",
"fluid": {
"tag": "forge:beetroot_soup",
"amount": 250
},
"result": "minecraft:beetroot_soup",
"cooling_time": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "tconstruct:casting_table",
"fluid": {
"tag": "forge:mushroom_stew",
"amount": 250
},
"result": "minecraft:mushroom_stew",
"cooling_time": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "tconstruct:casting_table",
"fluid": {
"tag": "forge:rabbit_stew",
"amount": 250
},
"result": "minecraft:rabbit_stew",
"cooling_time": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "tconstruct:melting",
"ingredient": {
"item": "minecraft:honey_block"
},
"result": {
"fluid": "tconstruct:honey",
"amount": 1000
},
"temperature": 1,
"time": 94
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "tconstruct:spilling",
"fluid": {
"tag": "forge:beetroot_soup",
"amount": 50
},
"effects": [
{
"type": "tconstruct:restore_hunger",
"hunger": 1,
"saturation": 1.5
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "tconstruct:spilling",
"fluid": {
"tag": "forge:honey",
"amount": 50
},
"effects": [
{
"type": "tconstruct:restore_hunger",
"hunger": 1,
"saturation": 0.2
},
{
"type": "tconstruct:remove_effect",
"effect": "minecraft:poison"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "tconstruct:spilling",
"fluid": {
"tag": "forge:mushroom_stew",
"amount": 50
},
"effects": [
{
"type": "tconstruct:restore_hunger",
"hunger": 1,
"saturation": 1.5
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "tconstruct:spilling",
"fluid": {
"tag": "forge:rabbit_stew",
"amount": 50
},
"effects": [
{
"type": "tconstruct:restore_hunger",
"hunger": 2,
"saturation": 2.4
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"tconstruct:beetroot_soup",
"tconstruct:flowing_beetroot_soup"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"tconstruct:honey",
"tconstruct:flowing_honey"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"tconstruct:mushroom_stew",
"tconstruct:flowing_mushroom_stew"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"tconstruct:rabbit_stew",
"tconstruct:flowing_rabbit_stew"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:empty_item",
"input": {
"item": "minecraft:beetroot_soup"
},
"filled": "minecraft:bowl",
"fluid": {
"fluid": "tconstruct:beetroot_soup",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:fill_item",
"input": {
"item": "minecraft:bowl"
},
"filled": "minecraft:beetroot_soup",
"fluid": {
"tag": "forge:beetroot_soup",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:empty_item",
"input": {
"item": "minecraft:honey_bottle"
},
"filled": "minecraft:glass_bottle",
"fluid": {
"fluid": "tconstruct:honey",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:fill_item",
"input": {
"item": "minecraft:glass_bottle"
},
"filled": "minecraft:honey_bottle",
"fluid": {
"tag": "forge:honey",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:empty_item",
"input": {
"item": "minecraft:mushroom_stew"
},
"filled": "minecraft:bowl",
"fluid": {
"fluid": "tconstruct:mushroom_stew",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:fill_item",
"input": {
"item": "minecraft:bowl"
},
"filled": "minecraft:mushroom_stew",
"fluid": {
"tag": "forge:mushroom_stew",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:empty_item",
"input": {
"item": "minecraft:rabbit_stew"
},
"filled": "minecraft:bowl",
"fluid": {
"fluid": "tconstruct:rabbit_stew",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:fill_item",
"input": {
"item": "minecraft:bowl"
},
"filled": "minecraft:rabbit_stew",
"fluid": {
"tag": "forge:rabbit_stew",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "tconstruct:empty_item",
"input": {
"type": "forge:partial_nbt",
"items": [
"minecraft:lingering_potion",
"minecraft:potion",
"minecraft:splash_potion"
],
"nbt": "{Potion:\"minecraft:water\"}"
},
"filled": "minecraft:glass_bottle",
"fluid": {
"fluid": "minecraft:water",
"amount": 250
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "tconstruct:fill_item",
"input": {
"item": "minecraft:glass_bottle"
},
"filled": {
"item": "minecraft:potion",
"nbt": "{Potion:\"minecraft:water\"}"
},
"fluid": {
"tag": "minecraft:water",
"amount": 500
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public void addTags() {
// mekanism compat alloys
tagAll(TinkerFluids.moltenRefinedGlowstone);
tagAll(TinkerFluids.moltenRefinedObsidian);
// unplacable fluids
tagAll(TinkerFluids.honey);
tagAll(TinkerFluids.beetrootSoup);
tagAll(TinkerFluids.mushroomStew);
tagAll(TinkerFluids.rabbitStew);

/* Normal tags */
this.tag(TinkerTags.Fluids.SLIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraftforge.network.PacketDistributor;
import slimeknights.mantle.network.NetworkWrapper;
import slimeknights.tconstruct.TConstruct;
import slimeknights.tconstruct.library.fluid.transfer.FluidContainerTransferPacket;
import slimeknights.tconstruct.library.materials.definition.UpdateMaterialsPacket;
import slimeknights.tconstruct.library.materials.stats.UpdateMaterialStatsPacket;
import slimeknights.tconstruct.library.materials.traits.UpdateMaterialTraitsPacket;
Expand Down Expand Up @@ -99,6 +100,7 @@ public static void setup() {
instance.registerPacket(StructureUpdatePacket.class, StructureUpdatePacket::new, NetworkDirection.PLAY_TO_CLIENT);
instance.registerPacket(SmelteryFluidClickedPacket.class, SmelteryFluidClickedPacket::new, NetworkDirection.PLAY_TO_SERVER);
instance.registerPacket(StructureErrorPositionPacket.class, StructureErrorPositionPacket::new, NetworkDirection.PLAY_TO_CLIENT);
instance.registerPacket(FluidContainerTransferPacket.class, FluidContainerTransferPacket::new, NetworkDirection.PLAY_TO_CLIENT);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class FluidClientEvents extends ClientEventBase {
@SubscribeEvent
static void clientSetup(final FMLClientSetupEvent event) {
setTranslucent(TinkerFluids.honey);
// slime
setTranslucent(TinkerFluids.earthSlime);
setTranslucent(TinkerFluids.skySlime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public TinkerFluids() {
slime.put(SlimeType.BLOOD, blood);
}

// foods
public static FluidObject<ForgeFlowingFluid> honey = FLUIDS.register("honey", coolBuilder().temperature(301), Material.WATER, 0);
public static FluidObject<ForgeFlowingFluid> beetrootSoup = FLUIDS.register("beetroot_soup", coolBuilder().temperature(400), Material.WATER, 0);
public static FluidObject<ForgeFlowingFluid> mushroomStew = FLUIDS.register("mushroom_stew", coolBuilder().temperature(400), Material.WATER, 0);
public static FluidObject<ForgeFlowingFluid> rabbitStew = FLUIDS.register("rabbit_stew", coolBuilder().temperature(400), Material.WATER, 0);

// base molten fluids
public static final FluidObject<ForgeFlowingFluid> searedStone = FLUIDS.register("seared_stone", hotBuilder().temperature( 900), Material.LAVA, 6);
public static final FluidObject<ForgeFlowingFluid> scorchedStone = FLUIDS.register("scorched_stone", hotBuilder().temperature( 800), Material.LAVA, 4);
Expand Down

0 comments on commit 39d607a

Please sign in to comment.