Skip to content

Commit b678e54

Browse files
authored
Merge pull request #13 from SLLCoding/feat/powered
Powered state for blocks
2 parents 8fb1810 + 176ed8c commit b678e54

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ dependencies {
5252
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
5353
}
5454

55-
tasks.withType(JavaCompile) {
56-
options.release.set(8)
57-
}
58-
5955
java {
6056
withJavadocJar()
6157
withSourcesJar()

src/main/java/me/marcusslover/resourcepacker/core/generator/BlockGenerator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void generate(File mc, File packer, RPBlockRegistry registry) {
7272
int customModelData = 1;
7373
int instrument = 0;
7474
int note = 0;
75+
boolean powered = false;
7576
for (RPBlock block : list) {
7677
if (note > BlockUtil.NOTE_LIMIT) {
7778
note = 0;
@@ -97,7 +98,7 @@ public void generate(File mc, File packer, RPBlockRegistry registry) {
9798
JsonObject blockVariant = new JsonObject();
9899
blockVariant.addProperty("model", "packer:block/" + name);
99100

100-
String blockPath = "instrument=" + BlockUtil.INSTRUMENTS[instrument] + ",note=" + note;
101+
String blockPath = "instrument=" + BlockUtil.INSTRUMENTS[instrument] + ",note=" + note + ",powered=" + powered;
101102
blockVariants.add(blockPath, blockVariant);
102103

103104
/*Json item model*/
@@ -117,7 +118,8 @@ public void generate(File mc, File packer, RPBlockRegistry registry) {
117118
File textureJson = FileUtil.safeFile(itemModels, name + ".json");
118119
JsonUtil.writeFile(textureJson, textureModel);
119120

120-
note++;
121+
if (powered) note++;
122+
powered = !powered;
121123
customModelData++;
122124
/*Log creation*/
123125
log.addProperty(name, blockPath);

0 commit comments

Comments
 (0)