mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-11-24 17:18:54 -05:00
Some Requested Changes
This commit is contained in:
1 parent
f72b65bfac
commit
be47dbcede
3 files changed
+10
-22
No files matched your search
@@ -18,6 +18,8 @@ import com.cobblemon.mod.common.block.TMBlock
|
||||
import com.cobblemon.mod.common.gui.TMMScreenHandler
|
||||
import com.cobblemon.mod.common.item.components.TMMoveComponent
|
||||
import com.cobblemon.mod.common.util.itemRegistry
|
||||
import com.cobblemon.mod.common.util.playSoundServer
|
||||
import com.cobblemon.mod.common.util.toVec3d
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.core.HolderLookup
|
||||
@@ -77,21 +79,11 @@ class TMBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlockEntity
|
||||
}
|
||||
|
||||
fun playSound(world: Level, pos: BlockPos, state: BlockState, sound: SoundEvent) {
|
||||
var d = pos.x.toDouble() + 0.5
|
||||
val e = pos.y.toDouble() + 0.5
|
||||
var f = pos.z.toDouble() + 0.5
|
||||
val direction = state.getValue(BlockStateProperties.HORIZONTAL_FACING)
|
||||
d += direction.stepX.toDouble() * 0.5
|
||||
f += direction.stepZ.toDouble() * 0.5
|
||||
world.playSound(
|
||||
null,
|
||||
d,
|
||||
e,
|
||||
f,
|
||||
sound,
|
||||
SoundSource.BLOCKS,
|
||||
0.5f,
|
||||
world.random.nextFloat() * 0.1f + 0.9f
|
||||
world.playSoundServer(
|
||||
position = pos.toVec3d(),
|
||||
sound = sound,
|
||||
volume = 0.5F,
|
||||
pitch = 1F
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -254,10 +246,7 @@ class TMBlockEntity(pos: BlockPos, state: BlockState) : BaseContainerBlockEntity
|
||||
|
||||
val recipe = TechnicalMachines.moveToTM[filterTM]?.recipe
|
||||
if (recipe != null) {
|
||||
if (this.tmmInventory.getItem(2).item != this.level?.itemRegistry?.get(recipe.item) || this.tmmInventory.getItem(
|
||||
2
|
||||
).count < recipe.count
|
||||
) return 0
|
||||
if (this.tmmInventory.getItem(2).item != this.level?.itemRegistry?.get(recipe.item) || this.tmmInventory.getItem(2).count < recipe.count) return 0
|
||||
}
|
||||
|
||||
return 15
|
||||
|
||||
@@ -609,7 +609,7 @@ class TMMHandledScreen(
|
||||
}
|
||||
|
||||
override fun children(): MutableList<GuiEventListener> {
|
||||
val list : MutableList<GuiEventListener> = Lists.newArrayList()
|
||||
val list : MutableList<GuiEventListener> = mutableListOf()
|
||||
for (child in children) {
|
||||
list.add(child.value)
|
||||
}
|
||||
|
||||
+1
-2
@@ -23,9 +23,8 @@ object CraftBlankTMPacketHandler : ServerNetworkPacketHandler<CraftBlankTMPacket
|
||||
override fun handle(packet: CraftBlankTMPacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
val screen = player.containerMenu as TMMScreenHandler
|
||||
if (screen.inventory == null) return
|
||||
val ingredientSlot = screen.inventory!!.getItem(2)
|
||||
|
||||
if (!screen.result.isEmpty) return
|
||||
val ingredientSlot = screen.inventory!!.getItem(2)
|
||||
|
||||
if (ingredientSlot.`is`(Items.AMETHYST_SHARD) && ingredientSlot.count >= 1) {
|
||||
screen.inventory!!.removeItem(2, 1)
|
||||
|
||||
Reference in new issue
Block a user