roflite vessels for the roflite cube

This commit is contained in:
GearShocky 2025-04-17 13:10:42 +05:00
parent 4dfbfa42e5
commit de2bfdc33b
12 changed files with 169 additions and 0 deletions

View File

@ -364,4 +364,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
blockStateProvider.block(MBlocks.ENGINE) blockStateProvider.block(MBlocks.ENGINE)
itemModelProvider.block(MItems.ENGINE) itemModelProvider.block(MItems.ENGINE)
blockStateProvider.block(MBlocks.ROFLITE_VESSEL)
itemModelProvider.block(MItems.ROFLITE_VESSEL)
} }

View File

@ -273,6 +273,8 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.WOODEN_CRATE) provider.block(MItems.WOODEN_CRATE)
provider.block(MItems.WOODEN_CRATE_DECORATIVE) provider.block(MItems.WOODEN_CRATE_DECORATIVE)
provider.block(MItems.ROFLITE_VESSEL)
provider.block(MItems.GENERATOR_BLOCK) provider.block(MItems.GENERATOR_BLOCK)
provider.block(MItems.ENERGY_INPUT_INTERFACE) provider.block(MItems.ENERGY_INPUT_INTERFACE)
provider.block(MItems.ENERGY_OUTPUT_INTERFACE) provider.block(MItems.ENERGY_OUTPUT_INTERFACE)

View File

@ -5,6 +5,7 @@ import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition
import ru.dbotthepony.mc.otm.registry.game.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addDecorativeLoot(lootTables: LootTables) { fun addDecorativeLoot(lootTables: LootTables) {
lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }

View File

@ -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")) { loot.builder(LootContextParamSets.CHEST, modLootTable("frigate_cargo")) {
lootPool { lootPool {
item(Items.IRON_INGOT) { setCount(minimal = 1, maximal = 3)} item(Items.IRON_INGOT) { setCount(minimal = 1, maximal = 3)}

View File

@ -865,4 +865,11 @@ public class BlockShapes {
new SimpleCuboid(0d, 0.625d, 0d, 0d, 0.8125d, 0.5625d), new SimpleCuboid(0d, 0.625d, 0d, 0d, 0.8125d, 0.5625d),
new SimpleCuboid(1d, 0.625d, 0d, 1d, 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)
);
} }

View File

@ -2,13 +2,19 @@ package ru.dbotthepony.mc.otm.block.decorative
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.world.item.ItemStack 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.EntityBlock
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.storage.loot.LootParams import net.minecraft.world.level.storage.loot.LootParams
import net.minecraft.world.level.storage.loot.parameters.LootContextParams 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.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.BreakableContainerBlockEntity 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 { class BreakableContainerBlock(properties: Properties) : RotatableMatteryBlock(properties), EntityBlock {
override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity { override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity {
@ -23,4 +29,19 @@ class BreakableContainerBlock(properties: Properties) : RotatableMatteryBlock(pr
return super.getDrops(state, params) 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)
}
} }

View File

@ -139,6 +139,8 @@ object MNames {
const val CUT_ROFLITE_SLAB = "cut_roflite_slab" const val CUT_ROFLITE_SLAB = "cut_roflite_slab"
const val ROFLITE_PILLAR = "roflite_pillar" const val ROFLITE_PILLAR = "roflite_pillar"
const val ROFLITE_VESSEL = "roflite_vessel"
// items // items
const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor" const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor"

View File

@ -123,6 +123,7 @@ object MBlockEntities {
val blocks = ArrayList<Block>() val blocks = ArrayList<Block>()
blocks.add(MBlocks.SMALL_CAPSULE) blocks.add(MBlocks.SMALL_CAPSULE)
blocks.add(MBlocks.WOODEN_CRATE) blocks.add(MBlocks.WOODEN_CRATE)
blocks.add(MBlocks.ROFLITE_VESSEL)
BlockEntityType.Builder.of(::BreakableContainerBlockEntity, *blocks.toTypedArray()).build(null) BlockEntityType.Builder.of(::BreakableContainerBlockEntity, *blocks.toTypedArray()).build(null)
} }

View File

@ -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 { init {
MRegistry.registerBlocks(registry) MRegistry.registerBlocks(registry)
} }

View File

@ -709,6 +709,8 @@ object MItems {
val WOODEN_CRATE by registry.register(MNames.WOODEN_CRATE) { BlockItem(MBlocks.WOODEN_CRATE, DEFAULT_PROPERTIES) } 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 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 { init {
MRegistry.registerItems(registry) MRegistry.registerItems(registry)
} }

View File

@ -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]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B