-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
fabric/src/main/java/juuxel/adorn/compat/dashloader/DashOptionalNoneValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package juuxel.adorn.compat.dashloader; | ||
|
||
import juuxel.adorn.block.property.OptionalProperty; | ||
import net.oskarstrom.dashloader.DashRegistry; | ||
import net.oskarstrom.dashloader.api.annotation.DashConstructor; | ||
import net.oskarstrom.dashloader.api.annotation.DashObject; | ||
import net.oskarstrom.dashloader.api.enums.ConstructorMode; | ||
import net.oskarstrom.dashloader.blockstate.property.value.DashPropertyValue; | ||
|
||
@DashObject(OptionalProperty.Value.None.class) | ||
public class DashOptionalNoneValue implements DashPropertyValue { | ||
@DashConstructor(ConstructorMode.EMPTY) | ||
public DashOptionalNoneValue() { | ||
} | ||
|
||
@SuppressWarnings("rawtypes") | ||
@Override | ||
public Comparable<?> toUndash(DashRegistry registry) { | ||
return new OptionalProperty.Value.None(); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
fabric/src/main/java/juuxel/adorn/compat/dashloader/DashOptionalProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package juuxel.adorn.compat.dashloader; | ||
|
||
import io.activej.serializer.annotations.Deserialize; | ||
import io.activej.serializer.annotations.Serialize; | ||
import juuxel.adorn.block.property.OptionalProperty; | ||
import net.minecraft.state.property.Property; | ||
import net.oskarstrom.dashloader.DashRegistry; | ||
import net.oskarstrom.dashloader.api.annotation.DashConstructor; | ||
import net.oskarstrom.dashloader.api.annotation.DashObject; | ||
import net.oskarstrom.dashloader.api.enums.ConstructorMode; | ||
import net.oskarstrom.dashloader.blockstate.property.DashEnumProperty; | ||
import net.oskarstrom.dashloader.blockstate.property.DashProperty; | ||
|
||
@DashObject(OptionalProperty.class) | ||
public class DashOptionalProperty implements DashProperty { | ||
@Serialize(order = 0) | ||
public final DashEnumProperty property; | ||
|
||
public DashOptionalProperty(@Deserialize("property") DashEnumProperty property) { | ||
this.property = property; | ||
} | ||
|
||
@DashConstructor(ConstructorMode.OBJECT) | ||
public DashOptionalProperty(OptionalProperty<?> property) { | ||
this(new DashEnumProperty(property.getDelegate())); | ||
} | ||
|
||
@Override | ||
public Property<?> toUndash(DashRegistry registry) { | ||
return new OptionalProperty<>(property.toUndash(registry)); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
fabric/src/main/java/juuxel/adorn/compat/dashloader/DashOptionalSomeValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package juuxel.adorn.compat.dashloader; | ||
|
||
import io.activej.serializer.annotations.Deserialize; | ||
import io.activej.serializer.annotations.Serialize; | ||
import juuxel.adorn.block.property.OptionalProperty; | ||
import net.oskarstrom.dashloader.DashRegistry; | ||
import net.oskarstrom.dashloader.api.ExtraVariables; | ||
import net.oskarstrom.dashloader.api.annotation.DashConstructor; | ||
import net.oskarstrom.dashloader.api.annotation.DashObject; | ||
import net.oskarstrom.dashloader.api.enums.ConstructorMode; | ||
import net.oskarstrom.dashloader.blockstate.property.value.DashEnumValue; | ||
import net.oskarstrom.dashloader.blockstate.property.value.DashPropertyValue; | ||
|
||
@DashObject(OptionalProperty.Value.Some.class) | ||
public class DashOptionalSomeValue implements DashPropertyValue { | ||
@Serialize(order = 0) | ||
public final DashEnumValue value; | ||
|
||
public DashOptionalSomeValue(@Deserialize("value") DashEnumValue value) { | ||
this.value = value; | ||
} | ||
|
||
@DashConstructor(ConstructorMode.OBJECT_EXTRA) | ||
public DashOptionalSomeValue(OptionalProperty.Value.Some<?> value, ExtraVariables extra) { | ||
this(new DashEnumValue(value.getValue(), extra)); | ||
} | ||
|
||
@SuppressWarnings({"rawtypes", "unchecked"}) | ||
@Override | ||
public Comparable<?> toUndash(DashRegistry registry) { | ||
return new OptionalProperty.Value.Some(value.toUndash(registry)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ libgui = 4.0.0+1.17 | |
modmenu = 2.0.0-beta.7 | ||
jankson = 3.0.1+j1.2.0 | ||
libcd = 3.0.3+1.16.3 | ||
dashloader = 2.0-dev10 |