-
Notifications
You must be signed in to change notification settings - Fork 42
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
38 changed files
with
236 additions
and
179 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
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
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
10 changes: 8 additions & 2 deletions
10
src/main/java/draylar/tiered/api/CustomEntityAttributes.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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package draylar.tiered.api; | ||
|
||
import draylar.tiered.Tiered; | ||
import net.minecraft.entity.attribute.ClampedEntityAttribute; | ||
import net.minecraft.entity.attribute.EntityAttribute; | ||
import net.minecraft.util.registry.Registry; | ||
|
||
public class CustomEntityAttributes { | ||
|
||
public static final EntityAttribute DIG_SPEED = new ClampedEntityAttribute(null, "generic.digSpeed", 0.0D, 0.0D, 2048.0D).setTracked(true); | ||
public static final EntityAttribute CRIT_CHANCE = new ClampedEntityAttribute(null, "generic.critChance", 0.0D, 0.0D, 1D).setTracked(true); | ||
public static final EntityAttribute DIG_SPEED = register(new ClampedEntityAttribute("generic.dig_speed", 0.0D, 0.0D, 2048.0D).setTracked(true)); | ||
public static final EntityAttribute CRIT_CHANCE = register(new ClampedEntityAttribute("generic.crit_chance", 0.0D, 0.0D, 1D).setTracked(true)); | ||
// public static final EntityAttribute DURABLE = new ClampedEntityAttribute(null, "generic.durable", 0.0D, 0.0D, 1D).setTracked(true); | ||
|
||
public static void init() { | ||
// NO-OP | ||
} | ||
|
||
private static EntityAttribute register(EntityAttribute attribute) { | ||
return Registry.register(Registry.ATTRIBUTE, Tiered.id(attribute.getTranslationKey()), attribute); | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
src/main/java/draylar/tiered/gson/TextColorDeserializer.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,18 @@ | ||
package draylar.tiered.gson; | ||
|
||
import com.google.gson.JsonDeserializationContext; | ||
import com.google.gson.JsonDeserializer; | ||
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonParseException; | ||
import net.minecraft.text.TextColor; | ||
import net.minecraft.util.Formatting; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
public class TextColorDeserializer implements JsonDeserializer<TextColor> { | ||
|
||
@Override | ||
public TextColor deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { | ||
return TextColor.fromFormatting(Formatting.byName(json.getAsString().toUpperCase())); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.