Compare commits

...

9 Commits

23 changed files with 244 additions and 174 deletions

BIN
assets/interface.xcf Normal file

Binary file not shown.

View File

@ -5,13 +5,62 @@ plugins {
id "com.github.johnrengelman.shadow" version "4.0.4"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
allprojects {
pluginManager.withPlugin("java") {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
configure(allprojects.findAll { it.name != "kiwi-java" }) {
pluginManager.withPlugin("fabric-loom") {
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
}
}
pluginManager.withPlugin("java") {
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
}
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
}
}
}
minecraft {
log4jConfigs.from "PhyConDebugLogging.xml"
}
@ -24,15 +73,6 @@ repositories {
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
modImplementation "alexiil.mc.lib:libblockattributes-all:${project.libblockattributes_version}"
@ -55,32 +95,6 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:${project.junit_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }

View File

@ -3,17 +3,10 @@ plugins {
id "org.jetbrains.kotlin.jvm"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
minecraft {
log4jConfigs.from "PhyConDebugLogging.xml"
}
repositories {
maven {
url = "https://maven.shedaniel.me/"
@ -22,15 +15,6 @@ repositories {
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
implementation project(":")
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}") {
@ -40,35 +24,3 @@ dependencies {
exclude group: "net.fabricmc.fabric-api"
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}

View File

@ -80,11 +80,12 @@ class Label(
updateIntrinsicContentSize(false)
}
private fun updateIntrinsicContentSize(canWrap: Boolean): Boolean {
private fun updateIntrinsicContentSize(canWrap: Boolean, isFromDidLayout: Boolean = false): Boolean {
if (RenderHelper.disabled) return false
val oldSize = intrinsicContentSize
if (wrappingMode == WrappingMode.WRAP && canWrap && hasSolver) {
// don't wrap until we've laid out without wrapping to ensure the current bounds reflect the maximum available space
if (wrappingMode == WrappingMode.WRAP && canWrap && hasSolver && isFromDidLayout) {
val lines = textRenderer.wrapLines(text, bounds.width.toInt())
val height = (if (maxLines == 0) lines.size else min(lines.size, maxLines)) * textRenderer.fontHeight
intrinsicContentSize = Size(bounds.width, height.toDouble())
@ -120,7 +121,7 @@ class Label(
super.didLayout()
computeLines()
if (updateIntrinsicContentSize(true)) {
if (updateIntrinsicContentSize(true, true)) {
// if the intrinsic content size changes, relayout
window!!.layout()
}

View File

@ -95,7 +95,9 @@ class ExtractorBlockEntity: DeviceBlockEntity(PhyBlockEntities.EXTRACTOR),
for (slot in 0 until inventory.slotCount) {
val slotStack = inventory.getInvStack(slot)
if (slotStack.isEmpty) continue
dispatchItemStack(slotStack) { insertion ->
val extractable = inventory.extractStack(slot, ExactItemStackFilter(slotStack), ItemStack.EMPTY, slotStack.count, Simulation.SIMULATE)
if (extractable.isEmpty) continue
dispatchItemStack(extractable) { insertion ->
insertion.inventory = inventory
insertion.inventorySlot = slot
}

View File

@ -29,7 +29,7 @@ abstract class FaceDeviceModel: UnbakedModel, BakedModel {
protected val defaultRotations = listOf(
ModelRotation.X0_Y0,
ModelRotation.X180_Y0,
ModelRotation.X270_Y0,
ModelRotation.X90_Y180,
ModelRotation.X90_Y0,
ModelRotation.X90_Y90,
ModelRotation.X90_Y270,

View File

@ -28,8 +28,8 @@ object PhyItems {
val TERMINAL = DeviceBlockItem(PhyBlocks.TERMINAL, Item.Settings())
val SWITCH = BlockItem(PhyBlocks.SWITCH, Item.Settings())
val CABLE = BlockItem(PhyBlocks.CABLE, Item.Settings())
val EXTRACTOR = DeviceBlockItem(PhyBlocks.EXTRACTOR, Item.Settings())
val INSERTER = DeviceBlockItem(PhyBlocks.INSERTER, Item.Settings())
val EXTRACTOR = FaceDeviceBlockItem(PhyBlocks.EXTRACTOR, Item.Settings())
val INSERTER = FaceDeviceBlockItem(PhyBlocks.INSERTER, Item.Settings())
val MINER = DeviceBlockItem(PhyBlocks.MINER, Item.Settings())
val REDSTONE_CONTROLLER = FaceDeviceBlockItem(PhyBlocks.REDSTONE_CONTROLLER, Item.Settings())
val REDSTONE_EMITTER = FaceDeviceBlockItem(PhyBlocks.REDSTONE_EMITTER, Item.Settings())

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "phycon:block/switch"
}
}
}

View File

@ -1,40 +1,43 @@
{
"parent": "block/block",
"textures": {
"switch": "phycon:block/switch",
"front": "phycon:block/extractor_front",
"particle": "#front"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 2, 16],
"faces": {
"down": {"texture": "phycon:block/extractor_front", "cullface": "down"},
"up": {"texture": "phycon:block/extractor_back"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"down": {"texture": "#front", "cullface": "down"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
},
{
"from": [2, 2, 2],
"to": [14, 4, 14],
"faces": {
"up": {"texture": "phycon:block/extractor_back"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
},
{
"from": [4, 4, 4],
"to": [12, 6, 12],
"faces": {
"up": {"texture": "phycon:block/extractor_back"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
}
]

View File

@ -1,40 +1,44 @@
{
"parent": "block/block",
"textures": {
"switch": "phycon:block/switch",
"front": "phycon:block/inserter_front",
"front_middle": "phycon:block/inserter_front_middle",
"particle": "#front"
},
"elements": [
{
"from": [4, 0, 4],
"to": [12, 2, 12],
"faces": {
"down": {"texture": "phycon:block/extractor_front", "cullface": "down"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"down": {"texture": "#front", "cullface": "down"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
},
{
"from": [2, 2, 2],
"to": [14, 4, 14],
"faces": {
"down": {"texture": "phycon:block/extractor_front"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"down": {"texture": "#front_middle"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
},
{
"from": [0, 4, 0],
"to": [16, 6, 16],
"faces": {
"down": {"texture": "phycon:block/extractor_front"},
"up": {"texture": "phycon:block/extractor_back"},
"north": {"texture": "phycon:block/extractor_side"},
"south": {"texture": "phycon:block/extractor_side"},
"west": {"texture": "phycon:block/extractor_side"},
"east": {"texture": "phycon:block/extractor_side"}
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"south": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"west": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"east": {"texture": "#switch", "uv": [0, 0, 16, 2]}
}
}
]

View File

@ -1,19 +1,22 @@
{
"parent": "block/block",
"textures": {
"cable": "phycon:block/cable_straight"
"cable": "phycon:block/cable_straight",
"particle": "#front",
"back": "phycon:block/interface_back",
"front": "phycon:block/interface_front"
},
"elements": [
{
"from": [2, 0, 2],
"to": [14, 2, 14],
"faces": {
"down": { "texture": "phycon:block/interface_front" },
"up": { "texture": "phycon:block/interface_back" },
"north": { "texture": "phycon:block/interface_side" },
"south": { "texture": "phycon:block/interface_side" },
"west": { "texture": "phycon:block/interface_side" },
"east": { "texture": "phycon:block/interface_side" }
"down": { "texture": "#front" },
"up": { "texture": "#back" },
"north": { "texture": "#back" },
"south": { "texture": "#back" },
"west": { "texture": "#back" },
"east": { "texture": "#back" }
}
},
{

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "phycon:block/switch"
}
}

View File

@ -0,0 +1,50 @@
{
"parent": "block/block",
"display": {
"firstperson_righthand": {
"rotation": [ 0, 215, 0 ],
"translation": [ 3, 0, -3 ],
"scale": [ 0.40, 0.40, 0.40 ]
}
},
"textures": {
"switch": "phycon:block/switch",
"front": "phycon:block/extractor_front"
},
"elements": [
{
"from": [14, 0, 0],
"to": [16, 16, 16],
"faces": {
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"},
"east": {"texture": "#front"}
}
},
{
"from": [12, 2, 2],
"to": [14, 14, 14],
"faces": {
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"}
}
},
{
"from": [10, 4, 4],
"to": [12, 12, 12],
"faces": {
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"west": {"texture": "#switch"}
}
}
]
}

View File

@ -0,0 +1,51 @@
{
"parent": "block/block",
"display": {
"firstperson_righthand": {
"rotation": [ 0, 215, 0 ],
"translation": [ 3, 0, -3 ],
"scale": [ 0.40, 0.40, 0.40 ]
}
},
"textures": {
"switch": "phycon:block/switch",
"front": "phycon:block/inserter_front",
"front_middle": "phycon:block/inserter_front_middle"
},
"elements": [
{
"from": [14, 4, 4],
"to": [16, 12, 12],
"faces": {
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"east": {"texture": "#front"}
}
},
{
"from": [12, 2, 2],
"to": [14, 14, 14],
"faces": {
"down": {"texture": "#switch"},
"up": {"texture": "#switch"},
"north": {"texture": "#switch"},
"south": {"texture": "#switch"},
"east": {"texture": "#front_middle"}
}
},
{
"from": [10, 0, 0],
"to": [12, 16, 16],
"faces": {
"down": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"up": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"north": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"south": {"texture": "#switch", "uv": [0, 0, 16, 2]},
"west": {"texture": "#switch"},
"east": {"texture": "#switch"}
}
}
]
}

View File

@ -2,53 +2,27 @@
"parent": "block/block",
"display": {
"firstperson_righthand": {
"rotation": [0, 215, 0],
"translation": [0, 0, 0],
"scale": [0.4, 0.4, 0.4]
},
"thirdperson_righthand": {
"rotation": [75, 215, 0],
"translation": [0, -2.5, 0],
"scale": [0.375, 0.375, 0.375]
"rotation": [ 0, 215, 0 ],
"translation": [ 3, 0, -3 ],
"scale": [ 0.40, 0.40, 0.40 ]
}
},
"textures": {
"front": "phycon:block/interface_front",
"back": "phycon:block/switch"
},
"elements": [
{
"_comment": "cable center",
"from": [6, 6, 6],
"to": [10, 10, 10],
"from": [14, 2, 2],
"to": [16, 14, 14],
"faces": {
"down": { "texture": "phycon:block/cable_center" },
"up": { "texture": "phycon:block/cable_center" },
"north": { "texture": "phycon:block/cable_center" },
"south": { "texture": "phycon:block/cable_center" },
"west": { "texture": "phycon:block/cable_center" },
"east": { "texture": "phycon:block/cable_center" }
}
},
{
"_comment": "interface side",
"from": [2, 2, 14],
"to": [14, 14, 16],
"faces": {
"down": { "texture": "phycon:block/interface_side" },
"up": { "texture": "phycon:block/interface_side" },
"north": { "texture": "phycon:block/interface_front" },
"south": { "texture": "phycon:block/interface_back" },
"west": { "texture": "phycon:block/interface_side" },
"east": { "texture": "phycon:block/interface_side" }
}
},
{
"_comment": "interface middle",
"from": [6, 6, 10],
"to": [10, 10, 14],
"faces": {
"down": { "texture": "phycon:block/cable_side" },
"up": { "texture": "phycon:block/cable_side" },
"west": { "texture": "phycon:block/cable_side" },
"east": { "texture": "phycon:block/cable_side" }
"down": { "texture": "#back" },
"up": { "texture": "#back" },
"north": { "texture": "#back" },
"south": { "texture": "#back" },
"west": { "texture": "#back" },
"east": { "texture": "#front" }
}
}
]
}
}

View File

@ -0,0 +1,3 @@
{
"parent": "phycon:block/switch"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B