Skip to content

Commit

Permalink
Scales
Browse files Browse the repository at this point in the history
  • Loading branch information
Lykrast committed Aug 2, 2022
1 parent 89c39b5 commit 787f03c
Show file tree
Hide file tree
Showing 25 changed files with 326 additions and 26 deletions.
14 changes: 12 additions & 2 deletions src/main/java/lykrast/bookwyrms/entity/BookWyrmEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void registerGoals() {
}

public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 12).add(Attributes.MOVEMENT_SPEED, 0.26);
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 12).add(Attributes.MOVEMENT_SPEED, 0.25);
}

@Override
Expand Down Expand Up @@ -291,10 +291,20 @@ public void addAdditionalSaveData(CompoundTag compound) {
compound.putInt("ToDigest", toDigest);
compound.putInt("DigestTimer", digestTimer);
}

private static final ResourceLocation[] LOOT_TABLES = {
BookWyrms.rl("entities/book_wyrm_grey"),
BookWyrms.rl("entities/book_wyrm_red"),
BookWyrms.rl("entities/book_wyrm_orange"),
BookWyrms.rl("entities/book_wyrm_green"),
BookWyrms.rl("entities/book_wyrm_blue"),
BookWyrms.rl("entities/book_wyrm_teal"),
BookWyrms.rl("entities/book_wyrm_purple")
};

@Override
protected ResourceLocation getDefaultLootTable() {
return BookWyrms.rl("entities/book_wyrm");
return LOOT_TABLES[getWyrmType()];
}

@Override
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/lykrast/bookwyrms/registry/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@
import net.minecraftforge.registries.RegistryObject;

public class ModItems {
public static RegistryObject<Item> bookWyrmRaw, bookWyrmCooked;
public static RegistryObject<Item> analyzer;
public static RegistryObject<Item> bookWyrmRaw, bookWyrmCooked;
public static RegistryObject<Item> scaleGrey, scaleRed, scaleOrange, scaleGreen, scaleBlue, scaleTeal, scalePurple;
public static RegistryObject<Item> spawnEgg;
public static final DeferredRegister<Item> REG = DeferredRegister.create(ForgeRegistries.ITEMS, BookWyrms.MODID);

static {
analyzer = initItem("analyzer", () -> new AnalyzerItem(defP().stacksTo(1)));

bookWyrmRaw = initItem("book_wyrm_raw", () -> new Item(defP().food((new FoodProperties.Builder()).nutrition(3).saturationMod(0.3f).meat().build())));
bookWyrmCooked = initItem("book_wyrm_cooked", () -> new Item(defP().food((new FoodProperties.Builder()).nutrition(8).saturationMod(0.8f).meat().build())));

analyzer = initItem("analyzer", () -> new AnalyzerItem(defP().stacksTo(1)));

scaleGrey = initItem("scale_grey", () -> new AnalyzerItem(defP()));
scaleRed = initItem("scale_red", () -> new AnalyzerItem(defP()));
scaleOrange = initItem("scale_orange", () -> new AnalyzerItem(defP()));
scaleGreen = initItem("scale_green", () -> new AnalyzerItem(defP()));
scaleBlue = initItem("scale_blue", () -> new AnalyzerItem(defP()));
scaleTeal = initItem("scale_teal", () -> new AnalyzerItem(defP()));
scalePurple = initItem("scale_purple", () -> new AnalyzerItem(defP()));

spawnEgg = initItem("book_wyrm_spawn_egg", () -> new ForgeSpawnEggItem(ModEntities.bookWyrm, 0x3D8DC6, 0xFFF9E0, defP()));
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/assets/bookwyrms/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"item.bookwyrms.book_wyrm_raw": "Raw Book Wyrm",
"item.bookwyrms.book_wyrm_cooked": "Cooked Book Wyrm",

"item.bookwyrms.scale_grey": "Grey Book Wyrm Scale",
"item.bookwyrms.scale_red": "Red Book Wyrm Scale",
"item.bookwyrms.scale_orange": "Orange Book Wyrm Scale",
"item.bookwyrms.scale_green": "Green Book Wyrm Scale",
"item.bookwyrms.scale_blue": "Blue Book Wyrm Scale",
"item.bookwyrms.scale_teal": "Teal Book Wyrm Scale",
"item.bookwyrms.scale_purple": "Purple Book Wyrm Scale",

"item.bookwyrms.analyzer": "Book Wyrm Analyzer",

"item.bookwyrms.book_wyrm_spawn_egg": "Book Wyrm Spawn Egg",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_blue"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_green"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_grey"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_orange"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_purple"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_red"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "bookwyrms:item/scale_teal"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "minecraft:leather",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_blue",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_green",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_grey",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_orange",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_purple",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "bookwyrms:scale_red",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 0, "max": 2 }
},
{
"function": "looting_enchant",
"count": { "min": 0, "max": 1 }
}
]
}
]
},
{
"name": "book_wyrm",
"rolls": 1,
"entries": [
{
"type": "loot_table",
"name": "bookwyrms:entities/book_wyrm",
"weight": 1
}
]
}
]
}
Loading

0 comments on commit 787f03c

Please sign in to comment.