Skip to content

Commit 0fb59a2

Browse files
committed
Merge branch 'dev' into 2018.1
2 parents cc288fc + 69e1f89 commit 0fb59a2

File tree

11 files changed

+49
-18
lines changed

11 files changed

+49
-18
lines changed

build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ val CI = System.getenv("CI") != null
3636

3737
val ideaVersion: String by extra
3838
val javaVersion: String by extra
39-
val kotlinVersion: String by extra
4039
val downloadIdeaSources: String by extra
4140

4241
// for publishing nightlies
@@ -236,9 +235,6 @@ java.sourceSets[SourceSet.MAIN_SOURCE_SET_NAME].java.srcDir(generate)
236235
// Remove gen directory on clean
237236
clean.delete(generate)
238237

239-
// Workaround for KT-16764
240-
compileKotlin.inputs.dir(generate)
241-
242238
runIde {
243239
maxHeapSize = "2G"
244240

@@ -251,7 +247,7 @@ runIde {
251247
}
252248

253249
inline operator fun <T : Task> T.invoke(a: T.() -> Unit): T = apply(a)
254-
fun DependencyHandlerScope.kotlin(module: String) = kotlin(module, kotlinVersion) as String
250+
fun DependencyHandlerScope.kotlin(module: String) = kotlin(module, null) as String
255251
fun intellijPlugin(name: String) = mapOf(
256252
"group" to "org.jetbrains.plugins",
257253
"name" to name,

gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
# suppress inspection "UnusedProperty" for whole file
1111
ideaVersion = 181-SNAPSHOT
1212
javaVersion = 1.8
13-
kotlinVersion = 1.2.10
1413

1514
group = com.demonwav.minecraft-dev
16-
version = 2018.1-1.1.0
15+
version = 2018.1-1.1.1
1716
downloadIdeaSources = true

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Minecraft Development for IntelliJ
1010
|**CircleCI**|[![Travis Build Status](https://img.shields.io/circleci/project/github/minecraft-dev/MinecraftDev/dev.svg?style=flat-square)](https://circleci.com/gh/minecraft-dev/MinecraftDev)|
1111
| **Travis** |[![CircleCI Build Status](https://img.shields.io/travis/minecraft-dev/MinecraftDev/dev.svg?style=flat-square)](https://travis-ci.org/minecraft-dev/MinecraftDev/)|
1212

13-
Info and Documentation [![Current Release](https://img.shields.io/badge/release-2018.1--1.1.0-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
13+
Info and Documentation [![Current Release](https://img.shields.io/badge/release-2018.1--1.1.1-orange.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/8327)
1414
----------------------
1515

1616
Visit [https://minecraftdev.org](https://minecraftdev.org) for information about the project, change logs, features, FAQs, and chat.
File renamed without changes.

src/main/kotlin/com/demonwav/mcdev/error/IdeaITNProxy.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package com.demonwav.mcdev.error
1313
import com.intellij.errorreport.bean.ErrorBean
1414
import com.intellij.openapi.application.ApplicationNamesInfo
1515
import com.intellij.openapi.application.ex.ApplicationInfoEx
16-
import com.intellij.util.SystemProperties
16+
import com.intellij.openapi.util.SystemInfo
1717

1818
object IdeaITNProxy {
1919
fun getKeyValuePairs(error: ErrorBean,
@@ -26,9 +26,9 @@ object IdeaITNProxy {
2626
params["Plugin Name"] = error.pluginName
2727
params["Plugin Version"] = error.pluginVersion
2828

29-
params["OS Name"] = SystemProperties.getOsName()
30-
params["Java Version"] = SystemProperties.getJavaVersion()
31-
params["Java VM Vendor"] = SystemProperties.getJavaVmVendor()
29+
params["OS Name"] = SystemInfo.OS_NAME
30+
params["Java Version"] = SystemInfo.JAVA_VERSION
31+
params["Java VM Vendor"] = SystemInfo.JAVA_VENDOR
3232

3333
params["App Name"] = namesInfo.productName
3434
params["App Full Name"] = namesInfo.fullProductName

src/main/kotlin/com/demonwav/mcdev/nbt/filetype/NbtFileType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import com.intellij.openapi.vfs.VirtualFile
1717
object NbtFileType : FileType {
1818
override fun getDefaultExtension() = "nbt"
1919
override fun getIcon() = PlatformAssets.MINECRAFT_ICON
20-
override fun getCharset(file: VirtualFile, content: ByteArray) = null
20+
override fun getCharset(file: VirtualFile, content: ByteArray): String? = null
2121
override fun getName() = "NBT"
2222
override fun getDescription() = "Named Binary Tag"
2323
override fun isBinary() = true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Minecraft Dev for IntelliJ
3+
*
4+
* https://minecraftdev.org
5+
*
6+
* Copyright (c) 2017 minecraft-dev
7+
*
8+
* MIT License
9+
*/
10+
11+
package com.demonwav.mcdev.nbt.filetype
12+
13+
import com.demonwav.mcdev.nbt.MalformedNbtFileException
14+
import com.demonwav.mcdev.nbt.Nbt
15+
import com.intellij.openapi.fileTypes.FileType
16+
import com.intellij.openapi.fileTypes.FileTypeRegistry
17+
import com.intellij.openapi.util.io.ByteSequence
18+
import com.intellij.openapi.vfs.VirtualFile
19+
import java.io.IOException
20+
21+
class NbtFileTypeDetector : FileTypeRegistry.FileTypeDetector {
22+
override fun getVersion() = 1
23+
24+
override fun detect(file: VirtualFile, firstBytes: ByteSequence, firstCharsIfText: CharSequence?): FileType? {
25+
return try {
26+
Nbt.buildTagTree(file.inputStream, 100)
27+
NbtFileType
28+
} catch (e: MalformedNbtFileException) {
29+
null
30+
} catch (e: IOException) {
31+
null
32+
}
33+
}
34+
}

src/main/kotlin/com/demonwav/mcdev/nbt/lang/NbttFileType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ object NbttFileType : LanguageFileType(NbttLanguage) {
1717
override fun getIcon() = PlatformAssets.MINECRAFT_ICON
1818
override fun getName() = "NBTT"
1919
override fun getDefaultExtension() = "nbtt"
20-
override fun getDescription() = "NBT Text Representation"
20+
override fun getDescription() = "NBT Text Representation (don't use this one)"
2121
}

src/main/kotlin/com/demonwav/mcdev/nbt/tags/NbtTag.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fun writeString(sb: StringBuilder, s: String): StringBuilder {
5656
return sb.append('"').append(s.replace("\n", "\\n")).append('"')
5757
}
5858

59-
if (s == "bytes" || s == "ints" || s == "longs") {
59+
if (s == "bytes" || s == "ints" || s == "longs" || s == "true" || s == "false") {
6060
// keywords must be quoted
6161
return sb.append('"').append(s).append('"')
6262
}

src/main/kotlin/com/demonwav/mcdev/util/AbstractProjectComponent.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ package com.demonwav.mcdev.util
1313
import com.intellij.openapi.components.ProjectComponent
1414
import com.intellij.openapi.project.Project
1515

16-
abstract class AbstractProjectComponent(var projectRef: Project?) : ProjectComponent {
16+
abstract class AbstractProjectComponent(private var projectRef: Project?) : ProjectComponent {
1717

1818
protected val project
1919
get() = projectRef!!
2020

2121
override fun getComponentName(): String = javaClass.name
2222

23-
override final fun disposeComponent() {
23+
final override fun disposeComponent() {
2424
projectRef = null
2525
}
2626

0 commit comments

Comments
 (0)