Skip to content

Commit 176ed8c

Browse files
committed
Add powered state to blocks
1 parent 5cf6370 commit 176ed8c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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)