diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt index 49dad5b19..27f6d49f4 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DecorativeData.kt @@ -364,4 +364,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr blockStateProvider.block(MBlocks.ENGINE) itemModelProvider.block(MItems.ENGINE) + + blockStateProvider.block(MBlocks.ROFLITE_VESSEL) + itemModelProvider.block(MItems.ROFLITE_VESSEL) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index 1ba470189..2dd8f57ec 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -273,6 +273,8 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.block(MItems.WOODEN_CRATE) provider.block(MItems.WOODEN_CRATE_DECORATIVE) + provider.block(MItems.ROFLITE_VESSEL) + provider.block(MItems.GENERATOR_BLOCK) provider.block(MItems.ENERGY_INPUT_INTERFACE) provider.block(MItems.ENERGY_OUTPUT_INTERFACE) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt index 2eda654e7..8cfb5b534 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/DecorativeLoot.kt @@ -5,6 +5,7 @@ import net.minecraft.world.level.block.state.properties.DoubleBlockHalf import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition import ru.dbotthepony.mc.otm.registry.game.MBlocks import ru.dbotthepony.mc.otm.registry.MRegistry +import ru.dbotthepony.mc.otm.registry.game.MItems fun addDecorativeLoot(lootTables: LootTables) { lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt index ad6b7ae37..539b6f7b5 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt @@ -96,6 +96,20 @@ fun addChestLootTables(loot: LootTables) { } } + loot.builder(LootContextParamSets.BLOCK, modLootTable("roflite_vessel")) { + lootPool { + item(MItems.MATTER_DUST) { + apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(300), Decimal(1_500)))) + } + } + lootPool { + item(MItems.MATTER_DUST) { + chanceCondition(0.3) + apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500)))) + } + } + } + loot.builder(LootContextParamSets.CHEST, modLootTable("frigate_cargo")) { lootPool { item(Items.IRON_INGOT) { setCount(minimal = 1, maximal = 3)} diff --git a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java index e2e199955..4e13cb27e 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java +++ b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java @@ -865,4 +865,11 @@ public class BlockShapes { new SimpleCuboid(0d, 0.625d, 0d, 0d, 0.8125d, 0.5625d), new SimpleCuboid(1d, 0.625d, 0d, 1d, 0.8125d, 0.5625d) ); + + public static final BlockShape ROFLITE_VESSEL = new BlockShape( + new SimpleCuboid(0d, 0.375d, 0d, 1d, 0.875d, 1d), + new SimpleCuboid(0.0625d, 0d, 0.0625d, 0.9375d, 0.1875d, 0.9375d), + new SimpleCuboid(0.125d, 0.1875d, 0.125d, 0.875d, 0.375d, 0.875d), + new SimpleCuboid(0.1875d, 0.875d, 0.1875d, 0.8125d, 1d, 0.8125d) + ); } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/BreakableContainerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/BreakableContainerBlock.kt index dd68686cf..c7dcff76e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/BreakableContainerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/BreakableContainerBlock.kt @@ -2,13 +2,19 @@ package ru.dbotthepony.mc.otm.block.decorative import net.minecraft.core.BlockPos import net.minecraft.world.item.ItemStack +import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.block.EntityBlock import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.storage.loot.LootParams import net.minecraft.world.level.storage.loot.parameters.LootContextParams +import net.minecraft.world.phys.shapes.CollisionContext +import net.minecraft.world.phys.shapes.VoxelShape +import net.minecraft.world.phys.shapes.Shapes import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.decorative.BreakableContainerBlockEntity +import ru.dbotthepony.mc.otm.registry.game.MBlocks +import ru.dbotthepony.mc.otm.shapes.BlockShapes class BreakableContainerBlock(properties: Properties) : RotatableMatteryBlock(properties), EntityBlock { override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity { @@ -23,4 +29,19 @@ class BreakableContainerBlock(properties: Properties) : RotatableMatteryBlock(pr return super.getDrops(state, params) } + + //i just nuked myself + private val vesselShape by lazy { BlockShapes.ROFLITE_VESSEL.computeShape()} + + + override fun getShape( + state: BlockState, + blockGetter: BlockGetter, + pos: BlockPos, + context: CollisionContext + ): VoxelShape { + //невероятные костыли + return if (state.block == MBlocks.ROFLITE_VESSEL) vesselShape + else super.getShape(state, blockGetter, pos, context) + } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index 0351ab0d4..d64989591 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -139,6 +139,8 @@ object MNames { const val CUT_ROFLITE_SLAB = "cut_roflite_slab" const val ROFLITE_PILLAR = "roflite_pillar" + const val ROFLITE_VESSEL = "roflite_vessel" + // items const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlockEntities.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlockEntities.kt index 56434f2d4..d2281da21 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlockEntities.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlockEntities.kt @@ -123,6 +123,7 @@ object MBlockEntities { val blocks = ArrayList() blocks.add(MBlocks.SMALL_CAPSULE) blocks.add(MBlocks.WOODEN_CRATE) + blocks.add(MBlocks.ROFLITE_VESSEL) BlockEntityType.Builder.of(::BreakableContainerBlockEntity, *blocks.toTypedArray()).build(null) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt index c36272a09..6cf9bdae5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MBlocks.kt @@ -532,6 +532,16 @@ object MBlocks { ) } + val ROFLITE_VESSEL by registry.register(MNames.ROFLITE_VESSEL) { + BreakableContainerBlock( + BlockBehaviour.Properties.of() + .mapColor(MapColor.COLOR_BROWN) + .sound(SoundType.DECORATED_POT_CRACKED) + .destroyTime(0.2f) + .explosionResistance(1f) + ) + } + init { MRegistry.registerBlocks(registry) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index b558e8508..6e100efeb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -709,6 +709,8 @@ object MItems { val WOODEN_CRATE by registry.register(MNames.WOODEN_CRATE) { BlockItem(MBlocks.WOODEN_CRATE, DEFAULT_PROPERTIES) } val WOODEN_CRATE_DECORATIVE by registry.register(MNames.WOODEN_CRATE_DECORATIVE) { BlockItem(MBlocks.WOODEN_CRATE_DECORATIVE, DEFAULT_PROPERTIES) } + val ROFLITE_VESSEL by registry.register(MNames.ROFLITE_VESSEL) { BlockItem(MBlocks.ROFLITE_VESSEL, DEFAULT_PROPERTIES) } + init { MRegistry.registerItems(registry) } diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/roflite_vessel.json b/src/main/resources/assets/overdrive_that_matters/models/block/roflite_vessel.json new file mode 100644 index 000000000..b0fa218a9 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/block/roflite_vessel.json @@ -0,0 +1,106 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "overdrive_that_matters:block/roflite_vessel", + "1": "overdrive_that_matters:block/decorative/chiseled_roflite", + "particle": "overdrive_that_matters:block/roflite_vessel" + }, + "elements": [ + { + "from": [0, 6, 0], + "to": [16, 14, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 0, 1]}, + "faces": { + "north": {"uv": [0, 2, 16, 10], "texture": "#0"}, + "east": {"uv": [0, 2, 16, 10], "texture": "#0"}, + "south": {"uv": [0, 2, 16, 10], "texture": "#0"}, + "west": {"uv": [0, 2, 16, 10], "texture": "#0"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#1"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#1"} + } + }, + { + "from": [1, 0, 1], + "to": [15, 3, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [13, -5, 1]}, + "faces": { + "north": {"uv": [1, 13, 15, 16], "texture": "#0"}, + "east": {"uv": [1, 13, 15, 16], "texture": "#0"}, + "south": {"uv": [1, 13, 15, 16], "texture": "#0"}, + "west": {"uv": [1, 13, 15, 16], "texture": "#0"}, + "up": {"uv": [1, 1, 15, 15], "texture": "#1"}, + "down": {"uv": [1, 1, 15, 15], "texture": "#1"} + } + }, + { + "from": [2, 3, 2], + "to": [14, 6, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [13, -2, 1]}, + "faces": { + "north": {"uv": [2, 10, 14, 13], "texture": "#0"}, + "east": {"uv": [2, 10, 14, 13], "texture": "#0"}, + "south": {"uv": [2, 10, 14, 13], "texture": "#0"}, + "west": {"uv": [2, 10, 14, 13], "texture": "#0"} + } + }, + { + "from": [4, 14, 4], + "to": [12, 15, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 9, 1]}, + "faces": { + "north": {"uv": [4, 1, 12, 2], "texture": "#0"}, + "east": {"uv": [4, 1, 12, 2], "texture": "#0"}, + "south": {"uv": [4, 1, 12, 2], "texture": "#0"}, + "west": {"uv": [4, 1, 12, 2], "texture": "#0"} + } + }, + { + "from": [3, 15, 3], + "to": [13, 18, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 11, 1]}, + "faces": { + "north": {"uv": [1, 13, 11, 16], "texture": "#0"}, + "east": {"uv": [1, 13, 11, 16], "texture": "#0"}, + "south": {"uv": [1, 13, 11, 16], "texture": "#0"}, + "west": {"uv": [1, 13, 11, 16], "texture": "#0"}, + "up": {"uv": [3, 3, 13, 13], "texture": "#1"}, + "down": {"uv": [3, 3, 13, 13], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 13, 0], + "scale": [0.99805, 0.99805, 0.99805] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/roflite_vessel.png b/src/main/resources/assets/overdrive_that_matters/textures/block/roflite_vessel.png new file mode 100644 index 000000000..1a193a345 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/roflite_vessel.png differ