Compare commits
No commits in common. "87f0bdb85ac5fb4155e7a5188987583e71bb753d" and "961c74de342b52bc71d1d15811630319f60937f7" have entirely different histories.
87f0bdb85a
...
961c74de34
|
@ -41,5 +41,4 @@ object PhyConPlugin: ClientModInitializer, REIPluginV0 {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
package net.shadowfacts.phycon.plugin.rei
|
||||
|
||||
import me.shedaniel.rei.server.ContainerContext
|
||||
import me.shedaniel.rei.server.ContainerInfo
|
||||
import me.shedaniel.rei.server.ContainerInfoHandler
|
||||
import me.shedaniel.rei.server.StackAccessor
|
||||
import net.fabricmc.api.ModInitializer
|
||||
import net.minecraft.util.Identifier
|
||||
import net.shadowfacts.phycon.block.terminal.CraftingTerminalScreenHandler
|
||||
|
||||
/**
|
||||
* @author shadowfacts
|
||||
*/
|
||||
object PhyConPluginCommon: ModInitializer {
|
||||
|
||||
override fun onInitialize() {
|
||||
ContainerInfoHandler.registerContainerInfo(Identifier("minecraft", "plugins/crafting"), TerminalInfo)
|
||||
}
|
||||
|
||||
object TerminalInfo: ContainerInfo<CraftingTerminalScreenHandler> {
|
||||
override fun getContainerClass() = CraftingTerminalScreenHandler::class.java
|
||||
|
||||
override fun getCraftingResultSlotIndex(container: CraftingTerminalScreenHandler): Int {
|
||||
return container.resultSlot.id
|
||||
}
|
||||
|
||||
override fun getCraftingWidth(container: CraftingTerminalScreenHandler): Int {
|
||||
return 3
|
||||
}
|
||||
|
||||
override fun getCraftingHeight(container: CraftingTerminalScreenHandler): Int {
|
||||
return 3
|
||||
}
|
||||
|
||||
override fun getGridStacks(context: ContainerContext<CraftingTerminalScreenHandler>): List<StackAccessor> {
|
||||
val handler = context.container
|
||||
return (handler.craftingSlotsStart until handler.craftingSlotsEnd).map(context::getStack)
|
||||
}
|
||||
|
||||
override fun getInventoryStacks(context: ContainerContext<CraftingTerminalScreenHandler>): List<StackAccessor> {
|
||||
val handler = context.container
|
||||
val slots = (handler.playerSlotsStart until handler.playerSlotsEnd) + (handler.bufferSlotsStart until handler.bufferSlotsEnd)
|
||||
return slots.map(context::getStack)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,13 +12,8 @@
|
|||
"homepage": "https://git.shadowfacts.net/minecraft/PhysicalConnectivity"
|
||||
},
|
||||
"license": "LGPL-3.0",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
{
|
||||
"adapter": "kotlin",
|
||||
"value": "net.shadowfacts.phycon.plugin.rei.PhyConPluginCommon"
|
||||
}
|
||||
],
|
||||
"client": [
|
||||
{
|
||||
"adapter": "kotlin",
|
||||
|
@ -39,7 +34,7 @@
|
|||
"fabric": "*",
|
||||
"fabric-language-kotlin": ">=1.3.50",
|
||||
"phycon": "*",
|
||||
"roughlyenoughitems": "^5.0.0"
|
||||
"roughlyenoughitems": "*"
|
||||
},
|
||||
|
||||
"custom": {
|
||||
|
|
|
@ -171,7 +171,7 @@ abstract class AbstractTerminalScreen<BE: AbstractTerminalBlockEntity, T: Abstra
|
|||
override fun onMouseClick(slot: Slot?, invSlot: Int, clickData: Int, type: SlotActionType?) {
|
||||
super.onMouseClick(slot, invSlot, clickData, type)
|
||||
|
||||
if (slot != null && !slot.stack.isEmpty && handler.isNetworkSlot(slot.id) && playerInventory.cursorStack.isEmpty) {
|
||||
if (slot != null && !slot.stack.isEmpty && handler.isNetworkSlot(slot.id)) {
|
||||
val stack = slot.stack
|
||||
|
||||
if (type == SlotActionType.QUICK_MOVE) {
|
||||
|
|
|
@ -29,10 +29,6 @@ class CraftingTerminalScreenHandler(
|
|||
val result = CraftingResultInventory()
|
||||
val resultSlot: CraftingResultSlot
|
||||
|
||||
val craftingSlotsStart: Int
|
||||
val craftingSlotsEnd: Int
|
||||
get() = craftingSlotsStart + 9
|
||||
|
||||
override val xOffset: Int
|
||||
get() = 5
|
||||
|
||||
|
@ -44,7 +40,6 @@ class CraftingTerminalScreenHandler(
|
|||
)
|
||||
|
||||
init {
|
||||
craftingSlotsStart = slots.size
|
||||
for (y in 0 until 3) {
|
||||
for (x in 0 until 3) {
|
||||
this.addSlot(Slot(craftingInv, x + y * 3, 13 + x * 18, 140 + y * 18))
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package net.shadowfacts.phycon.block.terminal
|
||||
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.client.gui.screen.Screen
|
||||
import net.minecraft.client.util.InputUtil
|
||||
import net.minecraft.text.TranslatableText
|
||||
import net.minecraft.util.Identifier
|
||||
|
@ -90,7 +89,7 @@ class CraftingTerminalViewController(
|
|||
private fun plusPressed(button: Button) {
|
||||
val client = MinecraftClient.getInstance()
|
||||
val action =
|
||||
if (Screen.hasShiftDown()) {
|
||||
if (InputUtil.isKeyPressed(client.window.handle, GLFW.GLFW_KEY_LEFT_SHIFT) || InputUtil.isKeyPressed(client.window.handle, GLFW.GLFW_KEY_RIGHT_SHIFT)) {
|
||||
C2STerminalCraftingButton.Action.REQUEST_MAX_MORE
|
||||
} else {
|
||||
C2STerminalCraftingButton.Action.REQUEST_ONE_MORE
|
||||
|
|
Loading…
Reference in New Issue