mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Merge branch 'mc1.20.1/feature-dev' into mc1.21.1/dev
# Conflicts: # build.gradle # gradle.properties # src/generated/resources/.cache/3055aa55530438925fbff1670d3e8dc6cc209bf3 # src/generated/resources/data/create/recipe/milling/cactus.json # src/generated/resources/data/create/tags/block/sugar_cane_variants.json # src/generated/resources/data/minecraft/tags/block/combination_step_sound_blocks.json # src/generated/resources/data/minecraft/tags/block/inside_step_sound_blocks.json # src/main/java/com/simibubi/create/AllBlocks.java # src/main/java/com/simibubi/create/api/equipment/goggles/IHaveGoggleInformation.java # src/main/java/com/simibubi/create/compat/Mods.java # src/main/java/com/simibubi/create/compat/jei/CreateJEI.java # src/main/java/com/simibubi/create/compat/jei/category/BasinCategory.java # src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java # src/main/java/com/simibubi/create/compat/jei/category/ItemDrainCategory.java # src/main/java/com/simibubi/create/compat/jei/category/SpoutCategory.java # src/main/java/com/simibubi/create/compat/jei/category/sequencedAssembly/SequencedAssemblySubCategory.java # src/main/java/com/simibubi/create/content/equipment/armor/BacktankBlock.java # src/main/java/com/simibubi/create/content/equipment/armor/BacktankBlockEntity.java # src/main/java/com/simibubi/create/content/equipment/goggles/GoggleOverlayRenderer.java # src/main/java/com/simibubi/create/content/equipment/tool/CardboardSwordItem.java # src/main/java/com/simibubi/create/content/equipment/toolbox/ToolboxBlock.java # src/main/java/com/simibubi/create/content/fluids/drain/ItemDrainBlockEntity.java # src/main/java/com/simibubi/create/content/fluids/potion/PotionFluid.java # src/main/java/com/simibubi/create/content/fluids/potion/PotionFluidHandler.java # src/main/java/com/simibubi/create/content/fluids/spout/SpoutBlockEntity.java # src/main/java/com/simibubi/create/content/fluids/tank/FluidTankBlockEntity.java # src/main/java/com/simibubi/create/content/kinetics/base/KineticBlockEntity.java # src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerBlockEntity.java # src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerHandler.java # src/main/java/com/simibubi/create/content/kinetics/mechanicalArm/AllArmInteractionPointTypes.java # src/main/java/com/simibubi/create/content/kinetics/steamEngine/SteamEngineBlockEntity.java # src/main/java/com/simibubi/create/content/kinetics/waterwheel/WaterWheelStructuralBlock.java # src/main/java/com/simibubi/create/content/logistics/chute/ChuteBlockEntity.java # src/main/java/com/simibubi/create/content/logistics/filter/FilterItemStack.java # src/main/java/com/simibubi/create/content/logistics/funnel/FunnelBlockEntity.java # src/main/java/com/simibubi/create/content/logistics/packagePort/frogport/FrogportBlockEntity.java # src/main/java/com/simibubi/create/content/logistics/stockTicker/StockTickerBlockEntity.java # src/main/java/com/simibubi/create/content/logistics/tunnel/BrassTunnelBlockEntity.java # src/main/java/com/simibubi/create/content/logistics/vault/ItemVaultBlock.java # src/main/java/com/simibubi/create/content/processing/basin/BasinBlockEntity.java # src/main/java/com/simibubi/create/content/processing/burner/BlockBasedTrainConductorInteractionBehaviour.java # src/main/java/com/simibubi/create/content/redstone/link/controller/LecternControllerBlockEntity.java # src/main/java/com/simibubi/create/content/trains/track/AllPortalTracks.java # src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java # src/main/java/com/simibubi/create/foundation/item/ItemHelper.java # src/main/java/com/simibubi/create/foundation/utility/DyeHelper.java # src/main/java/com/simibubi/create/infrastructure/debugInfo/ServerDebugInfoPacket.java # src/main/resources/META-INF/mods.toml
This commit is contained in:
commit
667a252f4e
95 changed files with 3102 additions and 2736 deletions
19
build.gradle
19
build.gradle
|
@ -114,9 +114,8 @@ configurations {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = "https://maven.createmod.net" } // Ponder
|
maven { url = "https://maven.createmod.net" } // Ponder, Flywheel
|
||||||
maven { url = "https://maven.tterrag.com" } // Flywheel
|
maven { url = "https://mvn.devos.one/snapshots" } // Registrate
|
||||||
maven { url = "https://maven.ithundxr.dev/snapshots" } // Registrate
|
|
||||||
maven { url = "https://maven.blamejared.com" } // JEI, Vazkii's Mods
|
maven { url = "https://maven.blamejared.com" } // JEI, Vazkii's Mods
|
||||||
maven { url = "https://harleyoconnor.com/maven" } // Dynamic Trees
|
maven { url = "https://harleyoconnor.com/maven" } // Dynamic Trees
|
||||||
maven { url = "https://maven.theillusivec4.top/" } // Curios API
|
maven { url = "https://maven.theillusivec4.top/" } // Curios API
|
||||||
|
@ -132,16 +131,20 @@ repositories {
|
||||||
includeGroup "mysticdrew"
|
includeGroup "mysticdrew"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo - temp
|
|
||||||
maven { url = "https://maven.ithundxr.dev/hidden" } // Flywheel 1.21 PR
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
jarJar(implementation("com.tterrag.registrate:Registrate:${registrate_version}"))
|
jarJar(implementation("com.tterrag.registrate:Registrate:${registrate_version}"))
|
||||||
|
|
||||||
compileOnly("dev.engine_room.flywheel:flywheel-neoforge-api-${flywheel_minecraft_version}:${flywheel_version}")
|
jarJar("dev.engine-room.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
||||||
jarJar(runtimeOnly("dev.engine_room.flywheel:flywheel-neoforge-${flywheel_minecraft_version}:${flywheel_version}"))
|
version {
|
||||||
|
strictly "[1.0,2.0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOnly("dev.engine-room.flywheel:flywheel-neoforge-api-${flywheel_minecraft_version}:${flywheel_version}")
|
||||||
|
runtimeOnly("dev.engine-room.flywheel:flywheel-neoforge-${flywheel_minecraft_version}:${flywheel_version}")
|
||||||
|
runtimeOnly("dev.engine-room.vanillin:vanillin-neoforge-${flywheel_minecraft_version}:${flywheel_version}")
|
||||||
|
|
||||||
if (ponderInWorkspace) {
|
if (ponderInWorkspace) {
|
||||||
implementation(project(":ponder:Common"))
|
implementation(project(":ponder:Common"))
|
||||||
|
|
|
@ -23,17 +23,15 @@ parchment_version = 2024.11.17
|
||||||
# From maven.ithundxr.dev/snapshots
|
# From maven.ithundxr.dev/snapshots
|
||||||
registrate_version = MC1.21-1.3.0+61
|
registrate_version = MC1.21-1.3.0+61
|
||||||
|
|
||||||
# From maven.ithundxr.dev/hidden
|
|
||||||
flywheel_minecraft_version = 1.21.1
|
|
||||||
flywheel_version = 1.0.0-beta-fork.16
|
|
||||||
flywheel_version_range = [1.0.0-alpha,2.0)
|
|
||||||
|
|
||||||
# Dependency Versions
|
# Dependency Versions
|
||||||
jei_minecraft_version = 1.21
|
flywheel_minecraft_version = 1.21.1
|
||||||
jei_version = 19.5.0.33
|
flywheel_version = 1.0.0-beta-1
|
||||||
|
flywheel_version_range = [1.0.0-alpha,2.0)
|
||||||
|
ponder_version = 1.0.26
|
||||||
|
jei_minecraft_version = 1.21.1
|
||||||
|
jei_version = 19.21.0.247
|
||||||
curios_minecraft_version = 1.21.1
|
curios_minecraft_version = 1.21.1
|
||||||
curios_version = 9.2.2
|
curios_version = 9.2.2
|
||||||
ponder_version = 1.0.24
|
|
||||||
|
|
||||||
cc_tweaked_enable = true
|
cc_tweaked_enable = true
|
||||||
cc_tweaked_minecraft_version = 1.21.1
|
cc_tweaked_minecraft_version = 1.21.1
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,4 @@
|
||||||
{
|
{
|
||||||
"neoforge:conditions": [
|
|
||||||
{
|
|
||||||
"type": "neoforge:not",
|
|
||||||
"value": {
|
|
||||||
"type": "neoforge:mod_loaded",
|
|
||||||
"modid": "quark"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "create:milling",
|
"type": "create:milling",
|
||||||
"ingredients": [
|
"ingredients": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item": "minecraft:dirt"
|
"item": "minecraft:dirt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item": "minecraft:coarse_dirt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item": "minecraft:rooted_dirt"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"minecraft:sugar_cane"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"create:white_table_cloth",
|
||||||
|
"create:orange_table_cloth",
|
||||||
|
"create:magenta_table_cloth",
|
||||||
|
"create:light_blue_table_cloth",
|
||||||
|
"create:yellow_table_cloth",
|
||||||
|
"create:lime_table_cloth",
|
||||||
|
"create:pink_table_cloth",
|
||||||
|
"create:gray_table_cloth",
|
||||||
|
"create:light_gray_table_cloth",
|
||||||
|
"create:cyan_table_cloth",
|
||||||
|
"create:purple_table_cloth",
|
||||||
|
"create:blue_table_cloth",
|
||||||
|
"create:brown_table_cloth",
|
||||||
|
"create:green_table_cloth",
|
||||||
|
"create:red_table_cloth",
|
||||||
|
"create:black_table_cloth"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"create:andesite_table_cloth",
|
||||||
|
"create:brass_table_cloth",
|
||||||
|
"create:copper_table_cloth"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,5 +1,21 @@
|
||||||
{
|
{
|
||||||
"values": [
|
"values": [
|
||||||
|
"create:copper_shingle_slab",
|
||||||
|
"create:exposed_copper_shingle_slab",
|
||||||
|
"create:weathered_copper_shingle_slab",
|
||||||
|
"create:oxidized_copper_shingle_slab",
|
||||||
|
"create:waxed_copper_shingle_slab",
|
||||||
|
"create:waxed_exposed_copper_shingle_slab",
|
||||||
|
"create:waxed_weathered_copper_shingle_slab",
|
||||||
|
"create:waxed_oxidized_copper_shingle_slab",
|
||||||
|
"create:copper_tile_slab",
|
||||||
|
"create:exposed_copper_tile_slab",
|
||||||
|
"create:weathered_copper_tile_slab",
|
||||||
|
"create:oxidized_copper_tile_slab",
|
||||||
|
"create:waxed_copper_tile_slab",
|
||||||
|
"create:waxed_exposed_copper_tile_slab",
|
||||||
|
"create:waxed_weathered_copper_tile_slab",
|
||||||
|
"create:waxed_oxidized_copper_tile_slab",
|
||||||
"create:cut_granite_slab",
|
"create:cut_granite_slab",
|
||||||
"create:polished_cut_granite_slab",
|
"create:polished_cut_granite_slab",
|
||||||
"create:cut_granite_brick_slab",
|
"create:cut_granite_brick_slab",
|
||||||
|
|
|
@ -1,5 +1,21 @@
|
||||||
{
|
{
|
||||||
"values": [
|
"values": [
|
||||||
|
"create:copper_shingle_stairs",
|
||||||
|
"create:exposed_copper_shingle_stairs",
|
||||||
|
"create:weathered_copper_shingle_stairs",
|
||||||
|
"create:oxidized_copper_shingle_stairs",
|
||||||
|
"create:waxed_copper_shingle_stairs",
|
||||||
|
"create:waxed_exposed_copper_shingle_stairs",
|
||||||
|
"create:waxed_weathered_copper_shingle_stairs",
|
||||||
|
"create:waxed_oxidized_copper_shingle_stairs",
|
||||||
|
"create:copper_tile_stairs",
|
||||||
|
"create:exposed_copper_tile_stairs",
|
||||||
|
"create:weathered_copper_tile_stairs",
|
||||||
|
"create:oxidized_copper_tile_stairs",
|
||||||
|
"create:waxed_copper_tile_stairs",
|
||||||
|
"create:waxed_exposed_copper_tile_stairs",
|
||||||
|
"create:waxed_weathered_copper_tile_stairs",
|
||||||
|
"create:waxed_oxidized_copper_tile_stairs",
|
||||||
"create:cut_granite_stairs",
|
"create:cut_granite_stairs",
|
||||||
"create:polished_cut_granite_stairs",
|
"create:polished_cut_granite_stairs",
|
||||||
"create:cut_granite_brick_stairs",
|
"create:cut_granite_brick_stairs",
|
||||||
|
|
|
@ -17,6 +17,7 @@ import static com.simibubi.create.foundation.data.TagGen.tagBlockAndItem;
|
||||||
|
|
||||||
import com.simibubi.create.AllTags.AllBlockTags;
|
import com.simibubi.create.AllTags.AllBlockTags;
|
||||||
import com.simibubi.create.AllTags.AllItemTags;
|
import com.simibubi.create.AllTags.AllItemTags;
|
||||||
|
import com.simibubi.create.api.contraption.train.TrainConductorHandler;
|
||||||
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsBlock;
|
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsBlock;
|
||||||
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsMovement;
|
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsMovement;
|
||||||
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsMovingInteraction;
|
import com.simibubi.create.content.contraptions.actors.contraptionControls.ContraptionControlsMovingInteraction;
|
||||||
|
@ -209,7 +210,6 @@ import com.simibubi.create.content.processing.basin.BasinGenerator;
|
||||||
import com.simibubi.create.content.processing.basin.BasinMovementBehaviour;
|
import com.simibubi.create.content.processing.basin.BasinMovementBehaviour;
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
|
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerBlockItem;
|
import com.simibubi.create.content.processing.burner.BlazeBurnerBlockItem;
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerInteractionBehaviour;
|
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerMovementBehaviour;
|
import com.simibubi.create.content.processing.burner.BlazeBurnerMovementBehaviour;
|
||||||
import com.simibubi.create.content.processing.burner.LitBlazeBurnerBlock;
|
import com.simibubi.create.content.processing.burner.LitBlazeBurnerBlock;
|
||||||
import com.simibubi.create.content.redstone.RoseQuartzLampBlock;
|
import com.simibubi.create.content.redstone.RoseQuartzLampBlock;
|
||||||
|
@ -362,7 +362,7 @@ public class AllBlocks {
|
||||||
.when(survivesExplosion)
|
.when(survivesExplosion)
|
||||||
.setRolls(ConstantValue.exactly(1))
|
.setRolls(ConstantValue.exactly(1))
|
||||||
.add(LootItem.lootTableItem(AllBlocks.SCHEMATICANNON.get()
|
.add(LootItem.lootTableItem(AllBlocks.SCHEMATICANNON.get()
|
||||||
.asItem())
|
.asItem())
|
||||||
.apply(CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY)
|
.apply(CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY)
|
||||||
.include(AllDataComponents.SCHEMATICANNON_OPTIONS)))));
|
.include(AllDataComponents.SCHEMATICANNON_OPTIONS)))));
|
||||||
})
|
})
|
||||||
|
@ -772,7 +772,7 @@ public class AllBlocks {
|
||||||
.loot((lt, block) -> lt.add(block, BlazeBurnerBlock.buildLootTable()))
|
.loot((lt, block) -> lt.add(block, BlazeBurnerBlock.buildLootTable()))
|
||||||
.blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p)))
|
.blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p)))
|
||||||
.onRegister(movementBehaviour(new BlazeBurnerMovementBehaviour()))
|
.onRegister(movementBehaviour(new BlazeBurnerMovementBehaviour()))
|
||||||
.onRegister(interactionBehaviour(new BlazeBurnerInteractionBehaviour()))
|
.onRegister(block -> TrainConductorHandler.registerBlazeBurner())
|
||||||
.item(BlazeBurnerBlockItem::withBlaze)
|
.item(BlazeBurnerBlockItem::withBlaze)
|
||||||
.model(AssetLookup.customBlockItemModel("blaze_burner", "block_with_blaze"))
|
.model(AssetLookup.customBlockItemModel("blaze_burner", "block_with_blaze"))
|
||||||
.build()
|
.build()
|
||||||
|
@ -793,8 +793,8 @@ public class AllBlocks {
|
||||||
.modelFile(p.models()
|
.modelFile(p.models()
|
||||||
.getExistingFile(p.modLoc("block/blaze_burner/"
|
.getExistingFile(p.modLoc("block/blaze_burner/"
|
||||||
+ (state.getValue(LitBlazeBurnerBlock.FLAME_TYPE) == LitBlazeBurnerBlock.FlameType.SOUL
|
+ (state.getValue(LitBlazeBurnerBlock.FLAME_TYPE) == LitBlazeBurnerBlock.FlameType.SOUL
|
||||||
? "block_with_soul_fire"
|
? "block_with_soul_fire"
|
||||||
: "block_with_fire"))))
|
: "block_with_fire"))))
|
||||||
.build()))
|
.build()))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
|
@ -2702,10 +2702,10 @@ public class AllBlocks {
|
||||||
|
|
||||||
public static final CopperBlockSet COPPER_SHINGLES = new CopperBlockSet(REGISTRATE, "copper_shingles",
|
public static final CopperBlockSet COPPER_SHINGLES = new CopperBlockSet(REGISTRATE, "copper_shingles",
|
||||||
"copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
|
"copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
|
||||||
p.stonecutting(DataIngredient.tag(Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
|
p.stonecutting(DataIngredient.tag(Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
|
||||||
c::get, 2);
|
c::get, 2);
|
||||||
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_SHINGLES.get(ws)))
|
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_SHINGLES.get(ws)))
|
||||||
.accept(block));
|
.accept(block));
|
||||||
|
|
||||||
public static final CopperBlockSet COPPER_TILES =
|
public static final CopperBlockSet COPPER_TILES =
|
||||||
new CopperBlockSet(REGISTRATE, "copper_tiles", "copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
|
new CopperBlockSet(REGISTRATE, "copper_tiles", "copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
|
||||||
|
@ -2716,6 +2716,7 @@ public class AllBlocks {
|
||||||
|
|
||||||
// Load this class
|
// Load this class
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,14 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.fluids.VirtualFluid;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
|
|
||||||
import com.mojang.blaze3d.shaders.FogShape;
|
import com.mojang.blaze3d.shaders.FogShape;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.simibubi.create.content.decoration.palettes.AllPaletteStoneTypes;
|
import com.simibubi.create.content.decoration.palettes.AllPaletteStoneTypes;
|
||||||
import com.simibubi.create.content.fluids.VirtualFluid;
|
|
||||||
import com.simibubi.create.content.fluids.potion.PotionFluid;
|
import com.simibubi.create.content.fluids.potion.PotionFluid;
|
||||||
import com.simibubi.create.content.fluids.potion.PotionFluid.PotionFluidType;
|
import com.simibubi.create.content.fluids.potion.PotionFluid.PotionFluidType;
|
||||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
|
@ -46,7 +47,7 @@ public class AllFluids {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final FluidEntry<PotionFluid> POTION =
|
public static final FluidEntry<PotionFluid> POTION =
|
||||||
REGISTRATE.virtualFluid("potion", PotionFluidType::new, PotionFluid::new)
|
REGISTRATE.virtualFluid("potion", PotionFluidType::new, PotionFluid::createSource, PotionFluid::createFlowing)
|
||||||
.lang("Potion")
|
.lang("Potion")
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ public class AllTags {
|
||||||
SIMPLE_MOUNTED_STORAGE,
|
SIMPLE_MOUNTED_STORAGE,
|
||||||
FALLBACK_MOUNTED_STORAGE_BLACKLIST,
|
FALLBACK_MOUNTED_STORAGE_BLACKLIST,
|
||||||
ROOTS,
|
ROOTS,
|
||||||
|
SUGAR_CANE_VARIANTS,
|
||||||
|
|
||||||
CORALS,
|
CORALS,
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.simibubi.create.api.contraption.train;
|
||||||
|
|
||||||
|
import com.simibubi.create.AllBlocks;
|
||||||
|
import com.simibubi.create.AllInteractionBehaviours;
|
||||||
|
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.processing.burner.BlockBasedTrainConductorInteractionBehaviour;
|
||||||
|
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All required methods to make your block a train conductor similar to the blaze burner
|
||||||
|
*/
|
||||||
|
public interface TrainConductorHandler {
|
||||||
|
|
||||||
|
@ApiStatus.Internal
|
||||||
|
List<TrainConductorHandler> CONDUCTOR_HANDLERS = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
boolean isValidConductor(BlockState state);
|
||||||
|
|
||||||
|
private static void registerHandler(TrainConductorHandler handler) {
|
||||||
|
CONDUCTOR_HANDLERS.add(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void registerConductor(ResourceLocation blockRl, Predicate<BlockState> isValidConductor, UpdateScheduleCallback updateScheduleCallback) {
|
||||||
|
AllInteractionBehaviours.registerBehaviour(blockRl, new BlockBasedTrainConductorInteractionBehaviour(isValidConductor, updateScheduleCallback));
|
||||||
|
registerHandler(isValidConductor::test);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiStatus.Internal
|
||||||
|
static void registerBlazeBurner() {
|
||||||
|
registerConductor(AllBlocks.BLAZE_BURNER.getId(), blockState -> AllBlocks.BLAZE_BURNER.has(blockState)
|
||||||
|
&& blockState.getValue(BlazeBurnerBlock.HEAT_LEVEL) != BlazeBurnerBlock.HeatLevel.NONE, UpdateScheduleCallback.EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UpdateScheduleCallback {
|
||||||
|
|
||||||
|
UpdateScheduleCallback EMPTY = (hasSchedule, blockState, blockStateSetter) -> {};
|
||||||
|
|
||||||
|
void update(boolean hasSchedule, BlockState currentBlockState, Consumer<BlockState> blockStateSetter);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.content.equipment.goggles;
|
package com.simibubi.create.api.equipment.goggles;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
|
|
||||||
|
@ -7,8 +7,9 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
||||||
public sealed interface IHaveCustomOverlayIcon permits IHaveGoggleInformation, IHaveHoveringInformation {
|
public sealed interface IHaveCustomOverlayIcon permits IHaveGoggleInformation, IHaveHoveringInformation {
|
||||||
/**
|
/**
|
||||||
* This method will be called when looking at a {@link BlockEntity} that implements this interface
|
* This method will be called when looking at a {@link BlockEntity} that implements {@link IHaveGoggleInformation}
|
||||||
* <p>
|
* or {@link IHaveHoveringInformation}
|
||||||
|
*
|
||||||
* @return The {@link ItemStack} you want the overlay to show instead of the goggles
|
* @return The {@link ItemStack} you want the overlay to show instead of the goggles
|
||||||
*/
|
*/
|
||||||
default ItemStack getIcon(boolean isPlayerSneaking) {
|
default ItemStack getIcon(boolean isPlayerSneaking) {
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.content.equipment.goggles;
|
package com.simibubi.create.api.equipment.goggles;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -9,6 +9,7 @@ import net.createmod.catnip.lang.LangBuilder;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||||
|
|
||||||
|
@ -20,14 +21,14 @@ public non-sealed interface IHaveGoggleInformation extends IHaveCustomOverlayIco
|
||||||
* This method will be called when looking at a {@link BlockEntity} that implements this interface
|
* This method will be called when looking at a {@link BlockEntity} that implements this interface
|
||||||
*
|
*
|
||||||
* @return {@code true} if the tooltip creation was successful and should be
|
* @return {@code true} if the tooltip creation was successful and should be
|
||||||
* displayed, or {@code false} if the overlay should not be displayed
|
* displayed, or {@code false} if the overlay should not be displayed
|
||||||
*/
|
*/
|
||||||
default boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
default boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean containedFluidTooltip(List<Component> tooltip, boolean isPlayerSneaking,
|
default boolean containedFluidTooltip(List<Component> tooltip, boolean isPlayerSneaking,
|
||||||
IFluidHandler handler) {
|
IFluidHandler handler) {
|
||||||
if (handler == null)
|
if (handler == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.content.equipment.goggles;
|
package com.simibubi.create.api.equipment.goggles;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -6,14 +6,14 @@ import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this interface on the {@link BlockEntity} that wants to add info to the goggle overlay
|
* Implement this interface on the {@link BlockEntity} that wants to add info to the hovering overlay
|
||||||
*/
|
*/
|
||||||
public non-sealed interface IHaveHoveringInformation extends IHaveCustomOverlayIcon{
|
public non-sealed interface IHaveHoveringInformation extends IHaveCustomOverlayIcon {
|
||||||
/**
|
/**
|
||||||
* This method will be called when looking at a {@link BlockEntity} that implements this interface
|
* This method will be called when looking at a {@link BlockEntity} that implements this interface
|
||||||
*
|
*
|
||||||
* @return {@code true} if the tooltip creation was successful and should be
|
* @return {@code true} if the tooltip creation was successful and should be
|
||||||
* displayed, or {@code false} if the overlay should not be displayed
|
* displayed, or {@code false} if the overlay should not be displayed
|
||||||
*/
|
*/
|
||||||
default boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
default boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||||
return false;
|
return false;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.simibubi.create.content.equipment.goggles;
|
package com.simibubi.create.api.equipment.goggles;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -6,7 +6,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement this interface on the {@link BlockEntity} that wants to add info to the goggle overlay
|
* Implement this interface on the {@link BlockEntity} that wants proxy the information
|
||||||
*/
|
*/
|
||||||
public interface IProxyHoveringInformation {
|
public interface IProxyHoveringInformation {
|
||||||
BlockPos getInformationSource(Level level, BlockPos pos, BlockState state);
|
BlockPos getInformationSource(Level level, BlockPos pos, BlockState state);
|
|
@ -19,6 +19,7 @@ import net.neoforged.fml.ModList;
|
||||||
public enum Mods {
|
public enum Mods {
|
||||||
AETHER,
|
AETHER,
|
||||||
AETHER_II,
|
AETHER_II,
|
||||||
|
BETTEREND,
|
||||||
COMPUTERCRAFT,
|
COMPUTERCRAFT,
|
||||||
CONNECTIVITY,
|
CONNECTIVITY,
|
||||||
CURIOS,
|
CURIOS,
|
||||||
|
|
|
@ -36,6 +36,7 @@ public class DisplayLinkPeripheral extends SyncedPeripheral<DisplayLinkBlockEnti
|
||||||
|
|
||||||
@LuaFunction(mainThread = true)
|
@LuaFunction(mainThread = true)
|
||||||
public final Object[] getSize() {
|
public final Object[] getSize() {
|
||||||
|
blockEntity.updateGatheredData();
|
||||||
DisplayTargetStats stats = blockEntity.activeTarget.provideStats(new DisplayLinkContext(blockEntity.getLevel(), blockEntity));
|
DisplayTargetStats stats = blockEntity.activeTarget.provideStats(new DisplayLinkContext(blockEntity.getLevel(), blockEntity));
|
||||||
return new Object[]{stats.maxRows(), stats.maxColumns()};
|
return new Object[]{stats.maxRows(), stats.maxColumns()};
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ import com.simibubi.create.content.kinetics.fan.processing.SplashingRecipe;
|
||||||
import com.simibubi.create.content.kinetics.press.MechanicalPressBlockEntity;
|
import com.simibubi.create.content.kinetics.press.MechanicalPressBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.press.PressingRecipe;
|
import com.simibubi.create.content.kinetics.press.PressingRecipe;
|
||||||
import com.simibubi.create.content.kinetics.saw.CuttingRecipe;
|
import com.simibubi.create.content.kinetics.saw.CuttingRecipe;
|
||||||
import com.simibubi.create.content.kinetics.saw.SawBlockEntity;
|
|
||||||
import com.simibubi.create.content.logistics.filter.AbstractFilterScreen;
|
import com.simibubi.create.content.logistics.filter.AbstractFilterScreen;
|
||||||
import com.simibubi.create.content.logistics.redstoneRequester.RedstoneRequesterScreen;
|
import com.simibubi.create.content.logistics.redstoneRequester.RedstoneRequesterScreen;
|
||||||
import com.simibubi.create.content.processing.basin.BasinRecipe;
|
import com.simibubi.create.content.processing.basin.BasinRecipe;
|
||||||
|
@ -78,6 +77,7 @@ import mezz.jei.api.gui.drawable.IDrawable;
|
||||||
import mezz.jei.api.helpers.IPlatformFluidHelper;
|
import mezz.jei.api.helpers.IPlatformFluidHelper;
|
||||||
import mezz.jei.api.neoforge.NeoForgeTypes;
|
import mezz.jei.api.neoforge.NeoForgeTypes;
|
||||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||||
|
import mezz.jei.api.registration.IExtraIngredientRegistration;
|
||||||
import mezz.jei.api.registration.IGuiHandlerRegistration;
|
import mezz.jei.api.registration.IGuiHandlerRegistration;
|
||||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||||
|
@ -87,10 +87,14 @@ import mezz.jei.api.registration.ISubtypeRegistration;
|
||||||
import mezz.jei.api.runtime.IIngredientManager;
|
import mezz.jei.api.runtime.IIngredientManager;
|
||||||
import net.createmod.catnip.config.ConfigBase.ConfigBool;
|
import net.createmod.catnip.config.ConfigBase.ConfigBool;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.core.Holder.Reference;
|
||||||
import net.minecraft.core.RegistryAccess;
|
import net.minecraft.core.RegistryAccess;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.alchemy.Potion;
|
||||||
|
import net.minecraft.world.item.alchemy.PotionContents;
|
||||||
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
||||||
import net.minecraft.world.item.crafting.CraftingRecipe;
|
import net.minecraft.world.item.crafting.CraftingRecipe;
|
||||||
import net.minecraft.world.item.crafting.Recipe;
|
import net.minecraft.world.item.crafting.Recipe;
|
||||||
|
@ -101,7 +105,8 @@ import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||||
import net.minecraft.world.item.crafting.SmokingRecipe;
|
import net.minecraft.world.item.crafting.SmokingRecipe;
|
||||||
import net.minecraft.world.level.ItemLike;
|
import net.minecraft.world.level.ItemLike;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.neoforged.fml.ModList;
|
|
||||||
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
|
||||||
@JeiPlugin
|
@JeiPlugin
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -358,6 +363,25 @@ public class CreateJEI implements IModPlugin {
|
||||||
registration.registerSubtypeInterpreter(NeoForgeTypes.FLUID_STACK, potionFluid.getFlowing(), interpreter);
|
registration.registerSubtypeInterpreter(NeoForgeTypes.FLUID_STACK, potionFluid.getFlowing(), interpreter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerExtraIngredients(IExtraIngredientRegistration registration) {
|
||||||
|
RegistryAccess registryAccess = Minecraft.getInstance().level.registryAccess();
|
||||||
|
List<Reference<Potion>> potions = registryAccess.lookupOrThrow(Registries.POTION)
|
||||||
|
.listElements()
|
||||||
|
.toList();
|
||||||
|
Collection<FluidStack> potionFluids = new ArrayList<>(potions.size() * 3);
|
||||||
|
for (Reference<Potion> potion : potions) {
|
||||||
|
// @goshante: Ingame potion fluids always have Bottle tag that specifies
|
||||||
|
// to what bottle type this potion belongs
|
||||||
|
// Potion fluid without this tag wouldn't be recognized by other mods
|
||||||
|
for (PotionFluid.BottleType bottleType : PotionFluid.BottleType.values()) {
|
||||||
|
FluidStack potionFluid = PotionFluid.of(1000, new PotionContents(potion), bottleType);
|
||||||
|
potionFluids.add(potionFluid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
registration.addExtraIngredients(NeoForgeTypes.FLUID_STACK, potionFluids);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
@Override
|
@Override
|
||||||
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
|
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
|
||||||
|
|
|
@ -2,22 +2,25 @@ package com.simibubi.create.compat.jei;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.simibubi.create.AllDataComponents;
|
import com.simibubi.create.AllDataComponents;
|
||||||
import com.simibubi.create.content.fluids.potion.PotionFluid.BottleType;
|
import com.simibubi.create.content.fluids.potion.PotionFluid.BottleType;
|
||||||
|
|
||||||
import mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter;
|
import mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter;
|
||||||
import mezz.jei.api.ingredients.subtypes.UidContext;
|
import mezz.jei.api.ingredients.subtypes.UidContext;
|
||||||
import net.minecraft.core.component.DataComponents;
|
import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.world.effect.MobEffectInstance;
|
import net.minecraft.world.effect.MobEffectInstance;
|
||||||
import net.minecraft.world.item.alchemy.PotionContents;
|
import net.minecraft.world.item.alchemy.PotionContents;
|
||||||
|
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
|
||||||
/* From JEI's Potion item subtype interpreter */
|
/* From JEI's Potion item subtype interpreter */
|
||||||
public class PotionFluidSubtypeInterpreter implements IIngredientSubtypeInterpreter<FluidStack> {
|
public class PotionFluidSubtypeInterpreter implements ISubtypeInterpreter<FluidStack> {
|
||||||
@Override
|
@Override
|
||||||
public String apply(FluidStack ingredient, UidContext context) {
|
public @Nullable Object getSubtypeData(FluidStack ingredient, UidContext context) {
|
||||||
if (ingredient.getComponentsPatch().isEmpty())
|
if (ingredient.getComponentsPatch().isEmpty())
|
||||||
return IIngredientSubtypeInterpreter.NONE;
|
return null;
|
||||||
|
|
||||||
PotionContents contents = ingredient.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
|
PotionContents contents = ingredient.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
|
||||||
String potionTypeString = ingredient.getDescriptionId();
|
String potionTypeString = ingredient.getDescriptionId();
|
||||||
|
@ -31,11 +34,16 @@ public class PotionFluidSubtypeInterpreter implements IIngredientSubtypeInterpre
|
||||||
contents.potion().ifPresent(p -> {
|
contents.potion().ifPresent(p -> {
|
||||||
for (MobEffectInstance effect : p.value().getEffects())
|
for (MobEffectInstance effect : p.value().getEffects())
|
||||||
stringBuilder.append(";")
|
stringBuilder.append(";")
|
||||||
.append(effect);
|
.append(effect);
|
||||||
});
|
});
|
||||||
for (MobEffectInstance effect : effects)
|
for (MobEffectInstance effect : effects)
|
||||||
stringBuilder.append(";")
|
stringBuilder.append(";")
|
||||||
.append(effect);
|
.append(effect);
|
||||||
return stringBuilder.toString();
|
return stringBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLegacyStringSubtypeInfo(FluidStack ingredient, UidContext context) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,8 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
||||||
import mezz.jei.api.helpers.IJeiHelpers;
|
import mezz.jei.api.helpers.IJeiHelpers;
|
||||||
import mezz.jei.api.recipe.RecipeIngredientRole;
|
import mezz.jei.api.recipe.RecipeIngredientRole;
|
||||||
import mezz.jei.api.recipe.RecipeType;
|
|
||||||
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
|
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
|
||||||
import mezz.jei.api.recipe.transfer.IRecipeTransferHandler;
|
import mezz.jei.api.recipe.transfer.IUniversalRecipeTransferHandler;
|
||||||
import mezz.jei.common.transfer.RecipeTransferOperationsResult;
|
import mezz.jei.common.transfer.RecipeTransferOperationsResult;
|
||||||
import mezz.jei.common.transfer.RecipeTransferUtil;
|
import mezz.jei.common.transfer.RecipeTransferUtil;
|
||||||
import mezz.jei.library.transfer.RecipeTransferErrorMissingSlots;
|
import mezz.jei.library.transfer.RecipeTransferErrorMissingSlots;
|
||||||
|
@ -45,8 +44,7 @@ import net.neoforged.neoforge.items.ItemStackHandler;
|
||||||
|
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
@MethodsReturnNonnullByDefault
|
@MethodsReturnNonnullByDefault
|
||||||
public class StockKeeperTransferHandler implements IRecipeTransferHandler<StockKeeperRequestMenu, Object> {
|
public class StockKeeperTransferHandler implements IUniversalRecipeTransferHandler<StockKeeperRequestMenu> {
|
||||||
|
|
||||||
private IJeiHelpers helpers;
|
private IJeiHelpers helpers;
|
||||||
|
|
||||||
public StockKeeperTransferHandler(IJeiHelpers helpers) {
|
public StockKeeperTransferHandler(IJeiHelpers helpers) {
|
||||||
|
@ -63,11 +61,6 @@ public class StockKeeperTransferHandler implements IRecipeTransferHandler<StockK
|
||||||
return Optional.of(AllMenuTypes.STOCK_KEEPER_REQUEST.get());
|
return Optional.of(AllMenuTypes.STOCK_KEEPER_REQUEST.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public RecipeType<Object> getRecipeType() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable IRecipeTransferError transferRecipe(StockKeeperRequestMenu container, Object object,
|
public @Nullable IRecipeTransferError transferRecipe(StockKeeperRequestMenu container, Object object,
|
||||||
IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) {
|
IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) {
|
||||||
|
@ -137,5 +130,4 @@ public class StockKeeperTransferHandler implements IRecipeTransferHandler<StockK
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.INPUT, 17 + xOffset + (i % 3) * 19, 51 - (i / 3) * 19)
|
.addSlot(RecipeIngredientRole.INPUT, 17 + xOffset + (i % 3) * 19, 51 - (i / 3) * 19)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
.addIngredients(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
|
.addIngredients(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
|
||||||
.addTooltipCallback(addFluidTooltip(fluidIngredient.getRequiredAmount()));
|
.addRichTooltipCallback(addFluidTooltip(fluidIngredient.getRequiredAmount()));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
|
.addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
|
||||||
.setBackground(getRenderedSlot(result), -1, -1)
|
.setBackground(getRenderedSlot(result), -1, -1)
|
||||||
.addItemStack(result.getStack())
|
.addItemStack(result.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(result));
|
.addRichTooltipCallback(addStochasticTooltip(result));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
|
.addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
.addIngredient(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(fluidResult))
|
.addIngredient(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(fluidResult))
|
||||||
.addTooltipCallback(addFluidTooltip(fluidResult.getAmount()));
|
.addRichTooltipCallback(addFluidTooltip(fluidResult.getAmount()));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import com.simibubi.create.AllFluids;
|
import com.simibubi.create.AllFluids;
|
||||||
|
@ -18,7 +17,7 @@ import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
||||||
import mezz.jei.api.gui.drawable.IDrawable;
|
import mezz.jei.api.gui.drawable.IDrawable;
|
||||||
import mezz.jei.api.gui.ingredient.IRecipeSlotTooltipCallback;
|
import mezz.jei.api.gui.ingredient.IRecipeSlotRichTooltipCallback;
|
||||||
import mezz.jei.api.neoforge.NeoForgeTypes;
|
import mezz.jei.api.neoforge.NeoForgeTypes;
|
||||||
import mezz.jei.api.recipe.RecipeType;
|
import mezz.jei.api.recipe.RecipeType;
|
||||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||||
|
@ -110,11 +109,11 @@ public abstract class CreateRecipeCategory<T extends Recipe<?>> implements IReci
|
||||||
return recipe.getResultItem(level.registryAccess());
|
return recipe.getResultItem(level.registryAccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IRecipeSlotTooltipCallback addStochasticTooltip(ProcessingOutput output) {
|
public static IRecipeSlotRichTooltipCallback addStochasticTooltip(ProcessingOutput output) {
|
||||||
return (view, tooltip) -> {
|
return (view, tooltip) -> {
|
||||||
float chance = output.getChance();
|
float chance = output.getChance();
|
||||||
if (chance != 1)
|
if (chance != 1)
|
||||||
tooltip.add(1, CreateLang.translateDirect("recipe.processing.chance", chance < 0.01 ? "<1" : (int) (chance * 100))
|
tooltip.add(CreateLang.translateDirect("recipe.processing.chance", chance < 0.01 ? "<1" : (int) (chance * 100))
|
||||||
.withStyle(ChatFormatting.GOLD));
|
.withStyle(ChatFormatting.GOLD));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -132,11 +131,11 @@ public abstract class CreateRecipeCategory<T extends Recipe<?>> implements IReci
|
||||||
return display;
|
return display;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IRecipeSlotTooltipCallback addFluidTooltip() {
|
public static IRecipeSlotRichTooltipCallback addFluidTooltip() {
|
||||||
return addFluidTooltip(-1);
|
return addFluidTooltip(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IRecipeSlotTooltipCallback addFluidTooltip(int mbAmount) {
|
public static IRecipeSlotRichTooltipCallback addFluidTooltip(int mbAmount) {
|
||||||
return (view, tooltip) -> {
|
return (view, tooltip) -> {
|
||||||
Optional<FluidStack> displayed = view.getDisplayedIngredient(NeoForgeTypes.FLUID_STACK);
|
Optional<FluidStack> displayed = view.getDisplayedIngredient(NeoForgeTypes.FLUID_STACK);
|
||||||
if (displayed.isEmpty())
|
if (displayed.isEmpty())
|
||||||
|
@ -145,26 +144,14 @@ public abstract class CreateRecipeCategory<T extends Recipe<?>> implements IReci
|
||||||
FluidStack fluidStack = displayed.get();
|
FluidStack fluidStack = displayed.get();
|
||||||
|
|
||||||
if (fluidStack.getFluid().isSame(AllFluids.POTION.get())) {
|
if (fluidStack.getFluid().isSame(AllFluids.POTION.get())) {
|
||||||
Component name = fluidStack.getHoverName();
|
|
||||||
if (tooltip.isEmpty())
|
|
||||||
tooltip.add(0, name);
|
|
||||||
else
|
|
||||||
tooltip.set(0, name);
|
|
||||||
|
|
||||||
ArrayList<Component> potionTooltip = new ArrayList<>();
|
ArrayList<Component> potionTooltip = new ArrayList<>();
|
||||||
PotionFluidHandler.addPotionTooltip(fluidStack, potionTooltip, 1);
|
PotionFluidHandler.addPotionTooltip(fluidStack, potionTooltip, 1);
|
||||||
tooltip.addAll(1, potionTooltip.stream().toList());
|
tooltip.addAll(potionTooltip.stream().toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
int amount = mbAmount == -1 ? fluidStack.getAmount() : mbAmount;
|
int amount = mbAmount == -1 ? fluidStack.getAmount() : mbAmount;
|
||||||
Component text = Component.literal(String.valueOf(amount)).append(CreateLang.translateDirect("generic.unit.millibuckets")).withStyle(ChatFormatting.GOLD);
|
Component text = Component.literal(String.valueOf(amount)).append(CreateLang.translateDirect("generic.unit.millibuckets")).withStyle(ChatFormatting.GOLD);
|
||||||
if (tooltip.isEmpty())
|
tooltip.add(text);
|
||||||
tooltip.add(0, text);
|
|
||||||
else {
|
|
||||||
List<Component> siblings = tooltip.get(0).getSiblings();
|
|
||||||
siblings.add(Component.literal(" "));
|
|
||||||
siblings.add(text);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +174,9 @@ public abstract class CreateRecipeCategory<T extends Recipe<?>> implements IReci
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public record Info<T extends Recipe<?>>(RecipeType<T> recipeType, Component title, IDrawable background, IDrawable icon, Supplier<List<RecipeHolder<T>>> recipes, List<Supplier<? extends ItemStack>> catalysts) {
|
public record Info<T extends Recipe<?>>(RecipeType<T> recipeType, Component title, IDrawable background,
|
||||||
|
IDrawable icon, Supplier<List<RecipeHolder<T>>> recipes,
|
||||||
|
List<Supplier<? extends ItemStack>> catalysts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Factory<T extends Recipe<?>> {
|
public interface Factory<T extends Recipe<?>> {
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class CrushingCategory extends CreateRecipeCategory<AbstractCrushingRecip
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, (xOffset) + layoutEntry.posX() + 1, yOffset + layoutEntry.posY() + 1)
|
.addSlot(RecipeIngredientRole.OUTPUT, (xOffset) + layoutEntry.posX() + 1, yOffset + layoutEntry.posY() + 1)
|
||||||
.setBackground(getRenderedSlot(layoutEntry.output()), -1, -1)
|
.setBackground(getRenderedSlot(layoutEntry.output()), -1, -1)
|
||||||
.addItemStack(layoutEntry.output().getStack())
|
.addItemStack(layoutEntry.output().getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(layoutEntry.output()))
|
.addRichTooltipCallback(addStochasticTooltip(layoutEntry.output()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class DeployingCategory extends CreateRecipeCategory<DeployerApplicationR
|
||||||
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 51 + yOffset)
|
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 51 + yOffset)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipe.shouldKeepHeldItem())
|
if (recipe.shouldKeepHeldItem())
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class ItemApplicationCategory extends CreateRecipeCategory<ItemApplicatio
|
||||||
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 38 + yOffset)
|
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 38 + yOffset)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@ import com.simibubi.create.content.fluids.transfer.EmptyingRecipe;
|
||||||
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder;
|
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder;
|
||||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||||
|
|
||||||
|
import com.simibubi.create.foundation.item.ItemHelper;
|
||||||
|
|
||||||
|
import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet;
|
||||||
import mezz.jei.api.constants.VanillaTypes;
|
import mezz.jei.api.constants.VanillaTypes;
|
||||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
||||||
|
@ -22,6 +25,7 @@ import net.createmod.catnip.registry.RegisteredObjectsHelper;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.ItemStackLinkedSet;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||||
|
@ -40,6 +44,7 @@ public class ItemDrainCategory extends CreateRecipeCategory<EmptyingRecipe> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void consumeRecipes(Consumer<RecipeHolder<EmptyingRecipe>> consumer, IIngredientManager ingredientManager) {
|
public static void consumeRecipes(Consumer<RecipeHolder<EmptyingRecipe>> consumer, IIngredientManager ingredientManager) {
|
||||||
|
ObjectOpenCustomHashSet<ItemStack> emptiedItems = new ObjectOpenCustomHashSet<>(ItemStackLinkedSet.TYPE_AND_TAG);
|
||||||
for (ItemStack stack : ingredientManager.getAllIngredients(VanillaTypes.ITEM_STACK)) {
|
for (ItemStack stack : ingredientManager.getAllIngredients(VanillaTypes.ITEM_STACK)) {
|
||||||
if (PotionFluidHandler.isPotionItem(stack)) {
|
if (PotionFluidHandler.isPotionItem(stack)) {
|
||||||
FluidStack fluidFromPotionItem = PotionFluidHandler.getFluidFromPotionItem(stack);
|
FluidStack fluidFromPotionItem = PotionFluidHandler.getFluidFromPotionItem(stack);
|
||||||
|
@ -67,6 +72,11 @@ public class ItemDrainCategory extends CreateRecipeCategory<EmptyingRecipe> {
|
||||||
if (result.isEmpty())
|
if (result.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// There can be a lot of duplicate empty tanks (e.g. from emptying tanks with different fluids). Merge
|
||||||
|
// them to reduce memory usage. If the item is exactly the same as the input, just use the input stack
|
||||||
|
// instead of the copy.
|
||||||
|
result = ItemHelper.sameItem(stack, result) ? stack : emptiedItems.addOrGet(result);
|
||||||
|
|
||||||
Ingredient ingredient = Ingredient.of(stack);
|
Ingredient ingredient = Ingredient.of(stack);
|
||||||
ResourceLocation itemName = RegisteredObjectsHelper.getKeyOrThrow(stack.getItem());
|
ResourceLocation itemName = RegisteredObjectsHelper.getKeyOrThrow(stack.getItem());
|
||||||
ResourceLocation fluidName = RegisteredObjectsHelper.getKeyOrThrow(extracted.getFluid());
|
ResourceLocation fluidName = RegisteredObjectsHelper.getKeyOrThrow(extracted.getFluid());
|
||||||
|
@ -92,7 +102,7 @@ public class ItemDrainCategory extends CreateRecipeCategory<EmptyingRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 132, 8)
|
.addSlot(RecipeIngredientRole.OUTPUT, 132, 8)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
.addIngredient(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getResultingFluid()))
|
.addIngredient(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getResultingFluid()))
|
||||||
.addTooltipCallback(addFluidTooltip(recipe.getResultingFluid().getAmount()));
|
.addRichTooltipCallback(addFluidTooltip(recipe.getResultingFluid().getAmount()));
|
||||||
builder
|
builder
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 132, 27)
|
.addSlot(RecipeIngredientRole.OUTPUT, 132, 27)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class MillingCategory extends CreateRecipeCategory<AbstractCrushingRecipe
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, single ? 139 : 133 + xOffset, 27 + yOffset)
|
.addSlot(RecipeIngredientRole.OUTPUT, single ? 139 : 133 + xOffset, 27 + yOffset)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class PolishingCategory extends CreateRecipeCategory<SandPaperPolishingRe
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 132, 29)
|
.addSlot(RecipeIngredientRole.OUTPUT, 132, 29)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class PressingCategory extends CreateRecipeCategory<PressingRecipe> {
|
||||||
builder.addSlot(RecipeIngredientRole.OUTPUT, 131 + 19 * i, 50)
|
builder.addSlot(RecipeIngredientRole.OUTPUT, 131 + 19 * i, 50)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ public abstract class ProcessingViaFanCategory<T extends Recipe<?>> extends Crea
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 141 + xOffset, 48 + yOffset)
|
.addSlot(RecipeIngredientRole.OUTPUT, 141 + xOffset, 48 + yOffset)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class SawingCategory extends CreateRecipeCategory<CuttingRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 118 + xOffset, 48 + yOffset)
|
.addSlot(RecipeIngredientRole.OUTPUT, 118 + xOffset, 48 + yOffset)
|
||||||
.setBackground(getRenderedSlot(output), -1, -1)
|
.setBackground(getRenderedSlot(output), -1, -1)
|
||||||
.addItemStack(output.getStack())
|
.addItemStack(output.getStack())
|
||||||
.addTooltipCallback(addStochasticTooltip(output));
|
.addRichTooltipCallback(addStochasticTooltip(output));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
|
||||||
|
import net.neoforged.neoforge.capabilities.Capabilities.FluidHandler;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction;
|
import net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction;
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem;
|
import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem;
|
||||||
|
@ -59,13 +60,21 @@ public class SpoutCategory extends CreateRecipeCategory<FillingRecipe> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
IFluidHandlerItem capability = stack.getCapability(Capabilities.FluidHandler.ITEM);
|
IFluidHandlerItem capability = stack.getCapability(FluidHandler.ITEM);
|
||||||
if (capability == null)
|
if (capability == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
int numTanks = capability.getTanks();
|
||||||
|
FluidStack existingFluid = numTanks == 1 ? capability.getFluidInTank(0) : FluidStack.EMPTY;
|
||||||
|
|
||||||
for (FluidStack fluidStack : fluidStacks) {
|
for (FluidStack fluidStack : fluidStacks) {
|
||||||
|
// Hoist the fluid equality check to avoid the work of copying the stack + populating capabilities
|
||||||
|
// when most fluids will not match
|
||||||
|
if (numTanks == 1 && (!existingFluid.isEmpty() && !FluidStack.isSameFluidSameComponents(existingFluid, fluidStack))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ItemStack copy = stack.copy();
|
ItemStack copy = stack.copy();
|
||||||
IFluidHandlerItem fhi = copy.getCapability(Capabilities.FluidHandler.ITEM);
|
IFluidHandlerItem fhi = copy.getCapability(FluidHandler.ITEM);
|
||||||
if (fhi != null) {
|
if (fhi != null) {
|
||||||
if (!GenericItemFilling.isFluidHandlerValid(copy, fhi))
|
if (!GenericItemFilling.isFluidHandlerValid(copy, fhi))
|
||||||
return;
|
return;
|
||||||
|
@ -104,7 +113,7 @@ public class SpoutCategory extends CreateRecipeCategory<FillingRecipe> {
|
||||||
.addSlot(RecipeIngredientRole.INPUT, 27, 32)
|
.addSlot(RecipeIngredientRole.INPUT, 27, 32)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
.addIngredients(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getRequiredFluid().getMatchingFluidStacks()))
|
.addIngredients(NeoForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getRequiredFluid().getMatchingFluidStacks()))
|
||||||
.addTooltipCallback(addFluidTooltip(recipe.getRequiredFluid().getRequiredAmount()));
|
.addRichTooltipCallback(addFluidTooltip(recipe.getRequiredFluid().getRequiredAmount()));
|
||||||
builder
|
builder
|
||||||
.addSlot(RecipeIngredientRole.OUTPUT, 132, 51)
|
.addSlot(RecipeIngredientRole.OUTPUT, 132, 51)
|
||||||
.setBackground(getRenderedSlot(), -1, -1)
|
.setBackground(getRenderedSlot(), -1, -1)
|
||||||
|
|
|
@ -76,7 +76,7 @@ public abstract class SequencedAssemblySubCategory {
|
||||||
.addSlot(RecipeIngredientRole.INPUT, x + 4, 15)
|
.addSlot(RecipeIngredientRole.INPUT, x + 4, 15)
|
||||||
.setBackground(CreateRecipeCategory.getRenderedSlot(), -1, -1)
|
.setBackground(CreateRecipeCategory.getRenderedSlot(), -1, -1)
|
||||||
.addIngredients(NeoForgeTypes.FLUID_STACK, CreateRecipeCategory.withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
|
.addIngredients(NeoForgeTypes.FLUID_STACK, CreateRecipeCategory.withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
|
||||||
.addTooltipCallback(CreateRecipeCategory.addFluidTooltip(fluidIngredient.getRequiredAmount()));
|
.addRichTooltipCallback(CreateRecipeCategory.addFluidTooltip(fluidIngredient.getRequiredAmount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,7 +14,6 @@ import org.apache.commons.lang3.mutable.MutableFloat;
|
||||||
import org.apache.commons.lang3.mutable.MutableObject;
|
import org.apache.commons.lang3.mutable.MutableObject;
|
||||||
import org.apache.commons.lang3.tuple.MutablePair;
|
import org.apache.commons.lang3.tuple.MutablePair;
|
||||||
|
|
||||||
import com.google.common.base.Predicates;
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllMovementBehaviours;
|
import com.simibubi.create.AllMovementBehaviours;
|
||||||
import com.simibubi.create.content.contraptions.AbstractContraptionEntity.ContraptionRotationState;
|
import com.simibubi.create.content.contraptions.AbstractContraptionEntity.ContraptionRotationState;
|
||||||
|
@ -159,8 +158,7 @@ public class ContraptionCollider {
|
||||||
List<AABB> bbs = new ArrayList<>();
|
List<AABB> bbs = new ArrayList<>();
|
||||||
List<VoxelShape> potentialHits =
|
List<VoxelShape> potentialHits =
|
||||||
getPotentiallyCollidedShapes(world, contraption, localBB.expandTowards(motionCopy));
|
getPotentiallyCollidedShapes(world, contraption, localBB.expandTowards(motionCopy));
|
||||||
potentialHits.forEach(shape -> shape.toAabbs()
|
potentialHits.forEach(shape -> bbs.addAll(shape.toAabbs()));
|
||||||
.forEach(bbs::add));
|
|
||||||
return bbs;
|
return bbs;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -663,19 +661,23 @@ public class ContraptionCollider {
|
||||||
BlockPos min = BlockPos.containing(blockScanBB.minX, blockScanBB.minY, blockScanBB.minZ);
|
BlockPos min = BlockPos.containing(blockScanBB.minX, blockScanBB.minY, blockScanBB.minZ);
|
||||||
BlockPos max = BlockPos.containing(blockScanBB.maxX, blockScanBB.maxY, blockScanBB.maxZ);
|
BlockPos max = BlockPos.containing(blockScanBB.maxX, blockScanBB.maxY, blockScanBB.maxZ);
|
||||||
|
|
||||||
List<VoxelShape> potentialHits = BlockPos.betweenClosedStream(min, max)
|
List<VoxelShape> potentialHits = new ArrayList<>();
|
||||||
.filter(contraption.getBlocks()::containsKey)
|
|
||||||
.filter(Predicates.not(contraption::isHiddenInPortal))
|
for (BlockPos p : BlockPos.betweenClosed(min, max)) {
|
||||||
.map(p -> {
|
if (contraption.blocks.containsKey(p) && !contraption.isHiddenInPortal(p)) {
|
||||||
BlockState blockState = contraption.getBlocks()
|
StructureBlockInfo info = contraption.getBlocks().get(p);
|
||||||
.get(p).state();
|
|
||||||
BlockPos pos = contraption.getBlocks()
|
BlockState blockState = info.state();
|
||||||
.get(p).pos();
|
BlockPos pos = info.pos();
|
||||||
VoxelShape collisionShape = blockState.getCollisionShape(world, p);
|
|
||||||
return collisionShape.move(pos.getX(), pos.getY(), pos.getZ());
|
VoxelShape collisionShape = blockState.getCollisionShape(world, p)
|
||||||
})
|
.move(pos.getX(), pos.getY(), pos.getZ());
|
||||||
.filter(Predicates.not(VoxelShape::isEmpty))
|
|
||||||
.toList();
|
if (!collisionShape.isEmpty()) {
|
||||||
|
potentialHits.add(collisionShape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return potentialHits;
|
return potentialHits;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class ContraptionControlsBlockEntity extends SmartBlockEntity {
|
||||||
|
|
||||||
public static void sendStatus(Player player, ItemStack filter, boolean enabled) {
|
public static void sendStatus(Player player, ItemStack filter, boolean enabled) {
|
||||||
MutableComponent state = CreateLang.translate("contraption.controls.actor_toggle." + (enabled ? "on" : "off"))
|
MutableComponent state = CreateLang.translate("contraption.controls.actor_toggle." + (enabled ? "on" : "off"))
|
||||||
.color(DyeHelper.DYE_TABLE.get(enabled ? DyeColor.LIME : DyeColor.ORANGE)
|
.color(DyeHelper.getDyeColors(enabled ? DyeColor.LIME : DyeColor.ORANGE)
|
||||||
.getFirst())
|
.getFirst())
|
||||||
.component();
|
.component();
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class ContraptionControlsRenderer extends SmartBlockEntityRenderer<Contra
|
||||||
: ctx.position.distanceToSqr(cameraEntity.getEyePosition()));
|
: ctx.position.distanceToSqr(cameraEntity.getEyePosition()));
|
||||||
|
|
||||||
float flicker = r.nextFloat();
|
float flicker = r.nextFloat();
|
||||||
Couple<Integer> couple = DyeHelper.DYE_TABLE.get(efs.targetYEqualsSelection ? DyeColor.WHITE : DyeColor.ORANGE);
|
Couple<Integer> couple = DyeHelper.getDyeColors(efs.targetYEqualsSelection ? DyeColor.WHITE : DyeColor.ORANGE);
|
||||||
int brightColor = couple.getFirst();
|
int brightColor = couple.getFirst();
|
||||||
int darkColor = couple.getSecond();
|
int darkColor = couple.getSecond();
|
||||||
int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4);
|
int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import net.neoforged.neoforge.common.SpecialPlantable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||||
|
|
||||||
|
import com.simibubi.create.AllTags;
|
||||||
import com.simibubi.create.content.contraptions.behaviour.MovementBehaviour;
|
import com.simibubi.create.content.contraptions.behaviour.MovementBehaviour;
|
||||||
import com.simibubi.create.content.contraptions.behaviour.MovementContext;
|
import com.simibubi.create.content.contraptions.behaviour.MovementContext;
|
||||||
import com.simibubi.create.content.contraptions.render.ActorVisual;
|
import com.simibubi.create.content.contraptions.render.ActorVisual;
|
||||||
|
@ -174,7 +175,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
|
||||||
if (block == Blocks.SWEET_BERRY_BUSH) {
|
if (block == Blocks.SWEET_BERRY_BUSH) {
|
||||||
return state.setValue(BlockStateProperties.AGE_3, Integer.valueOf(1));
|
return state.setValue(BlockStateProperties.AGE_3, Integer.valueOf(1));
|
||||||
}
|
}
|
||||||
if (block == Blocks.SUGAR_CANE || block instanceof GrowingPlantBlock) {
|
if (state.is(AllTags.AllBlockTags.SUGAR_CANE_VARIANTS.tag) || block instanceof GrowingPlantBlock) {
|
||||||
if (state.getFluidState()
|
if (state.getFluidState()
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
return Blocks.AIR.defaultBlockState();
|
return Blocks.AIR.defaultBlockState();
|
||||||
|
|
|
@ -162,6 +162,11 @@ public class CopycatPanelBlock extends WaterloggedCopycatBlock {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean skipRendering(BlockState state, BlockState adjacentState, Direction direction) {
|
||||||
|
return state.equals(adjacentState) && direction.getAxis().isHorizontal();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsExternalFaceHiding(BlockState state) {
|
public boolean supportsExternalFaceHiding(BlockState state) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -5,9 +5,9 @@ import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.decoration.steamWhistle.WhistleBlock.WhistleSize;
|
import com.simibubi.create.content.decoration.steamWhistle.WhistleBlock.WhistleSize;
|
||||||
import com.simibubi.create.content.decoration.steamWhistle.WhistleExtenderBlock.WhistleExtenderShape;
|
import com.simibubi.create.content.decoration.steamWhistle.WhistleExtenderBlock.WhistleExtenderShape;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
|
||||||
import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity;
|
import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.steamEngine.SteamJetParticleData;
|
import com.simibubi.create.content.kinetics.steamEngine.SteamJetParticleData;
|
||||||
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
||||||
|
@ -89,7 +89,7 @@ public class WhistleBlockEntity extends SmartBlockEntity implements IHaveGoggleI
|
||||||
FluidTankBlockEntity tank = getTank();
|
FluidTankBlockEntity tank = getTank();
|
||||||
boolean powered = isPowered()
|
boolean powered = isPowered()
|
||||||
&& (tank != null && tank.boiler.isActive() && (tank.boiler.passiveHeat || tank.boiler.activeHeat > 0)
|
&& (tank != null && tank.boiler.isActive() && (tank.boiler.passiveHeat || tank.boiler.activeHeat > 0)
|
||||||
|| isVirtual());
|
|| isVirtual());
|
||||||
animation.chase(powered ? 1 : 0, powered ? .5f : .4f, powered ? Chaser.EXP : Chaser.LINEAR);
|
animation.chase(powered ? 1 : 0, powered ? .5f : .4f, powered ? Chaser.EXP : Chaser.LINEAR);
|
||||||
animation.tickChaser();
|
animation.tickChaser();
|
||||||
CatnipServices.PLATFORM.executeOnClientOnly(() -> () -> this.tickAudio(getOctave(), powered));
|
CatnipServices.PLATFORM.executeOnClientOnly(() -> () -> this.tickAudio(getOctave(), powered));
|
||||||
|
|
|
@ -8,14 +8,13 @@ import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.UseAnim;
|
import net.minecraft.world.item.UseAnim;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
public class BuildersTeaItem extends Item {
|
public class BuildersTeaItem extends Item {
|
||||||
public BuildersTeaItem(Properties properties) {
|
public BuildersTeaItem(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull ItemStack finishUsingItem(@NotNull ItemStack stack, @NotNull Level level, @NotNull LivingEntity livingEntity) {
|
@Override
|
||||||
|
public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) {
|
||||||
ItemStack eatResult = super.finishUsingItem(stack, level, livingEntity);
|
ItemStack eatResult = super.finishUsingItem(stack, level, livingEntity);
|
||||||
if (livingEntity instanceof Player player && !player.getAbilities().instabuild) {
|
if (livingEntity instanceof Player player && !player.getAbilities().instabuild) {
|
||||||
if (eatResult.isEmpty()) {
|
if (eatResult.isEmpty()) {
|
||||||
|
@ -27,11 +26,13 @@ public class BuildersTeaItem extends Item {
|
||||||
return eatResult;
|
return eatResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUseDuration(@NotNull ItemStack stack) {
|
@Override
|
||||||
|
public int getUseDuration(ItemStack stack, LivingEntity entity) {
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull UseAnim getUseAnimation(@NotNull ItemStack stack) {
|
@Override
|
||||||
|
public UseAnim getUseAnimation(ItemStack stack) {
|
||||||
return UseAnim.DRINK;
|
return UseAnim.DRINK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,10 @@ import com.mojang.blaze3d.platform.Window;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveCustomOverlayIcon;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IProxyHoveringInformation;
|
||||||
import com.simibubi.create.compat.Mods;
|
import com.simibubi.create.compat.Mods;
|
||||||
import com.simibubi.create.content.contraptions.IDisplayAssemblyExceptions;
|
import com.simibubi.create.content.contraptions.IDisplayAssemblyExceptions;
|
||||||
import com.simibubi.create.content.contraptions.piston.MechanicalPistonBlock;
|
import com.simibubi.create.content.contraptions.piston.MechanicalPistonBlock;
|
||||||
|
@ -20,9 +24,9 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
import com.simibubi.create.infrastructure.config.CClient;
|
import com.simibubi.create.infrastructure.config.CClient;
|
||||||
|
|
||||||
|
import net.createmod.catnip.data.Iterate;
|
||||||
import net.createmod.catnip.gui.element.BoxElement;
|
import net.createmod.catnip.gui.element.BoxElement;
|
||||||
import net.createmod.catnip.gui.element.GuiGameElement;
|
import net.createmod.catnip.gui.element.GuiGameElement;
|
||||||
import net.createmod.catnip.data.Iterate;
|
|
||||||
import net.createmod.catnip.lang.Lang;
|
import net.createmod.catnip.lang.Lang;
|
||||||
import net.createmod.catnip.outliner.Outline;
|
import net.createmod.catnip.outliner.Outline;
|
||||||
import net.createmod.catnip.outliner.Outliner;
|
import net.createmod.catnip.outliner.Outliner;
|
||||||
|
@ -98,12 +102,11 @@ public class GoggleOverlayRenderer {
|
||||||
boolean hoverAddedInformation = false;
|
boolean hoverAddedInformation = false;
|
||||||
|
|
||||||
ItemStack item = AllItems.GOGGLES.asStack();
|
ItemStack item = AllItems.GOGGLES.asStack();
|
||||||
|
List<Component> tooltip = new ArrayList<>();
|
||||||
|
|
||||||
if (be instanceof IHaveCustomOverlayIcon customOverlayIcon)
|
if (be instanceof IHaveCustomOverlayIcon customOverlayIcon)
|
||||||
item = customOverlayIcon.getIcon(isShifting);
|
item = customOverlayIcon.getIcon(isShifting);
|
||||||
|
|
||||||
List<Component> tooltip = new ArrayList<>();
|
|
||||||
|
|
||||||
if (hasGoggleInformation && wearingGoggles) {
|
if (hasGoggleInformation && wearingGoggles) {
|
||||||
IHaveGoggleInformation gte = (IHaveGoggleInformation) be;
|
IHaveGoggleInformation gte = (IHaveGoggleInformation) be;
|
||||||
goggleAddedInformation = gte.addToGoggleTooltip(tooltip, isShifting);
|
goggleAddedInformation = gte.addToGoggleTooltip(tooltip, isShifting);
|
||||||
|
|
|
@ -56,12 +56,6 @@ public class CardboardSwordItem extends SwordItem {
|
||||||
return enchantment == Enchantments.KNOCKBACK;
|
return enchantment == Enchantments.KNOCKBACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) {
|
|
||||||
AllSoundEvents.CARDBOARD_SWORD.playFrom(entity, 0.75f, 1.85f);
|
|
||||||
return super.onLeftClickEntity(stack, player, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void cardboardSwordsMakeNoiseOnClick(PlayerInteractEvent.LeftClickBlock event) {
|
public static void cardboardSwordsMakeNoiseOnClick(PlayerInteractEvent.LeftClickBlock event) {
|
||||||
ItemStack itemStack = event.getItemStack();
|
ItemStack itemStack = event.getItemStack();
|
||||||
|
@ -85,9 +79,8 @@ public class CardboardSwordItem extends SwordItem {
|
||||||
if (!(AllItems.CARDBOARD_SWORD.isIn(stack)))
|
if (!(AllItems.CARDBOARD_SWORD.isIn(stack)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Previously this was listening to LivingEntityAttackEvent, but that got merged, and so if we cancel this event
|
AllSoundEvents.CARDBOARD_SWORD.playFrom(attacker, 0.75f, 1.85f);
|
||||||
// onLeftClickEntity won't be called, so lets just call it manually over here
|
|
||||||
stack.getItem().onLeftClickEntity(stack, attacker, target);
|
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
|
||||||
// Reference player.attack()
|
// Reference player.attack()
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllDataComponents;
|
import com.simibubi.create.AllDataComponents;
|
||||||
import com.simibubi.create.AllShapes;
|
import com.simibubi.create.AllShapes;
|
||||||
import com.simibubi.create.foundation.block.IBE;
|
import com.simibubi.create.foundation.block.IBE;
|
||||||
|
import com.simibubi.create.foundation.item.ItemHelper;
|
||||||
import com.simibubi.create.foundation.mixin.accessor.ItemStackHandlerAccessor;
|
import com.simibubi.create.foundation.mixin.accessor.ItemStackHandlerAccessor;
|
||||||
import com.simibubi.create.foundation.utility.BlockHelper;
|
import com.simibubi.create.foundation.utility.BlockHelper;
|
||||||
|
|
||||||
|
@ -28,7 +29,6 @@ import net.minecraft.world.item.DyeColor;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.component.ItemContainerContents;
|
import net.minecraft.world.item.component.ItemContainerContents;
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.LevelAccessor;
|
import net.minecraft.world.level.LevelAccessor;
|
||||||
|
@ -45,6 +45,7 @@ import net.minecraft.world.level.material.Fluids;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
|
||||||
import net.neoforged.neoforge.common.util.FakePlayer;
|
import net.neoforged.neoforge.common.util.FakePlayer;
|
||||||
|
|
||||||
public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWaterloggedBlock, IBE<ToolboxBlockEntity> {
|
public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWaterloggedBlock, IBE<ToolboxBlockEntity> {
|
||||||
|
@ -184,9 +185,14 @@ public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWa
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Ingredient getMainBox() {
|
@Override
|
||||||
return Ingredient.of(AllBlocks.TOOLBOXES.get(DyeColor.BROWN)
|
public boolean hasAnalogOutputSignal(BlockState pState) {
|
||||||
.get());
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
|
||||||
|
return ItemHelper.calcRedstoneFromBlockEntity(this, pLevel, pPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class OpenEndedPipe extends FlowSource {
|
||||||
if (!FluidHelper.hasBlockState(fluid.getFluid()))
|
if (!FluidHelper.hasBlockState(fluid.getFluid()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!fluidState.isEmpty() && fluidState.getType() != fluid.getFluid()) {
|
if (!fluidState.isEmpty() && FluidHelper.convertToStill(fluidState.getType()) != fluid.getFluid()) {
|
||||||
FluidReactions.handlePipeSpillCollision(world, outputPos, fluid.getFluid(), fluidState);
|
FluidReactions.handlePipeSpillCollision(world, outputPos, fluid.getFluid(), fluidState);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.simibubi.create.content.fluids;
|
package com.simibubi.create.content.fluids;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.fluids.potion.PotionFluid;
|
||||||
|
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
@ -10,17 +12,35 @@ import net.neoforged.neoforge.fluids.BaseFlowingFluid;
|
||||||
|
|
||||||
public class VirtualFluid extends BaseFlowingFluid {
|
public class VirtualFluid extends BaseFlowingFluid {
|
||||||
|
|
||||||
public VirtualFluid(Properties properties) {
|
public static VirtualFluid createSource(Properties properties) {
|
||||||
|
return new VirtualFluid(properties, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VirtualFluid createFlowing(Properties properties) {
|
||||||
|
return new VirtualFluid(properties, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private final boolean source;
|
||||||
|
|
||||||
|
public VirtualFluid(Properties properties, boolean source) {
|
||||||
super(properties);
|
super(properties);
|
||||||
|
this.source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fluid getSource() {
|
public Fluid getSource() {
|
||||||
|
if (source) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
return super.getSource();
|
return super.getSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fluid getFlowing() {
|
public Fluid getFlowing() {
|
||||||
|
if (source) {
|
||||||
|
return super.getFlowing();
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +56,7 @@ public class VirtualFluid extends BaseFlowingFluid {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSource(FluidState p_207193_1_) {
|
public boolean isSource(FluidState p_207193_1_) {
|
||||||
return false;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.fluids.transfer.GenericItemEmptying;
|
import com.simibubi.create.content.fluids.transfer.GenericItemEmptying;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
||||||
import com.simibubi.create.content.kinetics.belt.transport.TransportedItemStack;
|
import com.simibubi.create.content.kinetics.belt.transport.TransportedItemStack;
|
||||||
|
@ -28,6 +28,7 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
|
|
@ -31,19 +31,28 @@ import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
|
||||||
public class PotionFluid extends VirtualFluid {
|
public class PotionFluid extends VirtualFluid {
|
||||||
|
|
||||||
public PotionFluid(Properties properties) {
|
public static PotionFluid createSource(Properties properties) {
|
||||||
super(properties);
|
return new PotionFluid(properties, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FluidStack of(int amount, PotionContents potionContents) {
|
public static PotionFluid createFlowing(Properties properties) {
|
||||||
FluidStack fluidStack = new FluidStack(AllFluids.POTION.get()
|
return new PotionFluid(properties, false);
|
||||||
.getSource(), amount);
|
}
|
||||||
|
|
||||||
|
public PotionFluid(Properties properties, boolean source) {
|
||||||
|
super(properties, source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FluidStack of(int amount, PotionContents potionContents, BottleType bottleType) {
|
||||||
|
FluidStack fluidStack;
|
||||||
|
fluidStack = new FluidStack(AllFluids.POTION.get().getSource(), amount);
|
||||||
addPotionToFluidStack(fluidStack, potionContents);
|
addPotionToFluidStack(fluidStack, potionContents);
|
||||||
|
fluidStack.set(AllDataComponents.POTION_FLUID_BOTTLE_TYPE, bottleType);
|
||||||
return fluidStack;
|
return fluidStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FluidStack withEffects(int amount, PotionContents potionContents) {
|
public static FluidStack withEffects(int amount, PotionContents potionContents) {
|
||||||
FluidStack fluidStack = of(amount, potionContents);
|
FluidStack fluidStack = of(amount, potionContents, BottleType.REGULAR);
|
||||||
appendEffects(fluidStack, potionContents.customEffects());
|
appendEffects(fluidStack, potionContents.customEffects());
|
||||||
return fluidStack;
|
return fluidStack;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,7 @@ public class PotionFluidHandler {
|
||||||
public static FluidStack getFluidFromPotion(PotionContents potionContents, BottleType bottleType, int amount) {
|
public static FluidStack getFluidFromPotion(PotionContents potionContents, BottleType bottleType, int amount) {
|
||||||
if (potionContents.is(Potions.WATER) && bottleType == BottleType.REGULAR)
|
if (potionContents.is(Potions.WATER) && bottleType == BottleType.REGULAR)
|
||||||
return new FluidStack(Fluids.WATER, amount);
|
return new FluidStack(Fluids.WATER, amount);
|
||||||
FluidStack fluid = PotionFluid.of(amount, potionContents);
|
return PotionFluid.of(amount, potionContents, bottleType);
|
||||||
fluid.set(AllDataComponents.POTION_FLUID_BOTTLE_TYPE, bottleType);
|
|
||||||
return fluid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BottleType bottleTypeFromItem(Item item) {
|
public static BottleType bottleTypeFromItem(Item item) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour;
|
import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.fluids.FluidFX;
|
import com.simibubi.create.content.fluids.FluidFX;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.BeltProcessingBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.BeltProcessingBehaviour;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.BeltProcessingBehaviour.ProcessingResult;
|
import com.simibubi.create.content.kinetics.belt.behaviour.BeltProcessingBehaviour.ProcessingResult;
|
||||||
|
@ -23,11 +23,10 @@ import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||||
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour;
|
import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour;
|
||||||
import com.simibubi.create.foundation.fluid.FluidHelper;
|
import com.simibubi.create.foundation.fluid.FluidHelper;
|
||||||
|
|
||||||
import com.simibubi.create.impl.behaviour.BlockSpoutingBehaviourImpl;
|
import com.simibubi.create.impl.behaviour.BlockSpoutingBehaviourImpl;
|
||||||
|
|
||||||
import net.createmod.catnip.nbt.NBTHelper;
|
|
||||||
import net.createmod.catnip.math.VecHelper;
|
import net.createmod.catnip.math.VecHelper;
|
||||||
|
import net.createmod.catnip.nbt.NBTHelper;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
|
@ -39,6 +38,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
@ -91,7 +91,7 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ProcessingResult onItemReceived(TransportedItemStack transported,
|
protected ProcessingResult onItemReceived(TransportedItemStack transported,
|
||||||
TransportedItemStackHandlerBehaviour handler) {
|
TransportedItemStackHandlerBehaviour handler) {
|
||||||
if (handler.blockEntity.isVirtual())
|
if (handler.blockEntity.isVirtual())
|
||||||
return PASS;
|
return PASS;
|
||||||
if (!FillingBySpout.canItemBeFilled(level, transported.stack))
|
if (!FillingBySpout.canItemBeFilled(level, transported.stack))
|
||||||
|
@ -104,7 +104,7 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ProcessingResult whenItemHeld(TransportedItemStack transported,
|
protected ProcessingResult whenItemHeld(TransportedItemStack transported,
|
||||||
TransportedItemStackHandlerBehaviour handler) {
|
TransportedItemStackHandlerBehaviour handler) {
|
||||||
if (processingTicks != -1 && processingTicks != 5)
|
if (processingTicks != -1 && processingTicks != 5)
|
||||||
return HOLD;
|
return HOLD;
|
||||||
if (!FillingBySpout.canItemBeFilled(level, transported.stack))
|
if (!FillingBySpout.canItemBeFilled(level, transported.stack))
|
||||||
|
@ -121,7 +121,7 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
if (processingTicks == -1) {
|
if (processingTicks == -1) {
|
||||||
processingTicks = FILLING_TIME;
|
processingTicks = FILLING_TIME;
|
||||||
notifyUpdate();
|
notifyUpdate();
|
||||||
AllSoundEvents.SPOUTING.playOnServer(level, worldPosition, 0.75f, 0.9f + 0.2f * (float)Math.random());
|
AllSoundEvents.SPOUTING.playOnServer(level, worldPosition, 0.75f, 0.9f + 0.2f * (float) Math.random());
|
||||||
return HOLD;
|
return HOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,13 +232,15 @@ public class SpoutBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
|
|
||||||
if (processingTicks >= 8 && level.isClientSide) {
|
if (processingTicks >= 8 && level.isClientSide) {
|
||||||
spawnProcessingParticles(tank.getPrimaryTank()
|
spawnProcessingParticles(tank.getPrimaryTank()
|
||||||
.getRenderedFluid());
|
.getRenderedFluid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void spawnProcessingParticles(FluidStack fluid) {
|
protected void spawnProcessingParticles(FluidStack fluid) {
|
||||||
if (isVirtual())
|
if (isVirtual())
|
||||||
return;
|
return;
|
||||||
|
if (fluid.isEmpty())
|
||||||
|
return;
|
||||||
Vec3 vec = VecHelper.getCenterOf(worldPosition);
|
Vec3 vec = VecHelper.getCenterOf(worldPosition);
|
||||||
vec = vec.subtract(0, 8 / 16f, 0);
|
vec = vec.subtract(0, 8 / 16f, 0);
|
||||||
ParticleOptions particle = FluidFX.getFluidParticle(fluid);
|
ParticleOptions particle = FluidFX.getFluidParticle(fluid);
|
||||||
|
|
|
@ -65,9 +65,9 @@ public class SpoutRenderer extends SafeBlockEntityRenderer<SpoutBlockEntity> {
|
||||||
processingProgress = Mth.clamp(processingProgress, 0, 1);
|
processingProgress = Mth.clamp(processingProgress, 0, 1);
|
||||||
float radius = 0;
|
float radius = 0;
|
||||||
|
|
||||||
if (processingTicks != -1) {
|
if (!fluidStack.isEmpty() && processingTicks != -1) {
|
||||||
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1);
|
||||||
AABB bb = new AABB(0.5, .5, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
|
AABB bb = new AABB(0.5, 0.0, 0.5, 0.5, -1.2, 0.5).inflate(radius / 32f);
|
||||||
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
FluidRenderer.renderFluidBox(fluidStack.getFluid(), fluidStack.getAmount(), (float) bb.minX, (float) bb.minY, (float) bb.minZ,
|
||||||
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true, true, fluidStack.getComponentsPatch());
|
(float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true, true, fluidStack.getComponentsPatch());
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.api.connectivity.ConnectivityHandler;
|
import com.simibubi.create.api.connectivity.ConnectivityHandler;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.fluids.tank.FluidTankBlock.Shape;
|
import com.simibubi.create.content.fluids.tank.FluidTankBlock.Shape;
|
||||||
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
||||||
import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer;
|
import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer;
|
||||||
|
@ -31,6 +31,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
|
|
@ -113,7 +113,7 @@ public abstract class BlockBreakingKineticBlockEntity extends KineticBlockEntity
|
||||||
float breakSpeed = getBreakSpeed();
|
float breakSpeed = getBreakSpeed();
|
||||||
destroyProgress += Mth.clamp((int) (breakSpeed / blockHardness), 1, 10 - destroyProgress);
|
destroyProgress += Mth.clamp((int) (breakSpeed / blockHardness), 1, 10 - destroyProgress);
|
||||||
level.playSound(null, worldPosition, stateToBreak.getSoundType()
|
level.playSound(null, worldPosition, stateToBreak.getSoundType()
|
||||||
.getHitSound(), SoundSource.NEUTRAL, .25f, 1);
|
.getHitSound(), SoundSource.BLOCKS, .25f, 1);
|
||||||
|
|
||||||
if (destroyProgress >= 10) {
|
if (destroyProgress >= 10) {
|
||||||
onBlockBroken(stateToBreak);
|
onBlockBroken(stateToBreak);
|
||||||
|
|
|
@ -9,8 +9,8 @@ import java.util.Objects;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveHoveringInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
|
||||||
import com.simibubi.create.content.kinetics.BlockStressValues;
|
import com.simibubi.create.content.kinetics.BlockStressValues;
|
||||||
import com.simibubi.create.content.kinetics.KineticNetwork;
|
import com.simibubi.create.content.kinetics.KineticNetwork;
|
||||||
import com.simibubi.create.content.kinetics.RotationPropagator;
|
import com.simibubi.create.content.kinetics.RotationPropagator;
|
||||||
|
@ -48,6 +48,7 @@ import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
@ -405,7 +406,8 @@ public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleI
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {}
|
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
public boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||||
|
@ -529,10 +531,10 @@ public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleI
|
||||||
* @param connectedViaCogs whether these kinetic blocks are connected via mutual
|
* @param connectedViaCogs whether these kinetic blocks are connected via mutual
|
||||||
* IRotate.hasIntegratedCogwheel()
|
* IRotate.hasIntegratedCogwheel()
|
||||||
* @return factor of rotation speed from this BE to other. 0 if no rotation is
|
* @return factor of rotation speed from this BE to other. 0 if no rotation is
|
||||||
* transferred, or the standard rules apply (integrated shafts/cogs)
|
* transferred, or the standard rules apply (integrated shafts/cogs)
|
||||||
*/
|
*/
|
||||||
public float propagateRotationTo(KineticBlockEntity target, BlockState stateFrom, BlockState stateTo, BlockPos diff,
|
public float propagateRotationTo(KineticBlockEntity target, BlockState stateFrom, BlockState stateTo, BlockPos diff,
|
||||||
boolean connectedViaAxes, boolean connectedViaCogs) {
|
boolean connectedViaAxes, boolean connectedViaCogs) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +574,7 @@ public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleI
|
||||||
* @param state
|
* @param state
|
||||||
* @param otherState
|
* @param otherState
|
||||||
* @return true if this and the other component should check their propagation
|
* @return true if this and the other component should check their propagation
|
||||||
* factor and are not already connected via integrated cogs or shafts
|
* factor and are not already connected via integrated cogs or shafts
|
||||||
*/
|
*/
|
||||||
public boolean isCustomConnection(KineticBlockEntity other, BlockState state, BlockState otherState) {
|
public boolean isCustomConnection(KineticBlockEntity other, BlockState state, BlockState otherState) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -5,19 +5,18 @@ import org.joml.Vector3f;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.api.instance.InstanceHandle;
|
import dev.engine_room.flywheel.api.instance.InstanceHandle;
|
||||||
import dev.engine_room.flywheel.api.instance.InstanceType;
|
import dev.engine_room.flywheel.api.instance.InstanceType;
|
||||||
import dev.engine_room.flywheel.lib.instance.ColoredLitInstance;
|
import dev.engine_room.flywheel.lib.instance.ColoredLitOverlayInstance;
|
||||||
import net.createmod.catnip.theme.Color;
|
import net.createmod.catnip.theme.Color;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.Direction.Axis;
|
import net.minecraft.core.Direction.Axis;
|
||||||
import net.minecraft.core.Vec3i;
|
import net.minecraft.core.Vec3i;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
|
|
||||||
public class RotatingInstance extends ColoredLitInstance {
|
public class RotatingInstance extends ColoredLitOverlayInstance {
|
||||||
public static final float SPEED_MULTIPLIER = 6;
|
public static final float SPEED_MULTIPLIER = 6;
|
||||||
|
|
||||||
public byte rotationAxisX;
|
public byte rotationAxisX;
|
||||||
public byte rotationAxisY;
|
public byte rotationAxisY;
|
||||||
public byte rotationAxisZ;
|
public byte rotationAxisZ;
|
||||||
public float x;
|
public float x;
|
||||||
public float y;
|
public float y;
|
||||||
public float z;
|
public float z;
|
||||||
|
@ -98,12 +97,12 @@ public class RotatingInstance extends ColoredLitInstance {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RotatingInstance setRotationAxis(Direction.Axis axis) {
|
public RotatingInstance setRotationAxis(Direction.Axis axis) {
|
||||||
Direction orientation = Direction.get(Direction.AxisDirection.POSITIVE, axis);
|
Direction orientation = Direction.get(Direction.AxisDirection.POSITIVE, axis);
|
||||||
return setRotationAxis(orientation.step());
|
return setRotationAxis(orientation.step());
|
||||||
}
|
}
|
||||||
|
|
||||||
public RotatingInstance setRotationAxis(Vector3f axis) {
|
public RotatingInstance setRotationAxis(Vector3f axis) {
|
||||||
return setRotationAxis(axis.x(), axis.y(), axis.z());
|
return setRotationAxis(axis.x(), axis.y(), axis.z());
|
||||||
}
|
}
|
||||||
|
|
||||||
public RotatingInstance setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) {
|
public RotatingInstance setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) {
|
||||||
|
@ -114,8 +113,8 @@ public class RotatingInstance extends ColoredLitInstance {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RotatingInstance setPosition(Vec3i pos) {
|
public RotatingInstance setPosition(Vec3i pos) {
|
||||||
return setPosition(pos.getX(), pos.getY(), pos.getZ());
|
return setPosition(pos.getX(), pos.getY(), pos.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public RotatingInstance setPosition(Vector3f pos) {
|
public RotatingInstance setPosition(Vector3f pos) {
|
||||||
return setPosition(pos.x(), pos.y(), pos.z());
|
return setPosition(pos.x(), pos.y(), pos.z());
|
||||||
|
|
|
@ -27,10 +27,10 @@ import com.simibubi.create.foundation.item.TooltipHelper;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
|
||||||
import net.createmod.catnip.lang.Lang;
|
|
||||||
import net.createmod.catnip.nbt.NBTHelper;
|
|
||||||
import net.createmod.catnip.math.VecHelper;
|
|
||||||
import net.createmod.catnip.animation.LerpedFloat;
|
import net.createmod.catnip.animation.LerpedFloat;
|
||||||
|
import net.createmod.catnip.lang.Lang;
|
||||||
|
import net.createmod.catnip.math.VecHelper;
|
||||||
|
import net.createmod.catnip.nbt.NBTHelper;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -60,6 +60,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
|
@ -557,7 +558,10 @@ public class DeployerBlockEntity extends KineticBlockEntity {
|
||||||
|
|
||||||
ItemStack heldItemMainhand = player.getMainHandItem();
|
ItemStack heldItemMainhand = player.getMainHandItem();
|
||||||
if (heldItemMainhand.getItem() instanceof SandPaperItem) {
|
if (heldItemMainhand.getItem() instanceof SandPaperItem) {
|
||||||
return checkRecipe(AllRecipeTypes.SANDPAPER_POLISHING, new SingleRecipeInput(stack), level).orElse(null);
|
Optional<RecipeHolder<Recipe<RecipeInput>>> polishingRecipe = checkRecipe(AllRecipeTypes.SANDPAPER_POLISHING, new SingleRecipeInput(stack), level);
|
||||||
|
if (polishingRecipe.isPresent()) {
|
||||||
|
return polishingRecipe.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
recipeInv.setStackInSlot(0, stack);
|
recipeInv.setStackInSlot(0, stack);
|
||||||
|
|
|
@ -193,8 +193,9 @@ public class DeployerHandler {
|
||||||
if (stack.has(DataComponents.FOOD)) {
|
if (stack.has(DataComponents.FOOD)) {
|
||||||
FoodProperties foodProperties = item.getFoodProperties(stack, player);
|
FoodProperties foodProperties = item.getFoodProperties(stack, player);
|
||||||
if (foodProperties != null && playerEntity.canEat(foodProperties.canAlwaysEat())) {
|
if (foodProperties != null && playerEntity.canEat(foodProperties.canAlwaysEat())) {
|
||||||
playerEntity.eat(world, stack);
|
ItemStack copy = stack.copy();
|
||||||
player.spawnedItemEffects = stack.copy();
|
player.setItemInHand(hand, stack.finishUsingItem(world, playerEntity));
|
||||||
|
player.spawnedItemEffects = copy;
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.content.kinetics.gauge;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.kinetics.base.KineticBlockEntity;
|
import com.simibubi.create.content.kinetics.base.KineticBlockEntity;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Optional;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||||
|
import org.jetbrains.annotations.ApiStatus.Internal;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllRegistries;
|
import com.simibubi.create.AllRegistries;
|
||||||
|
@ -41,7 +42,6 @@ import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.world.Containers;
|
import net.minecraft.world.Containers;
|
||||||
import net.minecraft.world.InteractionResultHolder;
|
import net.minecraft.world.InteractionResultHolder;
|
||||||
import net.minecraft.world.WorldlyContainer;
|
import net.minecraft.world.WorldlyContainer;
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.crafting.CampfireCookingRecipe;
|
import net.minecraft.world.item.crafting.CampfireCookingRecipe;
|
||||||
|
@ -65,8 +65,6 @@ import net.neoforged.neoforge.items.ItemHandlerHelper;
|
||||||
import net.neoforged.neoforge.items.wrapper.SidedInvWrapper;
|
import net.neoforged.neoforge.items.wrapper.SidedInvWrapper;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
|
||||||
import org.jetbrains.annotations.ApiStatus.Internal;
|
|
||||||
|
|
||||||
public class AllArmInteractionPointTypes {
|
public class AllArmInteractionPointTypes {
|
||||||
private static final DeferredRegister<ArmInteractionPointType> REGISTER = DeferredRegister.create(AllRegistries.Keys.ARM_INTERACTION_POINT_TYPES, Create.ID);
|
private static final DeferredRegister<ArmInteractionPointType> REGISTER = DeferredRegister.create(AllRegistries.Keys.ARM_INTERACTION_POINT_TYPES, Create.ID);
|
||||||
|
|
||||||
|
@ -607,45 +605,30 @@ public class AllArmInteractionPointTypes {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack insert(ItemStack stack, boolean simulate) {
|
public ItemStack insert(ItemStack stack, boolean simulate) {
|
||||||
Item item = stack.getItem();
|
|
||||||
if (stack.get(DataComponents.JUKEBOX_PLAYABLE) == null)
|
if (stack.get(DataComponents.JUKEBOX_PLAYABLE) == null)
|
||||||
return stack;
|
return stack;
|
||||||
if (cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD)
|
if (cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD).orElse(true))
|
||||||
.orElse(true))
|
|
||||||
return stack;
|
return stack;
|
||||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
if (!(level.getBlockEntity(pos) instanceof JukeboxBlockEntity jukeboxBE))
|
||||||
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
|
||||||
return stack;
|
return stack;
|
||||||
if (!jukeboxBE.getTheItem()
|
if (!jukeboxBE.getTheItem().isEmpty())
|
||||||
.isEmpty())
|
|
||||||
return stack;
|
return stack;
|
||||||
ItemStack remainder = stack.copy();
|
ItemStack remainder = stack.copy();
|
||||||
ItemStack toInsert = remainder.split(1);
|
ItemStack toInsert = remainder.split(1);
|
||||||
if (!simulate) {
|
if (!simulate)
|
||||||
jukeboxBE.setTheItem(toInsert);
|
jukeboxBE.setTheItem(toInsert);
|
||||||
level.setBlock(pos, cachedState.setValue(JukeboxBlock.HAS_RECORD, true), 2);
|
|
||||||
level.levelEvent(null, 1010, pos, Item.getId(item));
|
|
||||||
}
|
|
||||||
return remainder;
|
return remainder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack extract(int slot, int amount, boolean simulate) {
|
public ItemStack extract(int slot, int amount, boolean simulate) {
|
||||||
if (!cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD)
|
if (!cachedState.getOptionalValue(JukeboxBlock.HAS_RECORD).orElse(false))
|
||||||
.orElse(false))
|
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
if (!(level.getBlockEntity(pos) instanceof JukeboxBlockEntity jukeboxBE))
|
||||||
if (!(blockEntity instanceof JukeboxBlockEntity jukeboxBE))
|
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
ItemStack record = jukeboxBE.getTheItem();
|
if (!simulate)
|
||||||
if (record.isEmpty())
|
return jukeboxBE.removeItem(slot, amount);
|
||||||
return ItemStack.EMPTY;
|
return jukeboxBE.getTheItem();
|
||||||
if (!simulate) {
|
|
||||||
level.levelEvent(1010, pos, 0);
|
|
||||||
jukeboxBE.clearContent();
|
|
||||||
level.setBlock(pos, cachedState.setValue(JukeboxBlock.HAS_RECORD, false), 2);
|
|
||||||
}
|
|
||||||
return record;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,8 @@ import com.simibubi.create.foundation.render.AllInstanceTypes;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.api.instance.Instance;
|
import dev.engine_room.flywheel.api.instance.Instance;
|
||||||
import dev.engine_room.flywheel.api.instance.InstancerProvider;
|
import dev.engine_room.flywheel.api.instance.InstancerProvider;
|
||||||
import dev.engine_room.flywheel.api.model.Model;
|
|
||||||
import dev.engine_room.flywheel.api.visualization.VisualizationContext;
|
import dev.engine_room.flywheel.api.visualization.VisualizationContext;
|
||||||
import dev.engine_room.flywheel.lib.model.Models;
|
import dev.engine_room.flywheel.lib.model.Models;
|
||||||
import net.createmod.ponder.render.VirtualRenderHelper;
|
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.Direction.Axis;
|
import net.minecraft.core.Direction.Axis;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
@ -63,10 +61,6 @@ public class SawVisual extends KineticBlockEntityVisual<SawBlockEntity> {
|
||||||
rotatingModel.delete();
|
rotatingModel.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Model model() {
|
|
||||||
return VirtualRenderHelper.blockModel(blockState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collectCrumblingInstances(Consumer<Instance> consumer) {
|
public void collectCrumblingInstances(Consumer<Instance> consumer) {
|
||||||
consumer.accept(rotatingModel);
|
consumer.accept(rotatingModel);
|
||||||
|
|
|
@ -37,7 +37,10 @@ public abstract class AbstractSimpleShaftBlock extends AbstractShaftBlock implem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean isMoving) {
|
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean isMoving) {
|
||||||
if (state != newState && !isMoving)
|
boolean wasWaterLogged = state.hasProperty(WATERLOGGED) &&
|
||||||
|
newState.hasProperty(WATERLOGGED) &&
|
||||||
|
(state.getValue(WATERLOGGED) != newState.getValue(WATERLOGGED));
|
||||||
|
if (state != newState && !isMoving && !wasWaterLogged)
|
||||||
removeBracket(world, pos, true).ifPresent(stack -> Block.popResource(world, pos, stack));
|
removeBracket(world, pos, true).ifPresent(stack -> Block.popResource(world, pos, stack));
|
||||||
super.onRemove(state, world, pos, newState, isMoving);
|
super.onRemove(state, world, pos, newState, isMoving);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.contraptions.bearing.WindmillBearingBlockEntity.RotationDirection;
|
import com.simibubi.create.content.contraptions.bearing.WindmillBearingBlockEntity.RotationDirection;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
|
||||||
import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity;
|
import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
|
import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.base.IRotate;
|
import com.simibubi.create.content.kinetics.base.IRotate;
|
||||||
|
@ -21,6 +21,7 @@ import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
import net.createmod.catnip.platform.CatnipServices;
|
import net.createmod.catnip.platform.CatnipServices;
|
||||||
import net.createmod.catnip.math.VecHelper;
|
import net.createmod.catnip.math.VecHelper;
|
||||||
import net.createmod.catnip.math.AngleHelper;
|
import net.createmod.catnip.math.AngleHelper;
|
||||||
|
import net.createmod.catnip.math.VecHelper;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.Direction.Axis;
|
import net.minecraft.core.Direction.Axis;
|
||||||
|
@ -32,6 +33,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
|
@ -62,7 +64,8 @@ public class SteamEngineBlockEntity extends SmartBlockEntity implements IHaveGog
|
||||||
registerAwardables(behaviours, AllAdvancements.STEAM_ENGINE);
|
registerAwardables(behaviours, AllAdvancements.STEAM_ENGINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDirectionChanged() {}
|
private void onDirectionChanged() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -90,7 +93,7 @@ public class SteamEngineBlockEntity extends SmartBlockEntity implements IHaveGog
|
||||||
boolean verticalTarget = false;
|
boolean verticalTarget = false;
|
||||||
BlockState shaftState = shaft.getBlockState();
|
BlockState shaftState = shaft.getBlockState();
|
||||||
Axis targetAxis = Axis.X;
|
Axis targetAxis = Axis.X;
|
||||||
if (shaftState.getBlock()instanceof IRotate ir)
|
if (shaftState.getBlock() instanceof IRotate ir)
|
||||||
targetAxis = ir.getRotationAxis(shaftState);
|
targetAxis = ir.getRotationAxis(shaftState);
|
||||||
verticalTarget = targetAxis == Axis.Y;
|
verticalTarget = targetAxis == Axis.Y;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.mojang.serialization.MapCodec;
|
import com.mojang.serialization.MapCodec;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.equipment.goggles.IProxyHoveringInformation;
|
import com.simibubi.create.api.equipment.goggles.IProxyHoveringInformation;
|
||||||
import com.simibubi.create.content.equipment.wrench.IWrenchable;
|
import com.simibubi.create.content.equipment.wrench.IWrenchable;
|
||||||
import com.simibubi.create.foundation.block.render.MultiPosDestructionHandler;
|
import com.simibubi.create.foundation.block.render.MultiPosDestructionHandler;
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ import net.minecraft.world.level.material.PushReaction;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.HitResult;
|
import net.minecraft.world.phys.HitResult;
|
||||||
|
|
||||||
|
|
||||||
import net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions;
|
import net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions;
|
||||||
|
|
||||||
public class WaterWheelStructuralBlock extends DirectionalBlock implements IWrenchable, IProxyHoveringInformation {
|
public class WaterWheelStructuralBlock extends DirectionalBlock implements IWrenchable, IProxyHoveringInformation {
|
||||||
|
@ -94,7 +95,7 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
|
||||||
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
|
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
|
||||||
if (!stillValid(level, pos, state, false))
|
if (!stillValid(level, pos, state, false))
|
||||||
return ItemInteractionResult.FAIL;
|
return ItemInteractionResult.FAIL;
|
||||||
if (!(level.getBlockEntity(getMaster(level, pos, state))instanceof WaterWheelBlockEntity wwt))
|
if (!(level.getBlockEntity(getMaster(level, pos, state)) instanceof WaterWheelBlockEntity wwt))
|
||||||
return ItemInteractionResult.FAIL;
|
return ItemInteractionResult.FAIL;
|
||||||
return wwt.applyMaterialIfValid(stack);
|
return wwt.applyMaterialIfValid(stack);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +118,7 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel,
|
public BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel,
|
||||||
BlockPos pCurrentPos, BlockPos pFacingPos) {
|
BlockPos pCurrentPos, BlockPos pFacingPos) {
|
||||||
if (stillValid(pLevel, pCurrentPos, pState, false)) {
|
if (stillValid(pLevel, pCurrentPos, pState, false)) {
|
||||||
BlockPos masterPos = getMaster(pLevel, pCurrentPos, pState);
|
BlockPos masterPos = getMaster(pLevel, pCurrentPos, pState);
|
||||||
if (!pLevel.getBlockTicks()
|
if (!pLevel.getBlockTicks()
|
||||||
|
@ -164,7 +165,7 @@ public class WaterWheelStructuralBlock extends DirectionalBlock implements IWren
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addLandingEffects(BlockState state1, ServerLevel level, BlockPos pos, BlockState state2,
|
public boolean addLandingEffects(BlockState state1, ServerLevel level, BlockPos pos, BlockState state2,
|
||||||
LivingEntity entity, int numberOfParticles) {
|
LivingEntity entity, int numberOfParticles) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.TransportedItemStackHandlerBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.TransportedItemStackHandlerBehaviour;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.TransportedItemStackHandlerBehaviour.TransportedResult;
|
import com.simibubi.create.content.kinetics.belt.behaviour.TransportedItemStackHandlerBehaviour.TransportedResult;
|
||||||
|
@ -754,10 +754,10 @@ public class ChuteBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
.style(ChatFormatting.YELLOW)
|
.style(ChatFormatting.YELLOW)
|
||||||
.forGoggles(tooltip);
|
.forGoggles(tooltip);
|
||||||
if (!item.isEmpty())
|
if (!item.isEmpty())
|
||||||
CreateLang.translate("tooltip.chute.contains", Component.translatable(item.getDescriptionId())
|
CreateLang.translate("tooltip.chute.contains", Component.translatable(item.getDescriptionId())
|
||||||
.getString(), item.getCount())
|
.getString(), item.getCount())
|
||||||
.style(ChatFormatting.GREEN)
|
.style(ChatFormatting.GREEN)
|
||||||
.forGoggles(tooltip);
|
.forGoggles(tooltip);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,8 @@ import java.util.List;
|
||||||
import com.simibubi.create.AllDataComponents;
|
import com.simibubi.create.AllDataComponents;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.content.fluids.transfer.GenericItemEmptying;
|
import com.simibubi.create.content.fluids.transfer.GenericItemEmptying;
|
||||||
import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute;
|
|
||||||
import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute;
|
|
||||||
import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute;
|
|
||||||
import com.simibubi.create.content.logistics.box.PackageItem;
|
import com.simibubi.create.content.logistics.box.PackageItem;
|
||||||
|
import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute;
|
||||||
|
|
||||||
import net.createmod.catnip.data.Pair;
|
import net.createmod.catnip.data.Pair;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
|
@ -17,6 +15,7 @@ import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||||
|
|
||||||
|
@ -27,15 +26,18 @@ public class FilterItemStack {
|
||||||
|
|
||||||
public static FilterItemStack of(ItemStack filter) {
|
public static FilterItemStack of(ItemStack filter) {
|
||||||
if (!filter.isComponentsPatchEmpty()) {
|
if (!filter.isComponentsPatchEmpty()) {
|
||||||
filter.remove(DataComponents.ENCHANTMENTS);
|
if (AllItems.FILTER.isIn(filter)) {
|
||||||
filter.remove(DataComponents.STORED_ENCHANTMENTS);
|
trimFilterComponents(filter);
|
||||||
filter.remove(DataComponents.ATTRIBUTE_MODIFIERS);
|
|
||||||
if (AllItems.FILTER.isIn(filter))
|
|
||||||
return new ListFilterItemStack(filter);
|
return new ListFilterItemStack(filter);
|
||||||
if (AllItems.ATTRIBUTE_FILTER.isIn(filter))
|
}
|
||||||
|
if (AllItems.ATTRIBUTE_FILTER.isIn(filter)) {
|
||||||
|
trimFilterComponents(filter);
|
||||||
return new AttributeFilterItemStack(filter);
|
return new AttributeFilterItemStack(filter);
|
||||||
if (AllItems.PACKAGE_FILTER.isIn(filter))
|
}
|
||||||
|
if (AllItems.PACKAGE_FILTER.isIn(filter)) {
|
||||||
|
trimFilterComponents(filter);
|
||||||
return new PackageFilterItemStack(filter);
|
return new PackageFilterItemStack(filter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new FilterItemStack(filter);
|
return new FilterItemStack(filter);
|
||||||
|
@ -49,6 +51,11 @@ public class FilterItemStack {
|
||||||
return of(ItemStack.EMPTY);
|
return of(ItemStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void trimFilterComponents(ItemStack filter) {
|
||||||
|
filter.remove(DataComponents.ENCHANTMENTS);
|
||||||
|
filter.remove(DataComponents.ATTRIBUTE_MODIFIERS);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return filterItemStack.isEmpty();
|
return filterItemStack.isEmpty();
|
||||||
}
|
}
|
||||||
|
@ -197,35 +204,35 @@ public class FilterItemStack {
|
||||||
boolean matches = attribute.appliesTo(stack, world) != inverted;
|
boolean matches = attribute.appliesTo(stack, world) != inverted;
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
switch (whitelistMode) {
|
switch (whitelistMode) {
|
||||||
case BLACKLIST -> {
|
case BLACKLIST -> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case WHITELIST_CONJ -> {
|
case WHITELIST_CONJ -> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case WHITELIST_DISJ -> {
|
case WHITELIST_DISJ -> {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (whitelistMode) {
|
switch (whitelistMode) {
|
||||||
case BLACKLIST, WHITELIST_DISJ -> {
|
case BLACKLIST, WHITELIST_DISJ -> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case WHITELIST_CONJ -> {
|
case WHITELIST_CONJ -> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (whitelistMode) {
|
return switch (whitelistMode) {
|
||||||
case BLACKLIST, WHITELIST_CONJ -> true;
|
case BLACKLIST, WHITELIST_CONJ -> true;
|
||||||
case WHITELIST_DISJ -> false;
|
case WHITELIST_DISJ -> false;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveHoveringInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
|
||||||
import com.simibubi.create.content.kinetics.belt.BeltBlockEntity;
|
import com.simibubi.create.content.kinetics.belt.BeltBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.belt.BeltHelper;
|
import com.simibubi.create.content.kinetics.belt.BeltHelper;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
||||||
|
@ -28,10 +28,10 @@ import com.simibubi.create.foundation.item.ItemHelper.ExtractionCountMode;
|
||||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.lib.visualization.VisualizationHelper;
|
import dev.engine_room.flywheel.lib.visualization.VisualizationHelper;
|
||||||
import net.createmod.catnip.math.BlockFace;
|
|
||||||
import net.createmod.catnip.math.VecHelper;
|
|
||||||
import net.createmod.catnip.animation.LerpedFloat;
|
import net.createmod.catnip.animation.LerpedFloat;
|
||||||
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
||||||
|
import net.createmod.catnip.math.BlockFace;
|
||||||
|
import net.createmod.catnip.math.VecHelper;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
|
@ -346,14 +346,14 @@ public class FunnelBlockEntity extends SmartBlockEntity implements IHaveHovering
|
||||||
if (!(blockState.getBlock() instanceof BeltFunnelBlock))
|
if (!(blockState.getBlock() instanceof BeltFunnelBlock))
|
||||||
return -1 / 16f;
|
return -1 / 16f;
|
||||||
switch (blockState.getValue(BeltFunnelBlock.SHAPE)) {
|
switch (blockState.getValue(BeltFunnelBlock.SHAPE)) {
|
||||||
default:
|
default:
|
||||||
case RETRACTED:
|
case RETRACTED:
|
||||||
return 0;
|
return 0;
|
||||||
case EXTENDED:
|
case EXTENDED:
|
||||||
return 8 / 16f;
|
return 8 / 16f;
|
||||||
case PULLING:
|
case PULLING:
|
||||||
case PUSHING:
|
case PUSHING:
|
||||||
return -2 / 16f;
|
return -2 / 16f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveHoveringInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
|
||||||
import com.simibubi.create.content.logistics.box.PackageItem;
|
import com.simibubi.create.content.logistics.box.PackageItem;
|
||||||
import com.simibubi.create.content.logistics.box.PackageStyles;
|
import com.simibubi.create.content.logistics.box.PackageStyles;
|
||||||
import com.simibubi.create.content.logistics.packagePort.PackagePortBlockEntity;
|
import com.simibubi.create.content.logistics.packagePort.PackagePortBlockEntity;
|
||||||
|
@ -15,10 +15,10 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
|
||||||
import com.simibubi.create.foundation.item.ItemHelper;
|
import com.simibubi.create.foundation.item.ItemHelper;
|
||||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||||
|
|
||||||
import net.createmod.catnip.data.Iterate;
|
|
||||||
import net.createmod.catnip.nbt.NBTHelper;
|
|
||||||
import net.createmod.catnip.animation.LerpedFloat;
|
import net.createmod.catnip.animation.LerpedFloat;
|
||||||
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
||||||
|
import net.createmod.catnip.data.Iterate;
|
||||||
|
import net.createmod.catnip.nbt.NBTHelper;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
|
@ -35,6 +35,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities.ItemHandler;
|
import net.neoforged.neoforge.capabilities.Capabilities.ItemHandler;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
|
@ -255,7 +256,8 @@ public class FrogportBlockEntity extends PackagePortBlockEntity implements IHave
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onOpenChange(boolean open) {}
|
protected void onOpenChange(boolean open) {
|
||||||
|
}
|
||||||
|
|
||||||
public void tryPullingFromOwnAndAdjacentInventories() {
|
public void tryPullingFromOwnAndAdjacentInventories() {
|
||||||
if (isAnimationInProgress())
|
if (isAnimationInProgress())
|
||||||
|
|
|
@ -10,8 +10,8 @@ import java.util.stream.IntStream;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
|
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
|
||||||
import com.simibubi.create.content.contraptions.actors.seat.SeatEntity;
|
import com.simibubi.create.content.contraptions.actors.seat.SeatEntity;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveHoveringInformation;
|
|
||||||
import com.simibubi.create.content.logistics.BigItemStack;
|
import com.simibubi.create.content.logistics.BigItemStack;
|
||||||
import com.simibubi.create.content.logistics.filter.FilterItem;
|
import com.simibubi.create.content.logistics.filter.FilterItem;
|
||||||
import com.simibubi.create.content.logistics.filter.FilterItemStack;
|
import com.simibubi.create.content.logistics.filter.FilterItemStack;
|
||||||
|
@ -101,7 +101,7 @@ public class StockTickerBlockEntity extends StockCheckingBlockEntity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean broadcastPackageRequest(RequestType type, PackageOrder order, IItemHandler ignoredHandler,
|
public boolean broadcastPackageRequest(RequestType type, PackageOrder order, IItemHandler ignoredHandler,
|
||||||
String address) {
|
String address) {
|
||||||
boolean result = super.broadcastPackageRequest(type, order, ignoredHandler, address);
|
boolean result = super.broadcastPackageRequest(type, order, ignoredHandler, address);
|
||||||
previouslyUsedAddress = address;
|
previouslyUsedAddress = address;
|
||||||
notifyUpdate();
|
notifyUpdate();
|
||||||
|
@ -182,7 +182,7 @@ public class StockTickerBlockEntity extends StockCheckingBlockEntity implements
|
||||||
List<BigItemStack> inCategory = new ArrayList<>();
|
List<BigItemStack> inCategory = new ArrayList<>();
|
||||||
if (!filter.isEmpty()) {
|
if (!filter.isEmpty()) {
|
||||||
FilterItemStack filterItemStack = FilterItemStack.of(filter);
|
FilterItemStack filterItemStack = FilterItemStack.of(filter);
|
||||||
for (Iterator<BigItemStack> iterator = newlyReceivedStockSnapshot.iterator(); iterator.hasNext();) {
|
for (Iterator<BigItemStack> iterator = newlyReceivedStockSnapshot.iterator(); iterator.hasNext(); ) {
|
||||||
BigItemStack bigStack = iterator.next();
|
BigItemStack bigStack = iterator.next();
|
||||||
if (!filterItemStack.test(level, bigStack.stack))
|
if (!filterItemStack.test(level, bigStack.stack))
|
||||||
continue;
|
continue;
|
||||||
|
@ -266,8 +266,8 @@ public class StockTickerBlockEntity extends StockCheckingBlockEntity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getDisplayName() {
|
public Component getDisplayName() {
|
||||||
return Component.empty();
|
return Component.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,8 +280,8 @@ public class StockTickerBlockEntity extends StockCheckingBlockEntity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getDisplayName() {
|
public Component getDisplayName() {
|
||||||
return Component.empty();
|
return Component.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.kinetics.belt.BeltBlockEntity;
|
import com.simibubi.create.content.kinetics.belt.BeltBlockEntity;
|
||||||
import com.simibubi.create.content.kinetics.belt.BeltHelper;
|
import com.simibubi.create.content.kinetics.belt.BeltHelper;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
||||||
|
@ -34,8 +34,8 @@ import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||||
|
|
||||||
import net.createmod.catnip.data.Couple;
|
import net.createmod.catnip.data.Couple;
|
||||||
import net.createmod.catnip.data.Iterate;
|
import net.createmod.catnip.data.Iterate;
|
||||||
import net.createmod.catnip.nbt.NBTHelper;
|
|
||||||
import net.createmod.catnip.lang.Lang;
|
import net.createmod.catnip.lang.Lang;
|
||||||
|
import net.createmod.catnip.nbt.NBTHelper;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -53,6 +53,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
import net.neoforged.neoforge.items.IItemHandler;
|
import net.neoforged.neoforge.items.IItemHandler;
|
||||||
|
@ -180,7 +181,7 @@ public class BrassTunnelBlockEntity extends BeltTunnelBlockEntity implements IHa
|
||||||
if (distributionTargets.getFirst()
|
if (distributionTargets.getFirst()
|
||||||
.isEmpty()
|
.isEmpty()
|
||||||
&& distributionTargets.getSecond()
|
&& distributionTargets.getSecond()
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (newItemArrived) {
|
if (newItemArrived) {
|
||||||
|
@ -383,7 +384,7 @@ public class BrassTunnelBlockEntity extends BeltTunnelBlockEntity implements IHa
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected ItemStack insertIntoTunnel(BrassTunnelBlockEntity tunnel, Direction side, ItemStack stack,
|
protected ItemStack insertIntoTunnel(BrassTunnelBlockEntity tunnel, Direction side, ItemStack stack,
|
||||||
boolean simulate) {
|
boolean simulate) {
|
||||||
if (stack.isEmpty())
|
if (stack.isEmpty())
|
||||||
return stack;
|
return stack;
|
||||||
if (!tunnel.testFlapFilter(side, stack))
|
if (!tunnel.testFlapFilter(side, stack))
|
||||||
|
@ -521,7 +522,7 @@ public class BrassTunnelBlockEntity extends BeltTunnelBlockEntity implements IHa
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addValidOutputsOf(BrassTunnelBlockEntity tunnelBE,
|
private void addValidOutputsOf(BrassTunnelBlockEntity tunnelBE,
|
||||||
List<Pair<BrassTunnelBlockEntity, Direction>> validOutputs) {
|
List<Pair<BrassTunnelBlockEntity, Direction>> validOutputs) {
|
||||||
syncSet.add(tunnelBE);
|
syncSet.add(tunnelBE);
|
||||||
BeltBlockEntity below = BeltHelper.getSegmentBE(level, tunnelBE.worldPosition.below());
|
BeltBlockEntity below = BeltHelper.getSegmentBE(level, tunnelBE.worldPosition.below());
|
||||||
if (below == null)
|
if (below == null)
|
||||||
|
@ -795,9 +796,9 @@ public class BrassTunnelBlockEntity extends BeltTunnelBlockEntity implements IHa
|
||||||
|
|
||||||
CreateLang.translate("tooltip.brass_tunnel.contains").style(ChatFormatting.WHITE).forGoggles(tooltip);
|
CreateLang.translate("tooltip.brass_tunnel.contains").style(ChatFormatting.WHITE).forGoggles(tooltip);
|
||||||
for (ItemStack item : allStacks) {
|
for (ItemStack item : allStacks) {
|
||||||
CreateLang.translate("tooltip.brass_tunnel.contains_entry",
|
CreateLang.translate("tooltip.brass_tunnel.contains_entry",
|
||||||
Component.translatable(item.getDescriptionId()).getString(), item.getCount())
|
Component.translatable(item.getDescriptionId()).getString(), item.getCount())
|
||||||
.style(ChatFormatting.GRAY).forGoggles(tooltip);
|
.style(ChatFormatting.GRAY).forGoggles(tooltip);
|
||||||
}
|
}
|
||||||
CreateLang.translate("tooltip.brass_tunnel.retrieve").style(ChatFormatting.DARK_GRAY).forGoggles(tooltip);
|
CreateLang.translate("tooltip.brass_tunnel.retrieve").style(ChatFormatting.DARK_GRAY).forGoggles(tooltip);
|
||||||
|
|
||||||
|
|
|
@ -159,10 +159,7 @@ public class ItemVaultBlock extends Block implements IWrenchable, IBE<ItemVaultB
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
|
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
|
||||||
return getBlockEntityOptional(pLevel, pPos)
|
return ItemHelper.calcRedstoneFromBlockEntity(this, pLevel, pPos);
|
||||||
.map(vte -> pLevel.getCapability(Capabilities.ItemHandler.BLOCK, vte.getBlockPos(), null))
|
|
||||||
.map(ItemHelper::calcRedstoneFromInventory)
|
|
||||||
.orElse(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,7 +10,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.simibubi.create.AllBlockEntityTypes;
|
import com.simibubi.create.AllBlockEntityTypes;
|
||||||
import com.simibubi.create.AllParticleTypes;
|
import com.simibubi.create.AllParticleTypes;
|
||||||
import com.simibubi.create.AllTags;
|
import com.simibubi.create.AllTags;
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.content.fluids.FluidFX;
|
import com.simibubi.create.content.fluids.FluidFX;
|
||||||
import com.simibubi.create.content.fluids.particle.FluidParticleData;
|
import com.simibubi.create.content.fluids.particle.FluidParticleData;
|
||||||
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
import com.simibubi.create.content.kinetics.belt.behaviour.DirectBeltInputBehaviour;
|
||||||
|
@ -31,14 +31,14 @@ import com.simibubi.create.foundation.utility.BlockHelper;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
||||||
import net.createmod.catnip.animation.AnimationTickHolder;
|
import net.createmod.catnip.animation.AnimationTickHolder;
|
||||||
|
import net.createmod.catnip.animation.LerpedFloat;
|
||||||
|
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
||||||
import net.createmod.catnip.data.Couple;
|
import net.createmod.catnip.data.Couple;
|
||||||
import net.createmod.catnip.data.IntAttached;
|
import net.createmod.catnip.data.IntAttached;
|
||||||
import net.createmod.catnip.data.Iterate;
|
import net.createmod.catnip.data.Iterate;
|
||||||
import net.createmod.catnip.nbt.NBTHelper;
|
|
||||||
import net.createmod.catnip.math.VecHelper;
|
|
||||||
import net.createmod.catnip.animation.LerpedFloat;
|
|
||||||
import net.createmod.catnip.animation.LerpedFloat.Chaser;
|
|
||||||
import net.createmod.catnip.lang.LangBuilder;
|
import net.createmod.catnip.lang.LangBuilder;
|
||||||
|
import net.createmod.catnip.math.VecHelper;
|
||||||
|
import net.createmod.catnip.nbt.NBTHelper;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -58,6 +58,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||||
import net.neoforged.neoforge.fluids.FluidStack;
|
import net.neoforged.neoforge.fluids.FluidStack;
|
||||||
|
@ -376,14 +377,14 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
|
|
||||||
IItemHandler targetInv = be == null ? null
|
IItemHandler targetInv = be == null ? null
|
||||||
: Optional.ofNullable(level.getCapability(Capabilities.ItemHandler.BLOCK, be.getBlockPos(), direction.getOpposite()))
|
: Optional.ofNullable(level.getCapability(Capabilities.ItemHandler.BLOCK, be.getBlockPos(), direction.getOpposite()))
|
||||||
.orElse(inserter == null ? null : inserter.getInventory());
|
.orElse(inserter == null ? null : inserter.getInventory());
|
||||||
|
|
||||||
IFluidHandler targetTank = be == null ? null
|
IFluidHandler targetTank = be == null ? null
|
||||||
: level.getCapability(Capabilities.FluidHandler.BLOCK, be.getBlockPos(), direction.getOpposite());
|
: level.getCapability(Capabilities.FluidHandler.BLOCK, be.getBlockPos(), direction.getOpposite());
|
||||||
|
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
|
||||||
for (Iterator<ItemStack> iterator = spoutputBuffer.iterator(); iterator.hasNext();) {
|
for (Iterator<ItemStack> iterator = spoutputBuffer.iterator(); iterator.hasNext(); ) {
|
||||||
ItemStack itemStack = iterator.next();
|
ItemStack itemStack = iterator.next();
|
||||||
|
|
||||||
if (direction == Direction.DOWN) {
|
if (direction == Direction.DOWN) {
|
||||||
|
@ -413,7 +414,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
itemStack.setCount(remainder.getCount());
|
itemStack.setCount(remainder.getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Iterator<FluidStack> iterator = spoutputFluidBuffer.iterator(); iterator.hasNext();) {
|
for (Iterator<FluidStack> iterator = spoutputFluidBuffer.iterator(); iterator.hasNext(); ) {
|
||||||
FluidStack fluidStack = iterator.next();
|
FluidStack fluidStack = iterator.next();
|
||||||
|
|
||||||
if (direction == Direction.DOWN) {
|
if (direction == Direction.DOWN) {
|
||||||
|
@ -527,7 +528,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
be == null ? null : BlockEntityBehaviour.get(level, be.getBlockPos(), InvManipulationBehaviour.TYPE);
|
be == null ? null : BlockEntityBehaviour.get(level, be.getBlockPos(), InvManipulationBehaviour.TYPE);
|
||||||
IItemHandler targetInv = be == null ? null
|
IItemHandler targetInv = be == null ? null
|
||||||
: Optional.ofNullable(level.getCapability(Capabilities.ItemHandler.BLOCK, be.getBlockPos(), direction.getOpposite()))
|
: Optional.ofNullable(level.getCapability(Capabilities.ItemHandler.BLOCK, be.getBlockPos(), direction.getOpposite()))
|
||||||
.orElse(inserter == null ? null : inserter.getInventory());
|
.orElse(inserter == null ? null : inserter.getInventory());
|
||||||
IFluidHandler targetTank = be == null ? null
|
IFluidHandler targetTank = be == null ? null
|
||||||
: level.getCapability(Capabilities.FluidHandler.BLOCK, be.getBlockPos(), direction.getOpposite());
|
: level.getCapability(Capabilities.FluidHandler.BLOCK, be.getBlockPos(), direction.getOpposite());
|
||||||
boolean externalTankNotPresent = targetTank == null;
|
boolean externalTankNotPresent = targetTank == null;
|
||||||
|
@ -572,7 +573,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean acceptFluidOutputsIntoBasin(List<FluidStack> outputFluids, boolean simulate,
|
private boolean acceptFluidOutputsIntoBasin(List<FluidStack> outputFluids, boolean simulate,
|
||||||
IFluidHandler targetTank) {
|
IFluidHandler targetTank) {
|
||||||
for (FluidStack fluidStack : outputFluids) {
|
for (FluidStack fluidStack : outputFluids) {
|
||||||
FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE;
|
FluidAction action = simulate ? FluidAction.SIMULATE : FluidAction.EXECUTE;
|
||||||
int fill = targetTank instanceof SmartFluidTankBehaviour.InternalFluidHandler
|
int fill = targetTank instanceof SmartFluidTankBehaviour.InternalFluidHandler
|
||||||
|
@ -744,7 +745,7 @@ public class BasinBlockEntity extends SmartBlockEntity implements IHaveGoggleInf
|
||||||
ItemStack stackInSlot = itemCapability.getStackInSlot(i);
|
ItemStack stackInSlot = itemCapability.getStackInSlot(i);
|
||||||
if (stackInSlot.isEmpty())
|
if (stackInSlot.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
CreateLang.text("")
|
CreateLang.text("")
|
||||||
.add(Component.translatable(stackInSlot.getDescriptionId())
|
.add(Component.translatable(stackInSlot.getDescriptionId())
|
||||||
.withStyle(ChatFormatting.GRAY))
|
.withStyle(ChatFormatting.GRAY))
|
||||||
.add(CreateLang.text(" x" + stackInSlot.getCount())
|
.add(CreateLang.text(" x" + stackInSlot.getCount())
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.simibubi.create.content.processing.burner;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
|
import com.simibubi.create.api.contraption.train.TrainConductorHandler;
|
||||||
import com.simibubi.create.content.contraptions.AbstractContraptionEntity;
|
import com.simibubi.create.content.contraptions.AbstractContraptionEntity;
|
||||||
import com.simibubi.create.content.contraptions.Contraption;
|
import com.simibubi.create.content.contraptions.Contraption;
|
||||||
import com.simibubi.create.content.contraptions.behaviour.MovingInteractionBehaviour;
|
import com.simibubi.create.content.contraptions.behaviour.MovingInteractionBehaviour;
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock.HeatLevel;
|
|
||||||
import com.simibubi.create.content.trains.entity.CarriageContraption;
|
import com.simibubi.create.content.trains.entity.CarriageContraption;
|
||||||
import com.simibubi.create.content.trains.entity.CarriageContraptionEntity;
|
import com.simibubi.create.content.trains.entity.CarriageContraptionEntity;
|
||||||
import com.simibubi.create.content.trains.entity.Train;
|
import com.simibubi.create.content.trains.entity.Train;
|
||||||
|
@ -21,9 +21,21 @@ import net.minecraft.core.Direction;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
|
||||||
|
|
||||||
public class BlazeBurnerInteractionBehaviour extends MovingInteractionBehaviour {
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class BlockBasedTrainConductorInteractionBehaviour extends MovingInteractionBehaviour {
|
||||||
|
|
||||||
|
private final Predicate<BlockState> isValidConductor;
|
||||||
|
private final TrainConductorHandler.UpdateScheduleCallback callback;
|
||||||
|
|
||||||
|
public BlockBasedTrainConductorInteractionBehaviour(Predicate<BlockState> isValidConductor, TrainConductorHandler.UpdateScheduleCallback callback) {
|
||||||
|
this.isValidConductor = isValidConductor;
|
||||||
|
this.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handlePlayerInteraction(Player player, InteractionHand activeHand, BlockPos localPos,
|
public boolean handlePlayerInteraction(Player player, InteractionHand activeHand, BlockPos localPos,
|
||||||
|
@ -40,8 +52,7 @@ public class BlazeBurnerInteractionBehaviour extends MovingInteractionBehaviour
|
||||||
|
|
||||||
StructureBlockInfo info = carriageContraption.getBlocks()
|
StructureBlockInfo info = carriageContraption.getBlocks()
|
||||||
.get(localPos);
|
.get(localPos);
|
||||||
if (info == null || !info.state().hasProperty(BlazeBurnerBlock.HEAT_LEVEL)
|
if (info == null || !isValidConductor.test(info.state()))
|
||||||
|| info.state().getValue(BlazeBurnerBlock.HEAT_LEVEL) == HeatLevel.NONE)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Direction assemblyDirection = carriageContraption.getAssemblyDirection();
|
Direction assemblyDirection = carriageContraption.getAssemblyDirection();
|
||||||
|
@ -74,6 +85,7 @@ public class BlazeBurnerInteractionBehaviour extends MovingInteractionBehaviour
|
||||||
train.runtime.isAutoSchedule ? "schedule.auto_removed_from_train" : "schedule.removed_from_train"),
|
train.runtime.isAutoSchedule ? "schedule.auto_removed_from_train" : "schedule.removed_from_train"),
|
||||||
true);
|
true);
|
||||||
player.setItemInHand(activeHand, train.runtime.returnSchedule(player.registryAccess()));
|
player.setItemInHand(activeHand, train.runtime.returnSchedule(player.registryAccess()));
|
||||||
|
callback.update(false, info.state(), newBlockState -> setBlockState(localPos, contraptionEntity, newBlockState));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +101,7 @@ public class BlazeBurnerInteractionBehaviour extends MovingInteractionBehaviour
|
||||||
player.displayClientMessage(CreateLang.translateDirect("schedule.no_stops"), true);
|
player.displayClientMessage(CreateLang.translateDirect("schedule.no_stops"), true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
callback.update(true, info.state(), newBlockState -> setBlockState(localPos, contraptionEntity, newBlockState));
|
||||||
train.runtime.setSchedule(schedule, false);
|
train.runtime.setSchedule(schedule, false);
|
||||||
AllAdvancements.CONDUCTOR.awardTo(player);
|
AllAdvancements.CONDUCTOR.awardTo(player);
|
||||||
AllSoundEvents.CONFIRM.playOnServer(player.level(), player.blockPosition(), 1, 1);
|
AllSoundEvents.CONFIRM.playOnServer(player.level(), player.blockPosition(), 1, 1);
|
||||||
|
@ -105,4 +117,10 @@ public class BlazeBurnerInteractionBehaviour extends MovingInteractionBehaviour
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setBlockState(BlockPos localPos, AbstractContraptionEntity contraption, BlockState newState) {
|
||||||
|
StructureTemplate.StructureBlockInfo info = contraption.getContraption().getBlocks().get(localPos);
|
||||||
|
if (info != null) {
|
||||||
|
setContraptionBlockData(contraption, localPos, new StructureTemplate.StructureBlockInfo(info.pos(), newState, info.nbt()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -5,11 +5,11 @@ import org.joml.Quaternionfc;
|
||||||
|
|
||||||
import dev.engine_room.flywheel.api.instance.InstanceHandle;
|
import dev.engine_room.flywheel.api.instance.InstanceHandle;
|
||||||
import dev.engine_room.flywheel.api.instance.InstanceType;
|
import dev.engine_room.flywheel.api.instance.InstanceType;
|
||||||
import dev.engine_room.flywheel.lib.instance.ColoredLitInstance;
|
import dev.engine_room.flywheel.lib.instance.ColoredLitOverlayInstance;
|
||||||
import net.createmod.catnip.render.SpriteShiftEntry;
|
import net.createmod.catnip.render.SpriteShiftEntry;
|
||||||
import net.minecraft.core.Vec3i;
|
import net.minecraft.core.Vec3i;
|
||||||
|
|
||||||
public class ScrollInstance extends ColoredLitInstance {
|
public class ScrollInstance extends ColoredLitOverlayInstance {
|
||||||
public float x;
|
public float x;
|
||||||
public float y;
|
public float y;
|
||||||
public float z;
|
public float z;
|
||||||
|
@ -27,7 +27,7 @@ public class ScrollInstance extends ColoredLitInstance {
|
||||||
public float scaleU;
|
public float scaleU;
|
||||||
public float scaleV;
|
public float scaleV;
|
||||||
|
|
||||||
public ScrollInstance(InstanceType<? extends ColoredLitInstance> type, InstanceHandle handle) {
|
public ScrollInstance(InstanceType<? extends ColoredLitOverlayInstance> type, InstanceHandle handle) {
|
||||||
super(type, handle);
|
super(type, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.content.redstone.analogLever;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||||
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
|
@ -3,10 +3,13 @@ package com.simibubi.create.content.redstone.link.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.simibubi.create.AllDataComponents;
|
||||||
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.AllSoundEvents;
|
import com.simibubi.create.AllSoundEvents;
|
||||||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||||
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
|
||||||
|
|
||||||
|
import net.createmod.catnip.codecs.CatnipCodecUtils;
|
||||||
import net.createmod.catnip.platform.CatnipServices;
|
import net.createmod.catnip.platform.CatnipServices;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -20,16 +23,17 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.component.ItemContainerContents;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.api.distmarker.OnlyIn;
|
import net.neoforged.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
public class LecternControllerBlockEntity extends SmartBlockEntity {
|
public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
|
private ItemContainerContents controllerData = ItemContainerContents.EMPTY;
|
||||||
private ItemStack controller = ItemStack.EMPTY;
|
|
||||||
private UUID user;
|
private UUID user;
|
||||||
private UUID prevUser; // used only on client
|
private UUID prevUser; // used only on client
|
||||||
private boolean deactivatedThisTick; // used only on server
|
private boolean deactivatedThisTick; // used only on server
|
||||||
|
@ -44,7 +48,7 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
@Override
|
@Override
|
||||||
protected void write(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
protected void write(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
||||||
super.write(compound, registries, clientPacket);
|
super.write(compound, registries, clientPacket);
|
||||||
compound.put("Controller", controller.saveOptional(registries));
|
compound.put("ControllerData", CatnipCodecUtils.encode(ItemContainerContents.CODEC, controllerData).orElseThrow());
|
||||||
if (user != null)
|
if (user != null)
|
||||||
compound.putUUID("User", user);
|
compound.putUUID("User", user);
|
||||||
}
|
}
|
||||||
|
@ -52,18 +56,20 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
@Override
|
@Override
|
||||||
public void writeSafe(CompoundTag compound, HolderLookup.Provider registries) {
|
public void writeSafe(CompoundTag compound, HolderLookup.Provider registries) {
|
||||||
super.writeSafe(compound, registries);
|
super.writeSafe(compound, registries);
|
||||||
compound.put("Controller", controller.saveOptional(registries));
|
compound.put("ControllerData", CatnipCodecUtils.encode(ItemContainerContents.CODEC, controllerData).orElseThrow());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
||||||
super.read(compound, registries, clientPacket);
|
super.read(compound, registries, clientPacket);
|
||||||
controller = ItemStack.parseOptional(registries, compound.getCompound("Controller"));
|
|
||||||
|
controllerData = CatnipCodecUtils.decode(ItemContainerContents.CODEC, compound.getCompound("ControllerData"))
|
||||||
|
.orElse(ItemContainerContents.EMPTY);
|
||||||
user = compound.hasUUID("User") ? compound.getUUID("User") : null;
|
user = compound.hasUUID("User") ? compound.getUUID("User") : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getController() {
|
public ItemStack getController() {
|
||||||
return controller;
|
return getController();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasUser() { return user != null; }
|
public boolean hasUser() { return user != null; }
|
||||||
|
@ -139,8 +145,8 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setController(ItemStack newController) {
|
public void setController(ItemStack newController) {
|
||||||
controller = newController;
|
|
||||||
if (newController != null) {
|
if (newController != null) {
|
||||||
|
controllerData = newController.getOrDefault(AllDataComponents.LINKED_CONTROLLER_ITEMS, ItemContainerContents.EMPTY);
|
||||||
AllSoundEvents.CONTROLLER_PUT.playOnServer(level, worldPosition);
|
AllSoundEvents.CONTROLLER_PUT.playOnServer(level, worldPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +155,7 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
ItemStack newController = stack.copy();
|
ItemStack newController = stack.copy();
|
||||||
stack.setCount(0);
|
stack.setCount(0);
|
||||||
if (player.getItemInHand(hand).isEmpty()) {
|
if (player.getItemInHand(hand).isEmpty()) {
|
||||||
player.setItemInHand(hand, controller);
|
player.setItemInHand(hand, createLinkedController());
|
||||||
} else {
|
} else {
|
||||||
dropController(state);
|
dropController(state);
|
||||||
}
|
}
|
||||||
|
@ -165,10 +171,10 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
double x = worldPosition.getX() + 0.5 + 0.25 * dir.getStepX();
|
double x = worldPosition.getX() + 0.5 + 0.25 * dir.getStepX();
|
||||||
double y = worldPosition.getY() + 1;
|
double y = worldPosition.getY() + 1;
|
||||||
double z = worldPosition.getZ() + 0.5 + 0.25 * dir.getStepZ();
|
double z = worldPosition.getZ() + 0.5 + 0.25 * dir.getStepZ();
|
||||||
ItemEntity itementity = new ItemEntity(level, x, y, z, controller.copy());
|
ItemEntity itementity = new ItemEntity(level, x, y, z, createLinkedController());
|
||||||
itementity.setDefaultPickUpDelay();
|
itementity.setDefaultPickUpDelay();
|
||||||
level.addFreshEntity(itementity);
|
level.addFreshEntity(itementity);
|
||||||
controller = null;
|
controllerData = ItemContainerContents.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean playerInRange(Player player, Level world, BlockPos pos) {
|
public static boolean playerInRange(Player player, Level world, BlockPos pos) {
|
||||||
|
@ -177,4 +183,9 @@ public class LecternControllerBlockEntity extends SmartBlockEntity {
|
||||||
return player.distanceToSqr(Vec3.atCenterOf(pos)) < reach * reach;
|
return player.distanceToSqr(Vec3.atCenterOf(pos)) < reach * reach;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ItemStack createLinkedController() {
|
||||||
|
ItemStack stack = AllItems.LINKED_CONTROLLER.asStack();
|
||||||
|
stack.set(AllDataComponents.LINKED_CONTROLLER_ITEMS, controllerData);
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class NixieTubeRenderer extends SafeBlockEntityRenderer<NixieTubeBlockEnt
|
||||||
float charWidth = fontRenderer.width(c);
|
float charWidth = fontRenderer.width(c);
|
||||||
float shadowOffset = .5f;
|
float shadowOffset = .5f;
|
||||||
float flicker = r.nextFloat();
|
float flicker = r.nextFloat();
|
||||||
Couple<Integer> couple = DyeHelper.DYE_TABLE.get(color);
|
Couple<Integer> couple = DyeHelper.getDyeColors(color);
|
||||||
int brightColor = couple.getFirst();
|
int brightColor = couple.getFirst();
|
||||||
int darkColor = couple.getSecond();
|
int darkColor = couple.getSecond();
|
||||||
int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4);
|
int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4);
|
||||||
|
|
|
@ -5,9 +5,7 @@ import java.util.function.Consumer;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.simibubi.create.AllBlocks;
|
|
||||||
import com.simibubi.create.AllPartialModels;
|
import com.simibubi.create.AllPartialModels;
|
||||||
import com.simibubi.create.content.kinetics.simpleRelays.ShaftBlock;
|
|
||||||
|
|
||||||
import dev.engine_room.flywheel.api.instance.Instance;
|
import dev.engine_room.flywheel.api.instance.Instance;
|
||||||
import dev.engine_room.flywheel.api.visualization.VisualizationContext;
|
import dev.engine_room.flywheel.api.visualization.VisualizationContext;
|
||||||
|
@ -15,7 +13,6 @@ import dev.engine_room.flywheel.lib.instance.InstanceTypes;
|
||||||
import dev.engine_room.flywheel.lib.instance.TransformedInstance;
|
import dev.engine_room.flywheel.lib.instance.TransformedInstance;
|
||||||
import dev.engine_room.flywheel.lib.model.Models;
|
import dev.engine_room.flywheel.lib.model.Models;
|
||||||
import net.createmod.catnip.math.AngleHelper;
|
import net.createmod.catnip.math.AngleHelper;
|
||||||
import net.createmod.ponder.render.VirtualRenderHelper;
|
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
|
||||||
|
@ -25,10 +22,10 @@ public class StandardBogeyVisual implements BogeyVisual {
|
||||||
|
|
||||||
public StandardBogeyVisual(VisualizationContext ctx, float partialTick, boolean inContraption) {
|
public StandardBogeyVisual(VisualizationContext ctx, float partialTick, boolean inContraption) {
|
||||||
var shaftInstancer = ctx.instancerProvider()
|
var shaftInstancer = ctx.instancerProvider()
|
||||||
.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(AllBlocks.SHAFT.getDefaultState()
|
.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SHAFT));
|
||||||
.setValue(ShaftBlock.AXIS, Direction.Axis.Z)));
|
|
||||||
shaft1 = shaftInstancer.createInstance();
|
shaft1 = shaftInstancer.createInstance().rotateToFace(Direction.SOUTH);
|
||||||
shaft2 = shaftInstancer.createInstance();
|
shaft2 = shaftInstancer.createInstance().rotateToFace(Direction.SOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -147,10 +144,9 @@ public class StandardBogeyVisual implements BogeyVisual {
|
||||||
public Large(VisualizationContext ctx, float partialTick, boolean inContraption) {
|
public Large(VisualizationContext ctx, float partialTick, boolean inContraption) {
|
||||||
super(ctx, partialTick, inContraption);
|
super(ctx, partialTick, inContraption);
|
||||||
var secondaryShaftInstancer = ctx.instancerProvider()
|
var secondaryShaftInstancer = ctx.instancerProvider()
|
||||||
.instancer(InstanceTypes.TRANSFORMED, VirtualRenderHelper.blockModel(AllBlocks.SHAFT.getDefaultState()
|
.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.SHAFT));
|
||||||
.setValue(ShaftBlock.AXIS, Direction.Axis.X)));
|
secondaryShaft1 = secondaryShaftInstancer.createInstance().rotateToFace(Direction.EAST);
|
||||||
secondaryShaft1 = secondaryShaftInstancer.createInstance();
|
secondaryShaft2 = secondaryShaftInstancer.createInstance().rotateToFace(Direction.EAST);
|
||||||
secondaryShaft2 = secondaryShaftInstancer.createInstance();
|
|
||||||
drive = ctx.instancerProvider()
|
drive = ctx.instancerProvider()
|
||||||
.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.BOGEY_DRIVE))
|
.instancer(InstanceTypes.TRANSFORMED, Models.partial(AllPartialModels.BOGEY_DRIVE))
|
||||||
.createInstance();
|
.createInstance();
|
||||||
|
|
|
@ -319,7 +319,7 @@ public class FlapDisplayBlockEntity extends KineticBlockEntity {
|
||||||
public int getLineColor(int line) {
|
public int getLineColor(int line) {
|
||||||
DyeColor color = colour[line];
|
DyeColor color = colour[line];
|
||||||
return color == null ? 0xFF_D3C6BA
|
return color == null ? 0xFF_D3C6BA
|
||||||
: DyeHelper.DYE_TABLE.get(color)
|
: DyeHelper.getDyeColors(color)
|
||||||
.getFirst() | 0xFF_000000;
|
.getFirst() | 0xFF_000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import com.simibubi.create.api.contraption.train.TrainConductorHandler;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
@ -16,8 +18,6 @@ import com.simibubi.create.content.contraptions.ContraptionType;
|
||||||
import com.simibubi.create.content.contraptions.MountedStorageManager;
|
import com.simibubi.create.content.contraptions.MountedStorageManager;
|
||||||
import com.simibubi.create.content.contraptions.actors.trainControls.ControlsBlock;
|
import com.simibubi.create.content.contraptions.actors.trainControls.ControlsBlock;
|
||||||
import com.simibubi.create.content.contraptions.minecart.TrainCargoManager;
|
import com.simibubi.create.content.contraptions.minecart.TrainCargoManager;
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
|
|
||||||
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock.HeatLevel;
|
|
||||||
import com.simibubi.create.content.trains.bogey.AbstractBogeyBlock;
|
import com.simibubi.create.content.trains.bogey.AbstractBogeyBlock;
|
||||||
import com.simibubi.create.foundation.utility.CreateLang;
|
import com.simibubi.create.foundation.utility.CreateLang;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class CarriageContraption extends Contraption {
|
||||||
private boolean forwardControls;
|
private boolean forwardControls;
|
||||||
private boolean backwardControls;
|
private boolean backwardControls;
|
||||||
|
|
||||||
public Couple<Boolean> blazeBurnerConductors;
|
public Couple<Boolean> blockConductors;
|
||||||
public Map<BlockPos, Couple<Boolean>> conductorSeats;
|
public Map<BlockPos, Couple<Boolean>> conductorSeats;
|
||||||
public ArrivalSoundQueue soundQueue;
|
public ArrivalSoundQueue soundQueue;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class CarriageContraption extends Contraption {
|
||||||
private int bogeys;
|
private int bogeys;
|
||||||
private boolean sidewaysControls;
|
private boolean sidewaysControls;
|
||||||
private BlockPos secondBogeyPos;
|
private BlockPos secondBogeyPos;
|
||||||
private List<BlockPos> assembledBlazeBurners;
|
private List<BlockPos> assembledBlockConductors;
|
||||||
|
|
||||||
// render
|
// render
|
||||||
public int portalCutoffMin;
|
public int portalCutoffMin;
|
||||||
|
@ -71,8 +71,8 @@ public class CarriageContraption extends Contraption {
|
||||||
|
|
||||||
public CarriageContraption() {
|
public CarriageContraption() {
|
||||||
conductorSeats = new HashMap<>();
|
conductorSeats = new HashMap<>();
|
||||||
assembledBlazeBurners = new ArrayList<>();
|
assembledBlockConductors = new ArrayList<>();
|
||||||
blazeBurnerConductors = Couple.create(false, false);
|
blockConductors = Couple.create(false, false);
|
||||||
soundQueue = new ArrivalSoundQueue();
|
soundQueue = new ArrivalSoundQueue();
|
||||||
portalCutoffMin = Integer.MIN_VALUE;
|
portalCutoffMin = Integer.MIN_VALUE;
|
||||||
portalCutoffMax = Integer.MAX_VALUE;
|
portalCutoffMax = Integer.MAX_VALUE;
|
||||||
|
@ -102,10 +102,10 @@ public class CarriageContraption extends Contraption {
|
||||||
if (sidewaysControls)
|
if (sidewaysControls)
|
||||||
throw new AssemblyException(CreateLang.translateDirect("train_assembly.sideways_controls"));
|
throw new AssemblyException(CreateLang.translateDirect("train_assembly.sideways_controls"));
|
||||||
|
|
||||||
for (BlockPos blazePos : assembledBlazeBurners)
|
for (BlockPos blazePos : assembledBlockConductors)
|
||||||
for (Direction direction : Iterate.directionsInAxis(assemblyDirection.getAxis()))
|
for (Direction direction : Iterate.directionsInAxis(assemblyDirection.getAxis()))
|
||||||
if (inControl(blazePos, direction))
|
if (inControl(blazePos, direction))
|
||||||
blazeBurnerConductors.set(direction != assemblyDirection, true);
|
blockConductors.set(direction != assemblyDirection, true);
|
||||||
for (BlockPos seatPos : getSeats())
|
for (BlockPos seatPos : getSeats())
|
||||||
for (Direction direction : Iterate.directionsInAxis(assemblyDirection.getAxis()))
|
for (Direction direction : Iterate.directionsInAxis(assemblyDirection.getAxis()))
|
||||||
if (inControl(seatPos, direction))
|
if (inControl(seatPos, direction))
|
||||||
|
@ -166,9 +166,8 @@ public class CarriageContraption extends Contraption {
|
||||||
captureBE ? world.getBlockEntity(pos) : null);
|
captureBE ? world.getBlockEntity(pos) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AllBlocks.BLAZE_BURNER.has(blockState)
|
if (TrainConductorHandler.CONDUCTOR_HANDLERS.stream().anyMatch(handler -> handler.isValidConductor(blockState)))
|
||||||
&& blockState.getValue(BlazeBurnerBlock.HEAT_LEVEL) != HeatLevel.NONE)
|
assembledBlockConductors.add(toLocalPos(pos));
|
||||||
assembledBlazeBurners.add(toLocalPos(pos));
|
|
||||||
|
|
||||||
if (AllBlocks.TRAIN_CONTROLS.has(blockState)) {
|
if (AllBlocks.TRAIN_CONTROLS.has(blockState)) {
|
||||||
Direction facing = blockState.getValue(ControlsBlock.FACING);
|
Direction facing = blockState.getValue(ControlsBlock.FACING);
|
||||||
|
@ -192,8 +191,8 @@ public class CarriageContraption extends Contraption {
|
||||||
NBTHelper.writeEnum(tag, "AssemblyDirection", getAssemblyDirection());
|
NBTHelper.writeEnum(tag, "AssemblyDirection", getAssemblyDirection());
|
||||||
tag.putBoolean("FrontControls", forwardControls);
|
tag.putBoolean("FrontControls", forwardControls);
|
||||||
tag.putBoolean("BackControls", backwardControls);
|
tag.putBoolean("BackControls", backwardControls);
|
||||||
tag.putBoolean("FrontBlazeConductor", blazeBurnerConductors.getFirst());
|
tag.putBoolean("FrontBlazeConductor", blockConductors.getFirst());
|
||||||
tag.putBoolean("BackBlazeConductor", blazeBurnerConductors.getSecond());
|
tag.putBoolean("BackBlazeConductor", blockConductors.getSecond());
|
||||||
ListTag list = NBTHelper.writeCompoundList(conductorSeats.entrySet(), e -> {
|
ListTag list = NBTHelper.writeCompoundList(conductorSeats.entrySet(), e -> {
|
||||||
CompoundTag compoundTag = new CompoundTag();
|
CompoundTag compoundTag = new CompoundTag();
|
||||||
compoundTag.put("Pos", NbtUtils.writeBlockPos(e.getKey()));
|
compoundTag.put("Pos", NbtUtils.writeBlockPos(e.getKey()));
|
||||||
|
@ -213,7 +212,7 @@ public class CarriageContraption extends Contraption {
|
||||||
assemblyDirection = NBTHelper.readEnum(nbt, "AssemblyDirection", Direction.class);
|
assemblyDirection = NBTHelper.readEnum(nbt, "AssemblyDirection", Direction.class);
|
||||||
forwardControls = nbt.getBoolean("FrontControls");
|
forwardControls = nbt.getBoolean("FrontControls");
|
||||||
backwardControls = nbt.getBoolean("BackControls");
|
backwardControls = nbt.getBoolean("BackControls");
|
||||||
blazeBurnerConductors =
|
blockConductors =
|
||||||
Couple.create(nbt.getBoolean("FrontBlazeConductor"), nbt.getBoolean("BackBlazeConductor"));
|
Couple.create(nbt.getBoolean("FrontBlazeConductor"), nbt.getBoolean("BackBlazeConductor"));
|
||||||
conductorSeats.clear();
|
conductorSeats.clear();
|
||||||
NBTHelper.iterateCompoundList(nbt.getList("ConductorSeats", Tag.TAG_COMPOUND),
|
NBTHelper.iterateCompoundList(nbt.getList("ConductorSeats", Tag.TAG_COMPOUND),
|
||||||
|
|
|
@ -492,8 +492,8 @@ public class CarriageContraptionEntity extends OrientedContraptionEntity {
|
||||||
if (!(contraption instanceof CarriageContraption cc))
|
if (!(contraption instanceof CarriageContraption cc))
|
||||||
return sides;
|
return sides;
|
||||||
|
|
||||||
sides.setFirst(cc.blazeBurnerConductors.getFirst());
|
sides.setFirst(cc.blockConductors.getFirst());
|
||||||
sides.setSecond(cc.blazeBurnerConductors.getSecond());
|
sides.setSecond(cc.blockConductors.getSecond());
|
||||||
|
|
||||||
for (Entity entity : getPassengers()) {
|
for (Entity entity : getPassengers()) {
|
||||||
if (entity instanceof Player)
|
if (entity instanceof Player)
|
||||||
|
|
|
@ -6,8 +6,8 @@ import com.simibubi.create.compat.Mods;
|
||||||
import com.simibubi.create.content.contraptions.glue.SuperGlueEntity;
|
import com.simibubi.create.content.contraptions.glue.SuperGlueEntity;
|
||||||
import com.simibubi.create.foundation.utility.AttachedRegistry;
|
import com.simibubi.create.foundation.utility.AttachedRegistry;
|
||||||
|
|
||||||
import net.createmod.catnip.math.BlockFace;
|
|
||||||
import net.createmod.catnip.data.Pair;
|
import net.createmod.catnip.data.Pair;
|
||||||
|
import net.createmod.catnip.math.BlockFace;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
@ -19,44 +19,95 @@ import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.NetherPortalBlock;
|
|
||||||
import net.minecraft.world.level.block.Portal;
|
import net.minecraft.world.level.block.Portal;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.world.level.portal.DimensionTransition;
|
import net.minecraft.world.level.portal.DimensionTransition;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages portal track integrations for various dimensions and mods within the Create mod.
|
||||||
|
* <p>
|
||||||
|
* Portals must be entered from the side and must lead to a different dimension than the one entered from.
|
||||||
|
* This class handles the registration and functionality of portal tracks for standard and modded portals.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
public class AllPortalTracks {
|
public class AllPortalTracks {
|
||||||
|
/**
|
||||||
|
* Functional interface representing a provider for portal track connections.
|
||||||
|
* It takes a pair of {@link ServerLevel} and {@link BlockFace} representing the inbound track
|
||||||
|
* and returns a similar pair for the outbound track.
|
||||||
|
*/
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface PortalTrackProvider extends UnaryOperator<Pair<ServerLevel, BlockFace>> {}
|
||||||
|
|
||||||
// Portals must be entered from the side and must lead to a different dimension
|
/**
|
||||||
// than the one entered from
|
* Registry mapping portal blocks to their respective {@link PortalTrackProvider}s.
|
||||||
|
*/
|
||||||
@FunctionalInterface public interface PortalTrackProvider extends UnaryOperator<Pair<ServerLevel, BlockFace>> {}
|
|
||||||
|
|
||||||
private static final AttachedRegistry<Block, PortalTrackProvider> PORTAL_BEHAVIOURS =
|
private static final AttachedRegistry<Block, PortalTrackProvider> PORTAL_BEHAVIOURS =
|
||||||
new AttachedRegistry<>(BuiltInRegistries.BLOCK);
|
new AttachedRegistry<>(BuiltInRegistries.BLOCK);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a portal track integration for a given block identified by its {@link ResourceLocation}.
|
||||||
|
*
|
||||||
|
* @param block The resource location of the portal block.
|
||||||
|
* @param provider The portal track provider for the block.
|
||||||
|
*/
|
||||||
public static void registerIntegration(ResourceLocation block, PortalTrackProvider provider) {
|
public static void registerIntegration(ResourceLocation block, PortalTrackProvider provider) {
|
||||||
PORTAL_BEHAVIOURS.register(block, provider);
|
PORTAL_BEHAVIOURS.register(block, provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a portal track integration for a given {@link Block}.
|
||||||
|
*
|
||||||
|
* @param block The portal block.
|
||||||
|
* @param provider The portal track provider for the block.
|
||||||
|
*/
|
||||||
public static void registerIntegration(Block block, PortalTrackProvider provider) {
|
public static void registerIntegration(Block block, PortalTrackProvider provider) {
|
||||||
PORTAL_BEHAVIOURS.register(block, provider);
|
PORTAL_BEHAVIOURS.register(block, provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerIntegration(Mods mod, String blockId, PortalTrackProvider provider) {
|
private static void registerSimpleInteraction(Mods mod, String dimensionId, String portalBlockId) {
|
||||||
if (mod.isLoaded())
|
ResourceKey<Level> levelKey = ResourceKey.create(Registries.DIMENSION, mod.rl(dimensionId));
|
||||||
PORTAL_BEHAVIOURS.register(mod.rl(blockId), provider);
|
registerSimpleInteraction(mod, levelKey, portalBlockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void registerSimpleInteraction(Mods mod, ResourceKey<Level> levelKey, String portalBlockId) {
|
||||||
|
if (mod.isLoaded())
|
||||||
|
registerSimpleInteraction(levelKey, asPortal(mod.rl(portalBlockId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerSimpleInteraction(ResourceKey<Level> levelKey, Portal portalBlock) {
|
||||||
|
PortalTrackProvider p = i ->
|
||||||
|
standardPortalProvider(i, Level.OVERWORLD, levelKey, portalBlock);
|
||||||
|
PORTAL_BEHAVIOURS.register((Block) portalBlock, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a given {@link BlockState} represents a supported portal block.
|
||||||
|
*
|
||||||
|
* @param state The block state to check.
|
||||||
|
* @return {@code true} if the block state represents a supported portal; {@code false} otherwise.
|
||||||
|
*/
|
||||||
public static boolean isSupportedPortal(BlockState state) {
|
public static boolean isSupportedPortal(BlockState state) {
|
||||||
return PORTAL_BEHAVIOURS.get(state.getBlock()) != null;
|
return PORTAL_BEHAVIOURS.get(state.getBlock()) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grabs a block from the registry as a {@link Portal} block
|
||||||
|
*/
|
||||||
public static Portal asPortal(ResourceLocation block) {
|
public static Portal asPortal(ResourceLocation block) {
|
||||||
return (Portal) BuiltInRegistries.BLOCK.get(block);
|
return (Portal) BuiltInRegistries.BLOCK.get(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the corresponding outbound track on the other side of a portal.
|
||||||
|
*
|
||||||
|
* @param level The current {@link ServerLevel}.
|
||||||
|
* @param inboundTrack The inbound track {@link BlockFace}.
|
||||||
|
* @return A pair containing the target {@link ServerLevel} and outbound {@link BlockFace},
|
||||||
|
* or {@code null} if no corresponding portal is found.
|
||||||
|
*/
|
||||||
public static Pair<ServerLevel, BlockFace> getOtherSide(ServerLevel level, BlockFace inboundTrack) {
|
public static Pair<ServerLevel, BlockFace> getOtherSide(ServerLevel level, BlockFace inboundTrack) {
|
||||||
BlockPos portalPos = inboundTrack.getConnectedPos();
|
BlockPos portalPos = inboundTrack.getConnectedPos();
|
||||||
BlockState portalState = level.getBlockState(portalPos);
|
BlockState portalState = level.getBlockState(portalPos);
|
||||||
|
@ -64,37 +115,41 @@ public class AllPortalTracks {
|
||||||
return provider == null ? null : provider.apply(Pair.of(level, inboundTrack));
|
return provider == null ? null : provider.apply(Pair.of(level, inboundTrack));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builtin handlers
|
// Built-in handlers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers default portal track integrations for built-in dimensions and mods.
|
||||||
|
* This includes the Nether, the Aether (if loaded) and the end (if betterend is loaded).
|
||||||
|
*/
|
||||||
public static void registerDefaults() {
|
public static void registerDefaults() {
|
||||||
registerIntegration(Blocks.NETHER_PORTAL, AllPortalTracks::nether);
|
registerSimpleInteraction(Level.NETHER, (Portal) Blocks.NETHER_PORTAL);
|
||||||
registerIntegration(Mods.AETHER, "aether_portal", AllPortalTracks::aether);
|
registerSimpleInteraction(Mods.AETHER, "the_aether", "aether_portal");
|
||||||
registerIntegration(Mods.AETHER_II, "aether_portal", AllPortalTracks::aetherII);
|
registerSimpleInteraction(Mods.AETHER_II, "aether_highlands", "aether_portal");
|
||||||
|
registerSimpleInteraction(Mods.BETTEREND, Level.END, "end_portal_block");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Pair<ServerLevel, BlockFace> nether(Pair<ServerLevel, BlockFace> inbound) {
|
/**
|
||||||
return standardPortalProvider(inbound, Level.OVERWORLD, Level.NETHER, (NetherPortalBlock) Blocks.NETHER_PORTAL);
|
* Generalized portal provider method that calculates the corresponding outbound track across a portal.
|
||||||
}
|
*
|
||||||
|
* @param inbound A pair containing the current {@link ServerLevel} and inbound {@link BlockFace}.
|
||||||
private static Pair<ServerLevel, BlockFace> aether(Pair<ServerLevel, BlockFace> inbound) {
|
* @param firstDimension The first dimension.
|
||||||
ResourceKey<Level> aetherLevelKey = ResourceKey.create(Registries.DIMENSION, Mods.AETHER.rl("the_aether"));
|
* @param secondDimension The second dimension.
|
||||||
return standardPortalProvider(inbound, Level.OVERWORLD, aetherLevelKey, asPortal(Mods.AETHER.rl("aether_portal")));
|
* @param portal The portal block
|
||||||
}
|
* @return A pair with the target {@link ServerLevel} and outbound {@link BlockFace}, or {@code null} if not applicable.
|
||||||
|
*/
|
||||||
private static Pair<ServerLevel, BlockFace> aetherII(Pair<ServerLevel, BlockFace> inbound) {
|
public static Pair<ServerLevel, BlockFace> standardPortalProvider(
|
||||||
ResourceKey<Level> aetherLevelKey = ResourceKey.create(Registries.DIMENSION, Mods.AETHER_II.rl("aether_highlands"));
|
Pair<ServerLevel, BlockFace> inbound,
|
||||||
return standardPortalProvider(inbound, Level.OVERWORLD, aetherLevelKey, asPortal(Mods.AETHER_II.rl("aether_portal")));
|
ResourceKey<Level> firstDimension,
|
||||||
}
|
ResourceKey<Level> secondDimension,
|
||||||
|
Portal portal
|
||||||
public static Pair<ServerLevel, BlockFace> standardPortalProvider(Pair<ServerLevel, BlockFace> inbound,
|
) {
|
||||||
ResourceKey<Level> firstDimension, ResourceKey<Level> secondDimension,
|
|
||||||
Portal portal) {
|
|
||||||
ServerLevel level = inbound.getFirst();
|
ServerLevel level = inbound.getFirst();
|
||||||
ResourceKey<Level> resourcekey = level.dimension() == secondDimension ? firstDimension : secondDimension;
|
ResourceKey<Level> resourceKey = level.dimension() == secondDimension ? firstDimension : secondDimension;
|
||||||
MinecraftServer minecraftserver = level.getServer();
|
|
||||||
ServerLevel otherLevel = minecraftserver.getLevel(resourcekey);
|
|
||||||
|
|
||||||
if (otherLevel == null || !minecraftserver.isLevelEnabled(otherLevel))
|
MinecraftServer minecraftServer = level.getServer();
|
||||||
|
ServerLevel otherLevel = minecraftServer.getLevel(resourceKey);
|
||||||
|
|
||||||
|
if (otherLevel == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
BlockFace inboundTrack = inbound.getSecond();
|
BlockFace inboundTrack = inbound.getSecond();
|
||||||
|
@ -102,16 +157,18 @@ public class AllPortalTracks {
|
||||||
BlockState portalState = level.getBlockState(portalPos);
|
BlockState portalState = level.getBlockState(portalPos);
|
||||||
|
|
||||||
SuperGlueEntity probe = new SuperGlueEntity(level, new AABB(portalPos));
|
SuperGlueEntity probe = new SuperGlueEntity(level, new AABB(portalPos));
|
||||||
probe.setYRot(inboundTrack.getFace()
|
probe.setYRot(inboundTrack.getFace().toYRot());
|
||||||
.toYRot());
|
|
||||||
|
|
||||||
DimensionTransition dimensiontransition = portal.getPortalDestination(level, probe, probe.blockPosition());
|
DimensionTransition dimensiontransition = portal.getPortalDestination(level, probe, probe.blockPosition());
|
||||||
if (dimensiontransition == null)
|
if (dimensiontransition == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if (!minecraftServer.isLevelEnabled(dimensiontransition.newLevel()))
|
||||||
|
return null;
|
||||||
|
|
||||||
BlockPos otherPortalPos = BlockPos.containing(dimensiontransition.pos());
|
BlockPos otherPortalPos = BlockPos.containing(dimensiontransition.pos());
|
||||||
BlockState otherPortalState = otherLevel.getBlockState(otherPortalPos);
|
BlockState otherPortalState = otherLevel.getBlockState(otherPortalPos);
|
||||||
if (otherPortalState.getBlock() != portalState.getBlock())
|
if (!otherPortalState.is(portalState.getBlock()))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Direction targetDirection = inboundTrack.getFace();
|
Direction targetDirection = inboundTrack.getFace();
|
||||||
|
@ -120,5 +177,4 @@ public class AllPortalTracks {
|
||||||
BlockPos otherPos = otherPortalPos.relative(targetDirection);
|
BlockPos otherPos = otherPortalPos.relative(targetDirection);
|
||||||
return Pair.of(otherLevel, new BlockFace(otherPos, targetDirection.getOpposite()));
|
return Pair.of(otherLevel, new BlockFace(otherPos, targetDirection.getOpposite()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import net.minecraft.tags.ItemTags;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.data.TagGen;
|
import com.simibubi.create.foundation.data.TagGen;
|
||||||
|
@ -138,7 +140,13 @@ public class CopperBlockSet {
|
||||||
.simpleItem();
|
.simpleItem();
|
||||||
|
|
||||||
if (variant == BlockVariant.INSTANCE && state == WeatherState.UNAFFECTED)
|
if (variant == BlockVariant.INSTANCE && state == WeatherState.UNAFFECTED)
|
||||||
builder.recipe((c, p) -> mainBlockRecipe.accept(c, p));
|
builder.recipe(mainBlockRecipe::accept);
|
||||||
|
|
||||||
|
if (variant == StairVariant.INSTANCE)
|
||||||
|
builder.tag(BlockTags.STAIRS);
|
||||||
|
|
||||||
|
if (variant == SlabVariant.INSTANCE)
|
||||||
|
builder.tag(BlockTags.SLABS);
|
||||||
|
|
||||||
if (waxed) {
|
if (waxed) {
|
||||||
builder.recipe((ctx, prov) -> {
|
builder.recipe((ctx, prov) -> {
|
||||||
|
|
|
@ -69,6 +69,7 @@ import net.minecraft.data.recipes.ShapelessRecipeBuilder;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
import net.minecraft.tags.ItemTags;
|
import net.minecraft.tags.ItemTags;
|
||||||
|
import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.world.item.DyeColor;
|
import net.minecraft.world.item.DyeColor;
|
||||||
import net.minecraft.world.item.Rarity;
|
import net.minecraft.world.item.Rarity;
|
||||||
import net.minecraft.world.level.ItemLike;
|
import net.minecraft.world.level.ItemLike;
|
||||||
|
@ -498,13 +499,15 @@ public class BuilderTransformers {
|
||||||
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> tableCloth(String name,
|
public static <B extends Block, P> NonNullUnaryOperator<BlockBuilder<B, P>> tableCloth(String name,
|
||||||
NonNullSupplier<? extends Block> initialProps, boolean dyed) {
|
NonNullSupplier<? extends Block> initialProps, boolean dyed) {
|
||||||
return b -> {
|
return b -> {
|
||||||
|
TagKey<Block> soundTag = dyed ? BlockTags.COMBINATION_STEP_SOUND_BLOCKS : BlockTags.INSIDE_STEP_SOUND_BLOCKS;
|
||||||
|
|
||||||
ItemBuilder<TableClothBlockItem, BlockBuilder<B, P>> item = b.initialProperties(initialProps)
|
ItemBuilder<TableClothBlockItem, BlockBuilder<B, P>> item = b.initialProperties(initialProps)
|
||||||
.addLayer(() -> RenderType::cutoutMipped)
|
.addLayer(() -> RenderType::cutoutMipped)
|
||||||
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
|
.blockstate((c, p) -> p.simpleBlock(c.get(), p.models()
|
||||||
.withExistingParent(name + "_table_cloth", p.modLoc("block/table_cloth/block"))
|
.withExistingParent(name + "_table_cloth", p.modLoc("block/table_cloth/block"))
|
||||||
.texture("0", p.modLoc("block/table_cloth/" + name))))
|
.texture("0", p.modLoc("block/table_cloth/" + name))))
|
||||||
.onRegister(CreateRegistrate.blockModel(() -> TableClothModel::new))
|
.onRegister(CreateRegistrate.blockModel(() -> TableClothModel::new))
|
||||||
.tag(AllBlockTags.TABLE_CLOTHS.tag)
|
.tag(AllBlockTags.TABLE_CLOTHS.tag, soundTag)
|
||||||
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "block.create.table_cloth"))
|
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "block.create.table_cloth"))
|
||||||
.item(TableClothBlockItem::new);
|
.item(TableClothBlockItem::new);
|
||||||
|
|
||||||
|
|
|
@ -186,29 +186,30 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
|
||||||
/* Fluids */
|
/* Fluids */
|
||||||
|
|
||||||
public <T extends BaseFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name,
|
public <T extends BaseFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name,
|
||||||
FluidBuilder.FluidTypeFactory typeFactory, NonNullFunction<BaseFlowingFluid.Properties, T> factory) {
|
FluidBuilder.FluidTypeFactory typeFactory, NonNullFunction<BaseFlowingFluid.Properties, T> sourceFactory,
|
||||||
|
NonNullFunction<BaseFlowingFluid.Properties, T> flowingFactory) {
|
||||||
return entry(name,
|
return entry(name,
|
||||||
c -> new VirtualFluidBuilder<>(self(), self(), name, c, ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_still"),
|
c -> new VirtualFluidBuilder<>(self(), self(), name, c, ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_still"),
|
||||||
ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_flow"), typeFactory, factory));
|
ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_flow"), typeFactory, sourceFactory, flowingFactory));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends BaseFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name,
|
public <T extends BaseFlowingFluid> FluidBuilder<T, CreateRegistrate> virtualFluid(String name,
|
||||||
ResourceLocation still, ResourceLocation flow, FluidBuilder.FluidTypeFactory typeFactory,
|
ResourceLocation still, ResourceLocation flow, FluidBuilder.FluidTypeFactory typeFactory,
|
||||||
NonNullFunction<BaseFlowingFluid.Properties, T> factory) {
|
NonNullFunction<BaseFlowingFluid.Properties, T> sourceFactory, NonNullFunction<BaseFlowingFluid.Properties, T> flowingFactory) {
|
||||||
return entry(name, c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, flow, typeFactory, factory));
|
return entry(name, c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, flow, typeFactory, sourceFactory, flowingFactory));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name) {
|
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name) {
|
||||||
return entry(name,
|
return entry(name,
|
||||||
c -> new VirtualFluidBuilder<VirtualFluid, CreateRegistrate>(self(), self(), name, c,
|
c -> new VirtualFluidBuilder<VirtualFluid, CreateRegistrate>(self(), self(), name, c,
|
||||||
ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_still"), ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_flow"),
|
ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_still"), ResourceLocation.fromNamespaceAndPath(getModid(), "fluid/" + name + "_flow"),
|
||||||
CreateRegistrate::defaultFluidType, VirtualFluid::new));
|
CreateRegistrate::defaultFluidType, VirtualFluid::createSource, VirtualFluid::createFlowing));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name, ResourceLocation still,
|
public FluidBuilder<VirtualFluid, CreateRegistrate> virtualFluid(String name, ResourceLocation still,
|
||||||
ResourceLocation flow) {
|
ResourceLocation flow) {
|
||||||
return entry(name, c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, flow,
|
return entry(name, c -> new VirtualFluidBuilder<>(self(), self(), name, c, still, flow,
|
||||||
CreateRegistrate::defaultFluidType, VirtualFluid::new));
|
CreateRegistrate::defaultFluidType, VirtualFluid::createSource, VirtualFluid::createFlowing));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidBuilder<BaseFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) {
|
public FluidBuilder<BaseFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name) {
|
||||||
|
|
|
@ -17,9 +17,11 @@ public class VirtualFluidBuilder<T extends BaseFlowingFluid, P> extends FluidBui
|
||||||
|
|
||||||
public VirtualFluidBuilder(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback,
|
public VirtualFluidBuilder(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback,
|
||||||
ResourceLocation stillTexture, ResourceLocation flowingTexture, FluidBuilder.FluidTypeFactory typeFactory,
|
ResourceLocation stillTexture, ResourceLocation flowingTexture, FluidBuilder.FluidTypeFactory typeFactory,
|
||||||
NonNullFunction<Properties, T> factory) {
|
NonNullFunction<Properties, T> sourceFactory,
|
||||||
super(owner, parent, name, callback, stillTexture, flowingTexture, typeFactory, factory);
|
NonNullFunction<Properties, T> flowingFactory
|
||||||
source(factory);
|
) {
|
||||||
|
super(owner, parent, name, callback, stillTexture, flowingTexture, typeFactory, flowingFactory);
|
||||||
|
source(sourceFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,8 +63,7 @@ public class MillingRecipeGen extends ProcessingRecipeGen {
|
||||||
|
|
||||||
CACTUS = create(() -> Blocks.CACTUS, b -> b.duration(50)
|
CACTUS = create(() -> Blocks.CACTUS, b -> b.duration(50)
|
||||||
.output(Items.GREEN_DYE, 2)
|
.output(Items.GREEN_DYE, 2)
|
||||||
.output(.1f, Items.GREEN_DYE, 1)
|
.output(.1f, Items.GREEN_DYE, 1)),
|
||||||
.whenModMissing("quark")),
|
|
||||||
|
|
||||||
SEA_PICKLE = create(() -> Blocks.SEA_PICKLE, b -> b.duration(50)
|
SEA_PICKLE = create(() -> Blocks.SEA_PICKLE, b -> b.duration(50)
|
||||||
.output(Items.LIME_DYE, 2)
|
.output(Items.LIME_DYE, 2)
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class PressingRecipeGen extends ProcessingRecipeGen {
|
||||||
|
|
||||||
SUGAR_CANE = create(() -> Items.SUGAR_CANE, b -> b.output(Items.PAPER)),
|
SUGAR_CANE = create(() -> Items.SUGAR_CANE, b -> b.output(Items.PAPER)),
|
||||||
|
|
||||||
PATH = create("path", b -> b.require(Ingredient.of(Items.GRASS_BLOCK, Items.DIRT))
|
PATH = create("path", b -> b.require(Ingredient.of(Items.GRASS_BLOCK, Items.DIRT, Items.COARSE_DIRT, Items.ROOTED_DIRT))
|
||||||
.output(Items.DIRT_PATH)),
|
.output(Items.DIRT_PATH)),
|
||||||
|
|
||||||
IRON = create("iron_ingot", b -> b.require(I.iron())
|
IRON = create("iron_ingot", b -> b.require(I.iron())
|
||||||
|
|
|
@ -10,6 +10,7 @@ import javax.annotation.Nullable;
|
||||||
import org.apache.commons.lang3.mutable.MutableInt;
|
import org.apache.commons.lang3.mutable.MutableInt;
|
||||||
|
|
||||||
import com.simibubi.create.content.logistics.box.PackageEntity;
|
import com.simibubi.create.content.logistics.box.PackageEntity;
|
||||||
|
import com.simibubi.create.foundation.block.IBE;
|
||||||
import com.simibubi.create.foundation.mixin.accessor.ItemStackHandlerAccessor;
|
import com.simibubi.create.foundation.mixin.accessor.ItemStackHandlerAccessor;
|
||||||
|
|
||||||
import net.createmod.catnip.data.Pair;
|
import net.createmod.catnip.data.Pair;
|
||||||
|
@ -24,7 +25,9 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.component.ItemContainerContents;
|
import net.minecraft.world.item.component.ItemContainerContents;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
||||||
|
import net.neoforged.neoforge.capabilities.Capabilities.ItemHandler;
|
||||||
import net.neoforged.neoforge.items.IItemHandler;
|
import net.neoforged.neoforge.items.IItemHandler;
|
||||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||||
|
@ -81,6 +84,13 @@ public class ItemHelper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T extends IBE<? extends BlockEntity>> int calcRedstoneFromBlockEntity(T ibe, Level level, BlockPos pos) {
|
||||||
|
return ibe.getBlockEntityOptional(level, pos)
|
||||||
|
.map(be -> level.getCapability(ItemHandler.BLOCK, pos, null))
|
||||||
|
.map(ItemHelper::calcRedstoneFromInventory)
|
||||||
|
.orElse(0);
|
||||||
|
}
|
||||||
|
|
||||||
public static int calcRedstoneFromInventory(@Nullable IItemHandler inv) {
|
public static int calcRedstoneFromInventory(@Nullable IItemHandler inv) {
|
||||||
if (inv == null)
|
if (inv == null)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -5,12 +5,15 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
||||||
|
|
||||||
|
import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.inventory.SmithingMenu;
|
import net.minecraft.world.inventory.SmithingMenu;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.enchantment.ItemEnchantments;
|
||||||
|
|
||||||
@Mixin(SmithingMenu.class)
|
@Mixin(SmithingMenu.class)
|
||||||
public class SmithingMenuMixin {
|
public class SmithingMenuMixin {
|
||||||
|
@ -23,4 +26,23 @@ public class SmithingMenuMixin {
|
||||||
AllAdvancements.CARDBOARD_ARMOR_TRIM.awardTo(player);
|
AllAdvancements.CARDBOARD_ARMOR_TRIM.awardTo(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only add enchantments to the backtank if it supports them
|
||||||
|
@ModifyExpressionValue(
|
||||||
|
method = "createResult",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/world/item/crafting/SmithingRecipe;assemble(Lnet/minecraft/world/item/crafting/RecipeInput;Lnet/minecraft/core/HolderLookup$Provider;)Lnet/minecraft/world/item/ItemStack;"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private ItemStack create$preventUnbreakingOnBacktanks(ItemStack original) {
|
||||||
|
if (AllItems.COPPER_BACKTANK.is(original) || AllItems.NETHERITE_BACKTANK.is(original)) {
|
||||||
|
ItemEnchantments.Mutable mutableEnchantments =
|
||||||
|
new ItemEnchantments.Mutable(original.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY));
|
||||||
|
mutableEnchantments.removeIf(enchant -> !original.supportsEnchantment(enchant));
|
||||||
|
original.set(DataComponents.ENCHANTMENTS, mutableEnchantments.toImmutable());
|
||||||
|
}
|
||||||
|
|
||||||
|
return original;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,8 @@ import net.minecraft.world.level.block.SlimeBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
|
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||||
|
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||||
import net.minecraft.world.level.block.state.properties.Property;
|
import net.minecraft.world.level.block.state.properties.Property;
|
||||||
import net.minecraft.world.level.block.state.properties.SlabType;
|
import net.minecraft.world.level.block.state.properties.SlabType;
|
||||||
import net.minecraft.world.level.chunk.LevelChunk;
|
import net.minecraft.world.level.chunk.LevelChunk;
|
||||||
|
@ -68,6 +70,24 @@ import net.neoforged.neoforge.event.level.BlockDropsEvent;
|
||||||
import net.neoforged.neoforge.event.level.BlockEvent;
|
import net.neoforged.neoforge.event.level.BlockEvent;
|
||||||
|
|
||||||
public class BlockHelper {
|
public class BlockHelper {
|
||||||
|
private static final List<IntegerProperty> COUNT_STATES = List.of(
|
||||||
|
BlockStateProperties.EGGS,
|
||||||
|
BlockStateProperties.PICKLES,
|
||||||
|
BlockStateProperties.CANDLES
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final List<Block> VINELIKE_BLOCKS = List.of(
|
||||||
|
Blocks.VINE, Blocks.GLOW_LICHEN
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final List<BooleanProperty> VINELIKE_STATES = List.of(
|
||||||
|
BlockStateProperties.UP,
|
||||||
|
BlockStateProperties.NORTH,
|
||||||
|
BlockStateProperties.EAST,
|
||||||
|
BlockStateProperties.SOUTH,
|
||||||
|
BlockStateProperties.WEST,
|
||||||
|
BlockStateProperties.DOWN
|
||||||
|
);
|
||||||
|
|
||||||
public static BlockState setZeroAge(BlockState blockState) {
|
public static BlockState setZeroAge(BlockState blockState) {
|
||||||
if (blockState.hasProperty(BlockStateProperties.AGE_1))
|
if (blockState.hasProperty(BlockStateProperties.AGE_1))
|
||||||
|
@ -109,11 +129,21 @@ public class BlockHelper {
|
||||||
if (needsTwo)
|
if (needsTwo)
|
||||||
amount *= 2;
|
amount *= 2;
|
||||||
|
|
||||||
if (block.hasProperty(BlockStateProperties.EGGS))
|
for (IntegerProperty property : COUNT_STATES)
|
||||||
amount *= block.getValue(BlockStateProperties.EGGS);
|
if (block.hasProperty(property))
|
||||||
|
amount *= block.getValue(property);
|
||||||
|
|
||||||
if (block.hasProperty(BlockStateProperties.PICKLES))
|
if (VINELIKE_BLOCKS.contains(block.getBlock())) {
|
||||||
amount *= block.getValue(BlockStateProperties.PICKLES);
|
int vineCount = 0;
|
||||||
|
|
||||||
|
for (BooleanProperty vineState : VINELIKE_STATES) {
|
||||||
|
if (block.hasProperty(vineState) && block.getValue(vineState)) {
|
||||||
|
vineCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
amount += vineCount - 1;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Try held Item first
|
// Try held Item first
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.simibubi.create.foundation.utility;
|
package com.simibubi.create.foundation.utility;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Supplier;
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
|
|
||||||
import net.createmod.catnip.data.Couple;
|
import net.createmod.catnip.data.Couple;
|
||||||
import net.minecraft.world.item.DyeColor;
|
import net.minecraft.world.item.DyeColor;
|
||||||
|
@ -12,49 +12,53 @@ import net.minecraft.world.level.block.Blocks;
|
||||||
public class DyeHelper {
|
public class DyeHelper {
|
||||||
|
|
||||||
public static ItemLike getWoolOfDye(DyeColor color) {
|
public static ItemLike getWoolOfDye(DyeColor color) {
|
||||||
return switch (color) {
|
return WOOL_TABLE.getOrDefault(color, () -> Blocks.WHITE_WOOL).get();
|
||||||
case BLACK -> Blocks.BLACK_WOOL;
|
|
||||||
case BLUE -> Blocks.BLUE_WOOL;
|
|
||||||
case BROWN -> Blocks.BROWN_WOOL;
|
|
||||||
case CYAN -> Blocks.CYAN_WOOL;
|
|
||||||
case GRAY -> Blocks.GRAY_WOOL;
|
|
||||||
case GREEN -> Blocks.GREEN_WOOL;
|
|
||||||
case LIGHT_BLUE -> Blocks.LIGHT_BLUE_WOOL;
|
|
||||||
case LIGHT_GRAY -> Blocks.LIGHT_GRAY_WOOL;
|
|
||||||
case LIME -> Blocks.LIME_WOOL;
|
|
||||||
case MAGENTA -> Blocks.MAGENTA_WOOL;
|
|
||||||
case ORANGE -> Blocks.ORANGE_WOOL;
|
|
||||||
case PINK -> Blocks.PINK_WOOL;
|
|
||||||
case PURPLE -> Blocks.PURPLE_WOOL;
|
|
||||||
case RED -> Blocks.RED_WOOL;
|
|
||||||
case YELLOW -> Blocks.YELLOW_WOOL;
|
|
||||||
default -> Blocks.WHITE_WOOL;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Map<DyeColor, Couple<Integer>> DYE_TABLE = new ImmutableMap.Builder<DyeColor, Couple<Integer>>()
|
public static Couple<Integer> getDyeColors(DyeColor color){
|
||||||
|
return DYE_TABLE.getOrDefault(color, DYE_TABLE.get(DyeColor.WHITE));
|
||||||
|
}
|
||||||
|
|
||||||
// DyeColor, ( Front RGB, Back RGB )
|
/**
|
||||||
.put(DyeColor.BLACK, Couple.create(0x45403B, 0x21201F))
|
* Adds a dye color s.t. Create's blocks can use it instead of defaulting to white.
|
||||||
.put(DyeColor.RED, Couple.create(0xB13937, 0x632737))
|
* @param color Dye color to add
|
||||||
.put(DyeColor.GREEN, Couple.create(0x208A46, 0x1D6045))
|
* @param brightColor Front (bright) RGB color
|
||||||
.put(DyeColor.BROWN, Couple.create(0xAC855C, 0x68533E))
|
* @param darkColor Back (dark) RGB color
|
||||||
|
* @param wool Supplier of wool item/block corresponding to the color
|
||||||
|
*/
|
||||||
|
public static void addDye(DyeColor color, Integer brightColor, Integer darkColor, Supplier<ItemLike> wool){
|
||||||
|
DYE_TABLE.put(color, Couple.create(brightColor, darkColor));
|
||||||
|
WOOL_TABLE.put(color, wool);
|
||||||
|
}
|
||||||
|
|
||||||
.put(DyeColor.BLUE, Couple.create(0x5391E1, 0x504B90))
|
private static void addDye(DyeColor color, Integer brightColor, Integer darkColor, ItemLike wool){
|
||||||
.put(DyeColor.GRAY, Couple.create(0x5D666F, 0x313538))
|
addDye(color, brightColor, darkColor, () -> wool);
|
||||||
.put(DyeColor.LIGHT_GRAY, Couple.create(0x95969B, 0x707070))
|
}
|
||||||
.put(DyeColor.PURPLE, Couple.create(0x9F54AE, 0x63366C))
|
|
||||||
|
|
||||||
.put(DyeColor.CYAN, Couple.create(0x3EABB4, 0x3C7872))
|
private static final Map<DyeColor, Supplier<ItemLike>> WOOL_TABLE = new HashMap<>();
|
||||||
.put(DyeColor.PINK, Couple.create(0xD5A8CB, 0xB86B95))
|
|
||||||
.put(DyeColor.LIME, Couple.create(0xA3DF55, 0x4FB16F))
|
|
||||||
.put(DyeColor.YELLOW, Couple.create(0xE6D756, 0xE9AC29))
|
|
||||||
|
|
||||||
.put(DyeColor.LIGHT_BLUE, Couple.create(0x69CED2, 0x508AA5))
|
private static final Map<DyeColor, Couple<Integer>> DYE_TABLE = new HashMap<>();
|
||||||
.put(DyeColor.ORANGE, Couple.create(0xEE9246, 0xD94927))
|
|
||||||
.put(DyeColor.MAGENTA, Couple.create(0xF062B0, 0xC04488))
|
|
||||||
.put(DyeColor.WHITE, Couple.create(0xEDEAE5, 0xBBB6B0))
|
|
||||||
|
|
||||||
.build();
|
static {
|
||||||
|
// DyeColor, ( Front RGB, Back RGB )
|
||||||
|
addDye(DyeColor.BLACK, 0x45403B, 0x21201F, Blocks.BLACK_WOOL);
|
||||||
|
addDye(DyeColor.RED, 0xB13937, 0x632737, Blocks.RED_WOOL);
|
||||||
|
addDye(DyeColor.GREEN, 0x208A46, 0x1D6045, Blocks.GREEN_WOOL);
|
||||||
|
addDye(DyeColor.BROWN, 0xAC855C, 0x68533E, Blocks.BROWN_WOOL);
|
||||||
|
|
||||||
|
addDye(DyeColor.BLUE, 0x5391E1, 0x504B90, Blocks.BLUE_WOOL);
|
||||||
|
addDye(DyeColor.GRAY, 0x5D666F, 0x313538, Blocks.GRAY_WOOL);
|
||||||
|
addDye(DyeColor.LIGHT_GRAY, 0x95969B, 0x707070, Blocks.LIGHT_GRAY_WOOL);
|
||||||
|
addDye(DyeColor.PURPLE, 0x9F54AE, 0x63366C, Blocks.PURPLE_WOOL);
|
||||||
|
|
||||||
|
addDye(DyeColor.CYAN, 0x3EABB4, 0x3C7872, Blocks.CYAN_WOOL);
|
||||||
|
addDye(DyeColor.PINK, 0xD5A8CB, 0xB86B95, Blocks.PINK_WOOL);
|
||||||
|
addDye(DyeColor.LIME, 0xA3DF55, 0x4FB16F, Blocks.LIME_WOOL);
|
||||||
|
addDye(DyeColor.YELLOW, 0xE6D756, 0xE9AC29, Blocks.YELLOW_WOOL);
|
||||||
|
|
||||||
|
addDye(DyeColor.LIGHT_BLUE, 0x69CED2, 0x508AA5, Blocks.LIGHT_BLUE_WOOL);
|
||||||
|
addDye(DyeColor.ORANGE, 0xEE9246, 0xD94927, Blocks.ORANGE_WOOL);
|
||||||
|
addDye(DyeColor.MAGENTA, 0xF062B0, 0xC04488, Blocks.MAGENTA_WOOL);
|
||||||
|
addDye(DyeColor.WHITE, 0xEDEAE5, 0xBBB6B0, Blocks.WHITE_WOOL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,9 @@ public class CreateRegistrateTags {
|
||||||
prov.tag(AllBlockTags.ROOTS.tag)
|
prov.tag(AllBlockTags.ROOTS.tag)
|
||||||
.add(Blocks.MANGROVE_ROOTS);
|
.add(Blocks.MANGROVE_ROOTS);
|
||||||
|
|
||||||
|
prov.tag(AllBlockTags.SUGAR_CANE_VARIANTS.tag)
|
||||||
|
.add(Blocks.SUGAR_CANE);
|
||||||
|
|
||||||
prov.tag(AllBlockTags.CORALS.tag)
|
prov.tag(AllBlockTags.CORALS.tag)
|
||||||
.add(Blocks.DEAD_TUBE_CORAL, Blocks.DEAD_BRAIN_CORAL, Blocks.DEAD_BUBBLE_CORAL, Blocks.DEAD_FIRE_CORAL,
|
.add(Blocks.DEAD_TUBE_CORAL, Blocks.DEAD_BRAIN_CORAL, Blocks.DEAD_BUBBLE_CORAL, Blocks.DEAD_FIRE_CORAL,
|
||||||
Blocks.DEAD_HORN_CORAL, Blocks.TUBE_CORAL, Blocks.BRAIN_CORAL, Blocks.BUBBLE_CORAL,
|
Blocks.DEAD_HORN_CORAL, Blocks.TUBE_CORAL, Blocks.BRAIN_CORAL, Blocks.BUBBLE_CORAL,
|
||||||
|
|
|
@ -40,7 +40,7 @@ public record ServerDebugInfoPacket(String serverInfo) implements ClientboundPac
|
||||||
String text = output.toString();
|
String text = output.toString();
|
||||||
Minecraft.getInstance().keyboardHandler.setClipboard(text);
|
Minecraft.getInstance().keyboardHandler.setClipboard(text);
|
||||||
CreateLang.translate("command.debuginfo.saved_to_clipboard")
|
CreateLang.translate("command.debuginfo.saved_to_clipboard")
|
||||||
.color(DyeHelper.DYE_TABLE.get(DyeColor.LIME)
|
.color(DyeHelper.getDyeColors(DyeColor.LIME)
|
||||||
.getFirst())
|
.getFirst())
|
||||||
.sendChat(player);
|
.sendChat(player);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue