Merge remote-tracking branch 'origin/1.21' into 1.21
This commit is contained in:
commit
e49a65a2de
@ -133,7 +133,7 @@ fun addTags(tagsProvider: TagsProvider) {
|
|||||||
tagsProvider.items.Appender(ItemTags.AXES).add(MItems.TRITANIUM_AXE)
|
tagsProvider.items.Appender(ItemTags.AXES).add(MItems.TRITANIUM_AXE)
|
||||||
tagsProvider.items.Appender(ItemTags.PICKAXES).add(MItems.TRITANIUM_PICKAXE)
|
tagsProvider.items.Appender(ItemTags.PICKAXES).add(MItems.TRITANIUM_PICKAXE)
|
||||||
tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_SHOVEL)
|
tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_SHOVEL)
|
||||||
tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_HOE)
|
tagsProvider.items.Appender(ItemTags.HOES).add(MItems.TRITANIUM_HOE)
|
||||||
tagsProvider.items.Appender(Tags.Items.TOOLS_SHEAR).add(MItems.TRITANIUM_SHEARS)
|
tagsProvider.items.Appender(Tags.Items.TOOLS_SHEAR).add(MItems.TRITANIUM_SHEARS)
|
||||||
tagsProvider.items.Appender(Tags.Items.TOOLS_SHIELD).add(MItems.TRITANIUM_SHIELD)
|
tagsProvider.items.Appender(Tags.Items.TOOLS_SHIELD).add(MItems.TRITANIUM_SHIELD)
|
||||||
|
|
||||||
@ -180,6 +180,23 @@ fun addTags(tagsProvider: TagsProvider) {
|
|||||||
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems)
|
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems)
|
||||||
.add(MItems.TRITANIUM_STRIPED_WALL.values)
|
.add(MItems.TRITANIUM_STRIPED_WALL.values)
|
||||||
|
|
||||||
|
tagsProvider.items.Appender(MItemTags.NO_REPLICATION)
|
||||||
|
.add(Items.WRITTEN_BOOK)
|
||||||
|
.add(Tags.Items.ORES)
|
||||||
|
.add(Tags.Items.RAW_MATERIALS)
|
||||||
|
.add(MItems.PILL_ANDROID)
|
||||||
|
.add(MItems.PILL_HUMANE)
|
||||||
|
.add(MItems.PILL_OBLIVION)
|
||||||
|
.add(MItems.QUANTUM_BATTERY)
|
||||||
|
.add(MItems.QUANTUM_CAPACITOR)
|
||||||
|
.add(MItems.QUANTUM_BATTERY_CREATIVE)
|
||||||
|
.add(MItems.ZPM_BATTERY)
|
||||||
|
.add(MItems.PROCEDURAL_BATTERY)
|
||||||
|
.add(MItems.EXOPACK_PROBE)
|
||||||
|
.add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL)
|
||||||
|
.add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_WITHER)
|
||||||
|
.add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_ENDER_DRAGON)
|
||||||
|
|
||||||
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
|
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
|
||||||
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
|
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
|
||||||
tagsProvider.requiresPickaxe(MBlocks.PAINTER, Tiers.STONE)
|
tagsProvider.requiresPickaxe(MBlocks.PAINTER, Tiers.STONE)
|
||||||
|
@ -28,13 +28,12 @@ class StarChairBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_PROPE
|
|||||||
|
|
||||||
override fun useWithoutItem(blockState: BlockState, level: Level, blockPos: BlockPos, ply: Player, blockHitResult: BlockHitResult): InteractionResult {
|
override fun useWithoutItem(blockState: BlockState, level: Level, blockPos: BlockPos, ply: Player, blockHitResult: BlockHitResult): InteractionResult {
|
||||||
if (ply.isCrouching) return super.useWithoutItem(blockState, level, blockPos, ply, blockHitResult)
|
if (ply.isCrouching) return super.useWithoutItem(blockState, level, blockPos, ply, blockHitResult)
|
||||||
|
if (level.isClientSide) return InteractionResult.SUCCESS
|
||||||
|
|
||||||
val entities = level.getEntitiesOfClass(RideableDummy::class.java, AABB(blockPos, blockPos + BlockPos(1, 1, 1)))
|
val entities = level.getEntitiesOfClass(RideableDummy::class.java, AABB(blockPos, blockPos + BlockPos(1, 1, 1)))
|
||||||
if (entities.isNotEmpty()) return InteractionResult.FAIL
|
if (entities.isNotEmpty()) return InteractionResult.FAIL
|
||||||
|
|
||||||
val entity = RideableDummy(level)
|
val entity = RideableDummy(level, blockPos, blockState)
|
||||||
entity.blockPos = blockPos
|
|
||||||
entity.blockState = blockState
|
|
||||||
|
|
||||||
entity.yRot = blockState[rotationFreedom()].front.toYRot()
|
entity.yRot = blockState[rotationFreedom()].front.toYRot()
|
||||||
entity.setPos(blockPos.x + 0.5, blockPos.y.toDouble(), blockPos.z + 0.5)
|
entity.setPos(blockPos.x + 0.5, blockPos.y.toDouble(), blockPos.z + 0.5)
|
||||||
|
@ -35,6 +35,7 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNode
|
|||||||
import ru.dbotthepony.mc.otm.matter.MatterManager
|
import ru.dbotthepony.mc.otm.matter.MatterManager
|
||||||
import ru.dbotthepony.mc.otm.menu.matter.MatterReplicatorMenu
|
import ru.dbotthepony.mc.otm.menu.matter.MatterReplicatorMenu
|
||||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MItemTags
|
||||||
import ru.dbotthepony.mc.otm.registry.MItems
|
import ru.dbotthepony.mc.otm.registry.MItems
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ -168,10 +169,11 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
val allocation = matterNode.graph.allocateTask(simulate = false) ?: return JobContainer.observe()
|
val allocation = matterNode.graph.allocateTask(simulate = false) ?: return JobContainer.observe()
|
||||||
val stack = allocation.task.stack(1)
|
|
||||||
val matter = MatterManager.get(stack)
|
|
||||||
|
|
||||||
// ????????
|
val stack = allocation.task.stack(1)
|
||||||
|
if (stack.`is`(MItemTags.NO_REPLICATION)) return JobContainer.failure()
|
||||||
|
|
||||||
|
val matter = MatterManager.get(stack)
|
||||||
if (!matter.hasMatterValue) return JobContainer.failure()
|
if (!matter.hasMatterValue) return JobContainer.failure()
|
||||||
|
|
||||||
val ticks = matter.complexity
|
val ticks = matter.complexity
|
||||||
|
@ -27,6 +27,7 @@ import ru.dbotthepony.mc.otm.menu.matter.MatterScannerMenu
|
|||||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||||
import ru.dbotthepony.mc.otm.graph.matter.MatterNode
|
import ru.dbotthepony.mc.otm.graph.matter.MatterNode
|
||||||
import ru.dbotthepony.mc.otm.matter.MatterManager
|
import ru.dbotthepony.mc.otm.matter.MatterManager
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MItemTags
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.pow
|
import kotlin.math.pow
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
val stack = container.getItem(0)
|
val stack = container.getItem(0)
|
||||||
if (stack.isEmpty || !MatterManager.canDecompose(stack)) return JobContainer.noItem()
|
if (stack.isEmpty || !MatterManager.canDecompose(stack) || stack.`is`(MItemTags.NO_DECOMPOSING) || stack.`is`(MItemTags.NO_REPLICATION)) return JobContainer.noItem()
|
||||||
|
|
||||||
var findState: PatternState? = null
|
var findState: PatternState? = null
|
||||||
|
|
||||||
|
@ -15,6 +15,11 @@ class RideableDummy(level: Level) : Entity(MEntityTypes.RIDEABLE_DUMMY, level) {
|
|||||||
var blockPos: BlockPos = BlockPos.ZERO
|
var blockPos: BlockPos = BlockPos.ZERO
|
||||||
var blockState: BlockState = Blocks.AIR.defaultBlockState()
|
var blockState: BlockState = Blocks.AIR.defaultBlockState()
|
||||||
|
|
||||||
|
constructor(level: Level, blockPos: BlockPos, blockState: BlockState) : this(level) {
|
||||||
|
this.blockPos = blockPos
|
||||||
|
this.blockState = blockState
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
isNoGravity = true
|
isNoGravity = true
|
||||||
noPhysics = true
|
noPhysics = true
|
||||||
@ -23,10 +28,9 @@ class RideableDummy(level: Level) : Entity(MEntityTypes.RIDEABLE_DUMMY, level) {
|
|||||||
override fun tick() {
|
override fun tick() {
|
||||||
super.tick()
|
super.tick()
|
||||||
|
|
||||||
|
if (level().isClientSide) return
|
||||||
if (level().getBlockState(blockPos) != blockState || passengers.isEmpty()) {
|
if (level().getBlockState(blockPos) != blockState || passengers.isEmpty()) {
|
||||||
discard()
|
discard()
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ private object TritaniumArmorRenderProperties : IClientItemExtensions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TritaniumArmorItem(slot: Type) : ArmorItem(MArmorMaterials.TRITANIUM, slot, Properties().stacksTo(1).rarity(Rarity.RARE)),
|
class TritaniumArmorItem(slot: Type) : ArmorItem(MArmorMaterials.TRITANIUM, slot, Properties().stacksTo(1).rarity(Rarity.RARE).durability(slot.getDurability(48))),
|
||||||
ClientExtensionsListener {
|
ClientExtensionsListener {
|
||||||
override fun registerClientExtensions(event: RegisterClientExtensionsEvent) {
|
override fun registerClientExtensions(event: RegisterClientExtensionsEvent) {
|
||||||
event.registerItem(TritaniumArmorRenderProperties, this)
|
event.registerItem(TritaniumArmorRenderProperties, this)
|
||||||
|
@ -29,7 +29,11 @@ object MEntityTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val RIDEABLE_DUMMY: EntityType<RideableDummy> by registry.register(MNames.RIDEABLE_DUMMY) {
|
val RIDEABLE_DUMMY: EntityType<RideableDummy> by registry.register(MNames.RIDEABLE_DUMMY) {
|
||||||
EntityType.Builder.of({ _, level -> RideableDummy(level)}, MobCategory.MISC).sized(0.5f, 0.5f).build(MNames.RIDEABLE_DUMMY)
|
EntityType.Builder.of({ _, level -> RideableDummy(level) }, MobCategory.MISC)
|
||||||
|
.sized(0.5f, 0.5f)
|
||||||
|
.passengerAttachments(0.5f)
|
||||||
|
.clientTrackingRange(8)
|
||||||
|
.build(MNames.RIDEABLE_DUMMY)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun register(bus: IEventBus) {
|
fun register(bus: IEventBus) {
|
||||||
|
@ -80,6 +80,12 @@ object MItemTags {
|
|||||||
val HARDENED_GLASS_WHITE: TagKey<Item> = ItemTags.create(ResourceLocation("c", "hardened_glass/white"))
|
val HARDENED_GLASS_WHITE: TagKey<Item> = ItemTags.create(ResourceLocation("c", "hardened_glass/white"))
|
||||||
val HARDENED_GLASS_YELLOW: TagKey<Item> = ItemTags.create(ResourceLocation("c", "hardened_glass/yellow"))
|
val HARDENED_GLASS_YELLOW: TagKey<Item> = ItemTags.create(ResourceLocation("c", "hardened_glass/yellow"))
|
||||||
|
|
||||||
val MACHINES: TagKey<Item> = ItemTags.create(ResourceLocation(OverdriveThatMatters.MOD_ID, "machines"))
|
val MACHINES: TagKey<Item> = ItemTags.create(modLoc("machines"))
|
||||||
|
|
||||||
|
val NO_DECOMPOSING: TagKey<Item> = ItemTags.create(modLoc("matter/no_decomposing"))
|
||||||
|
val NO_REPLICATION: TagKey<Item> = ItemTags.create(modLoc("matter/no_replication"))
|
||||||
|
val NO_REPAIR: TagKey<Item> = ItemTags.create(modLoc("matter/no_repair"))
|
||||||
|
|
||||||
|
fun modLoc(path: String) : ResourceLocation = ResourceLocation(OverdriveThatMatters.MOD_ID, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,10 +376,10 @@ object MItems {
|
|||||||
val TRITANIUM_PANTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_PANTS) { TritaniumArmorItem(ArmorItem.Type.LEGGINGS) }
|
val TRITANIUM_PANTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_PANTS) { TritaniumArmorItem(ArmorItem.Type.LEGGINGS) }
|
||||||
val TRITANIUM_BOOTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_BOOTS) { TritaniumArmorItem(ArmorItem.Type.BOOTS) }
|
val TRITANIUM_BOOTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_BOOTS) { TritaniumArmorItem(ArmorItem.Type.BOOTS) }
|
||||||
|
|
||||||
val SIMPLE_TRITANIUM_HELMET: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_HELMET) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.HELMET, Properties().stacksTo(1)) }
|
val SIMPLE_TRITANIUM_HELMET: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_HELMET) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.HELMET, Properties().stacksTo(1).durability(ArmorItem.Type.HELMET.getDurability(24))) }
|
||||||
val SIMPLE_TRITANIUM_CHESTPLATE: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_CHESTPLATE) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.CHESTPLATE, Properties().stacksTo(1)) }
|
val SIMPLE_TRITANIUM_CHESTPLATE: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_CHESTPLATE) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.CHESTPLATE, Properties().stacksTo(1).durability(ArmorItem.Type.CHESTPLATE.getDurability(24))) }
|
||||||
val SIMPLE_TRITANIUM_PANTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_PANTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.LEGGINGS, Properties().stacksTo(1)) }
|
val SIMPLE_TRITANIUM_PANTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_PANTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.LEGGINGS, Properties().stacksTo(1).durability(ArmorItem.Type.LEGGINGS.getDurability(24))) }
|
||||||
val SIMPLE_TRITANIUM_BOOTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_BOOTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.BOOTS, Properties().stacksTo(1)) }
|
val SIMPLE_TRITANIUM_BOOTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_BOOTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.BOOTS, Properties().stacksTo(1).durability(ArmorItem.Type.BOOTS.getDurability(24))) }
|
||||||
|
|
||||||
val TRITANIUM_ARMOR = SupplierList(
|
val TRITANIUM_ARMOR = SupplierList(
|
||||||
::TRITANIUM_HELMET,
|
::TRITANIUM_HELMET,
|
||||||
|
Loading…
Reference in New Issue
Block a user