added more colored backpacks

This commit is contained in:
Jörg Henke 2020-09-02 21:27:48 +02:00
parent f4155073c5
commit 73e313b0dc
20 changed files with 319 additions and 91 deletions

View File

@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.8.8+build.202 loader_version=0.8.8+build.202
# Mod Properties # Mod Properties
mod_version = 1.16.1.10 mod_version = 1.16.1.11
maven_group = de.jottyfan.minecraft maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric archives_base_name = quickiefabric

View File

@ -49,9 +49,11 @@ public class RegistryManager {
public static final String QUICKIEFABRIC = "quickiefabric"; public static final String QUICKIEFABRIC = "quickiefabric";
public static final Identifier BACKPACK_IDENTIFIER = new Identifier(QUICKIEFABRIC, "backpack"); public static final Identifier BACKPACK_IDENTIFIER = new Identifier(QUICKIEFABRIC, "backpack");
public static final ScreenHandlerType<BackpackScreenHandler> BACKPACK_SCREEN_HANDLER = ScreenHandlerRegistry.registerExtended(RegistryManager.BACKPACK_IDENTIFIER, BackpackScreenHandler::new); public static final ScreenHandlerType<BackpackScreenHandler> BACKPACK_SCREEN_HANDLER = ScreenHandlerRegistry
.registerExtended(RegistryManager.BACKPACK_IDENTIFIER, BackpackScreenHandler::new);
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroupBuilder.create(new Identifier(QUICKIEFABRIC, "all")).icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER)) public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroupBuilder
.create(new Identifier(QUICKIEFABRIC, "all")).icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER))
.appendItems(stacks -> { .appendItems(stacks -> {
stacks.add(new ItemStack(QuickieItems.SALPETER)); stacks.add(new ItemStack(QuickieItems.SALPETER));
stacks.add(new ItemStack(QuickieItems.SULPHOR)); stacks.add(new ItemStack(QuickieItems.SULPHOR));
@ -60,6 +62,13 @@ public class RegistryManager {
stacks.add(new ItemStack(QuickieItems.PENCIL)); stacks.add(new ItemStack(QuickieItems.PENCIL));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BROWN)); stacks.add(new ItemStack(QuickieItems.BACKPACK_BROWN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_WHITE)); stacks.add(new ItemStack(QuickieItems.BACKPACK_WHITE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLACK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_BLUE));
stacks.add(new ItemStack(QuickieItems.BACKPACK_CYAN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_GREEN));
stacks.add(new ItemStack(QuickieItems.BACKPACK_PINK));
stacks.add(new ItemStack(QuickieItems.BACKPACK_RED));
stacks.add(new ItemStack(QuickieItems.BACKPACK_YELLOW));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE)); stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERPICKAXE)); stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERPICKAXE));
stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERSHOVEL)); stacks.add(new ItemStack(QuickieTools.SPEEDPOWDERSHOVEL));
@ -76,7 +85,8 @@ public class RegistryManager {
private static final void registerBlock(Block block, String name) { private static final void registerBlock(Block block, String name) {
Registry.register(Registry.BLOCK, new Identifier(QUICKIEFABRIC, name), block); Registry.register(Registry.BLOCK, new Identifier(QUICKIEFABRIC, name), block);
Registry.register(Registry.ITEM, new Identifier(QUICKIEFABRIC, name), new BlockItem(block, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP))); Registry.register(Registry.ITEM, new Identifier(QUICKIEFABRIC, name),
new BlockItem(block, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP)));
} }
private static final void registerItem(Item item, String name) { private static final void registerItem(Item item, String name) {
@ -84,9 +94,11 @@ public class RegistryManager {
} }
public static final void registerBlockEntities() { public static final void registerBlockEntities() {
QuickieFabricBlockEntity.ITEMHOARDER = Registry.register(Registry.BLOCK_ENTITY_TYPE, QUICKIEFABRIC + ":itemhoarderblockentity", QuickieFabricBlockEntity.ITEMHOARDER = Registry.register(Registry.BLOCK_ENTITY_TYPE,
QUICKIEFABRIC + ":itemhoarderblockentity",
BlockEntityType.Builder.create(ItemHoarderBlockEntity::new, QuickieBlocks.ITEMHOARDER).build(null)); BlockEntityType.Builder.create(ItemHoarderBlockEntity::new, QuickieBlocks.ITEMHOARDER).build(null));
QuickieFabricBlockEntity.MONSTERHOARDER = Registry.register(Registry.BLOCK_ENTITY_TYPE, QUICKIEFABRIC + ":monsterhoarderblockentity", QuickieFabricBlockEntity.MONSTERHOARDER = Registry.register(Registry.BLOCK_ENTITY_TYPE,
QUICKIEFABRIC + ":monsterhoarderblockentity",
BlockEntityType.Builder.create(MonsterHoarderBlockEntity::new, QuickieBlocks.MONSTERHOARDER).build(null)); BlockEntityType.Builder.create(MonsterHoarderBlockEntity::new, QuickieBlocks.MONSTERHOARDER).build(null));
} }
@ -112,6 +124,13 @@ public class RegistryManager {
registerItem(QuickieItems.SULPHOR, "sulphor"); registerItem(QuickieItems.SULPHOR, "sulphor");
registerItem(QuickieItems.BACKPACK_BROWN, "backpack_brown"); registerItem(QuickieItems.BACKPACK_BROWN, "backpack_brown");
registerItem(QuickieItems.BACKPACK_WHITE, "backpack_white"); registerItem(QuickieItems.BACKPACK_WHITE, "backpack_white");
registerItem(QuickieItems.BACKPACK_BLACK, "backpack_black");
registerItem(QuickieItems.BACKPACK_BLUE, "backpack_blue");
registerItem(QuickieItems.BACKPACK_CYAN, "backpack_cyan");
registerItem(QuickieItems.BACKPACK_GREEN, "backpack_green");
registerItem(QuickieItems.BACKPACK_PINK, "backpack_pink");
registerItem(QuickieItems.BACKPACK_RED, "backpack_red");
registerItem(QuickieItems.BACKPACK_YELLOW, "backpack_yellow");
} }
public static final void registerTools() { public static final void registerTools() {
@ -136,59 +155,49 @@ public class RegistryManager {
/** /**
* generate ores * generate ores
* *
* @param biome * @param biome the biome to generate the veins in
* the biome to generate the veins in * @param target the block to be replaced
* @param target * @param block the block that is the replacement
* the block to be replaced * @param veinsize the size of the vein
* @param block * @param count the number of veins in a chunk
* the block that is the replacement * @param bottomOffset the lower limit
* @param veinsize * @param topOffset the upper limit
* the size of the vein * @param maximum the maximum number of blocks in a vein
* @param count
* the number of veins in a chunk
* @param bottomOffset
* the lower limit
* @param topOffset
* the upper limit
* @param maximum
* the maximum number of blocks in a vein
*/ */
public static void generateOreForTarget(Biome biome, Target target, Block block, int veinsize, int count, int bottomOffset, int topOffset, int maximum) { public static void generateOreForTarget(Biome biome, Target target, Block block, int veinsize, int count,
int bottomOffset, int topOffset, int maximum) {
OreFeatureConfig ofc = new OreFeatureConfig(target, block.getDefaultState(), veinsize); OreFeatureConfig ofc = new OreFeatureConfig(target, block.getDefaultState(), veinsize);
RangeDecoratorConfig rdc = new RangeDecoratorConfig(count, bottomOffset, topOffset, maximum); RangeDecoratorConfig rdc = new RangeDecoratorConfig(count, bottomOffset, topOffset, maximum);
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Feature.ORE.configure(ofc).createDecoratedFeature(Decorator.COUNT_RANGE.configure(rdc))); biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES,
Feature.ORE.configure(ofc).createDecoratedFeature(Decorator.COUNT_RANGE.configure(rdc)));
} }
/** /**
* generate ore instead of block * generate ore instead of block
* *
* @param biome * @param biome the biome
* the biome * @param placeOn the list of blockStates underneath
* @param placeOn * @param placeIn the list of blockStates to be replaced
* the list of blockStates underneath * @param placeUnder the list of blockStates above
* @param placeIn * @param block the block to set
* the list of blockStates to be replaced * @param chance the chance for the replacement
* @param placeUnder
* the list of blockStates above
* @param block
* the block to set
* @param chance
* the chance for the replacement
*/ */
public static void generateOreInBlocks(Biome biome, List<BlockState> placeOn, List<BlockState> placeIn, List<BlockState> placeUnder, Block block, float chance) { public static void generateOreInBlocks(Biome biome, List<BlockState> placeOn, List<BlockState> placeIn,
List<BlockState> placeUnder, Block block, float chance) {
SimpleBlockFeatureConfig sbfc = new SimpleBlockFeatureConfig(block.getDefaultState(), placeOn, placeIn, placeUnder); SimpleBlockFeatureConfig sbfc = new SimpleBlockFeatureConfig(block.getDefaultState(), placeOn, placeIn, placeUnder);
biome.addFeature(GenerationStep.Feature.LOCAL_MODIFICATIONS, Feature.SIMPLE_BLOCK.configure(sbfc).withChance(chance).feature); biome.addFeature(GenerationStep.Feature.LOCAL_MODIFICATIONS,
Feature.SIMPLE_BLOCK.configure(sbfc).withChance(chance).feature);
} }
/** /**
* add the quickiefabric ores to the biome * add the quickiefabric ores to the biome
* *
* @param biome * @param biome the biome
* the biome
*/ */
public static final void handleBiome(Biome biome) { public static final void handleBiome(Biome biome) {
if (biome.getCategory() == Biome.Category.NETHER) { if (biome.getCategory() == Biome.Category.NETHER) {
RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NETHER_ORE_REPLACEABLES, QuickieBlocks.ORE_NETHER_SULPHOR, 24, 10, 0, 0, 128); RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NETHER_ORE_REPLACEABLES,
QuickieBlocks.ORE_NETHER_SULPHOR, 24, 10, 0, 0, 128);
} else if (biome.getCategory() == Biome.Category.THEEND) { } else if (biome.getCategory() == Biome.Category.THEEND) {
} else { } else {
List<BlockState> sandlike = new ArrayList<>(); List<BlockState> sandlike = new ArrayList<>();
@ -202,8 +211,10 @@ public class RegistryManager {
RegistryManager.generateOreInBlocks(biome, dirtlike, dirtlike, dirtlike, QuickieBlocks.DIRT_SALPETER, 1.0f); RegistryManager.generateOreInBlocks(biome, dirtlike, dirtlike, dirtlike, QuickieBlocks.DIRT_SALPETER, 1.0f);
RegistryManager.generateOreInBlocks(biome, sandlike, sandlike, sandlike, QuickieBlocks.SAND_SALPETER, 1.0f); RegistryManager.generateOreInBlocks(biome, sandlike, sandlike, sandlike, QuickieBlocks.SAND_SALPETER, 1.0f);
RegistryManager.generateOreInBlocks(biome, sandlike, sandlike, sandlike, QuickieBlocks.ORE_SAND_SALPETER, 1.0f); RegistryManager.generateOreInBlocks(biome, sandlike, sandlike, sandlike, QuickieBlocks.ORE_SAND_SALPETER, 1.0f);
RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NATURAL_STONE, QuickieBlocks.ORE_SULPHOR, 16, 4, 4, 196, 255); RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NATURAL_STONE, QuickieBlocks.ORE_SULPHOR, 16,
RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NATURAL_STONE, QuickieBlocks.ORE_SALPETER, 12, 10, 4, 196, 255); 4, 4, 196, 255);
RegistryManager.generateOreForTarget(biome, OreFeatureConfig.Target.NATURAL_STONE, QuickieBlocks.ORE_SALPETER, 12,
10, 4, 196, 255);
} }
} }

View File

@ -31,7 +31,7 @@ import net.minecraft.world.World;
* @author jotty * @author jotty
* *
*/ */
public class ItemBackpack extends Item implements DyeableItem { public class ItemBackpack extends Item {
public final static Integer SLOTSIZE = 54; public final static Integer SLOTSIZE = 54;
public ItemBackpack() { public ItemBackpack() {

View File

@ -13,4 +13,11 @@ public class QuickieItems {
public static final ItemSulphor SULPHOR = new ItemSulphor(); public static final ItemSulphor SULPHOR = new ItemSulphor();
public static final ItemBackpack BACKPACK_BROWN = new ItemBackpack(); public static final ItemBackpack BACKPACK_BROWN = new ItemBackpack();
public static final ItemBackpack BACKPACK_WHITE = new ItemBackpack(); public static final ItemBackpack BACKPACK_WHITE = new ItemBackpack();
public static final ItemBackpack BACKPACK_BLACK = new ItemBackpack();
public static final ItemBackpack BACKPACK_BLUE = new ItemBackpack();
public static final ItemBackpack BACKPACK_CYAN = new ItemBackpack();
public static final ItemBackpack BACKPACK_GREEN = new ItemBackpack();
public static final ItemBackpack BACKPACK_PINK = new ItemBackpack();
public static final ItemBackpack BACKPACK_RED = new ItemBackpack();
public static final ItemBackpack BACKPACK_YELLOW = new ItemBackpack();
} }

View File

@ -11,8 +11,15 @@
"item.quickiefabric.construction2": "fertiger Bauplan", "item.quickiefabric.construction2": "fertiger Bauplan",
"item.quickiefabric.pencil": "Bleistift", "item.quickiefabric.pencil": "Bleistift",
"item.quickiefabric.levelup": "Aufwerter", "item.quickiefabric.levelup": "Aufwerter",
"item.quickiefabric.backpack_black": "schwarzer Rucksack",
"item.quickiefabric.backpack_blue": "blauer Rucksack",
"item.quickiefabric.backpack_brown": "brauner Rucksack", "item.quickiefabric.backpack_brown": "brauner Rucksack",
"item.quickiefabric.backpack_cyan": "türkiser Rucksack",
"item.quickiefabric.backpack_green": "grüner Rucksack",
"item.quickiefabric.backpack_pink": "pinker Rucksack",
"item.quickiefabric.backpack_red": "roter Rucksack",
"item.quickiefabric.backpack_white": "weißer Rucksack", "item.quickiefabric.backpack_white": "weißer Rucksack",
"item.quickiefabric.backpack_yellow": "gelber Rucksack",
"block.quickiefabric.orenethersulphor": "Nether-Schwefel", "block.quickiefabric.orenethersulphor": "Nether-Schwefel",
"block.quickiefabric.oresalpeter": "Salpetererz", "block.quickiefabric.oresalpeter": "Salpetererz",
"block.quickiefabric.oresandsalpeter": "Salpetergestein", "block.quickiefabric.oresandsalpeter": "Salpetergestein",
@ -30,7 +37,7 @@
"block.quickiefabric.lavahoarder": "Lavasauger", "block.quickiefabric.lavahoarder": "Lavasauger",
"block.quickiefabric.itemhoarder": "Itemsauger", "block.quickiefabric.itemhoarder": "Itemsauger",
"block.quickiefabric.monsterhoarder": "Monstersauger", "block.quickiefabric.monsterhoarder": "Monstersauger",
"container.quickiefabric.backpack": "Vernichter - nicht benutzen", "container.quickiefabric.backpack": "Rucksack",
"msg.buildingplan.start": "beginne Konstruktionsaufnahme bei %s,%s,%s", "msg.buildingplan.start": "beginne Konstruktionsaufnahme bei %s,%s,%s",
"msg.buildingplan.end": "beende Konstruktionsaufnahme bei %s,%s,%s", "msg.buildingplan.end": "beende Konstruktionsaufnahme bei %s,%s,%s",
"msg.buildingplan.null": "Der Bauplan ist kaputt.", "msg.buildingplan.null": "Der Bauplan ist kaputt.",

View File

@ -11,8 +11,15 @@
"item.quickiefabric.construction2": "finished building plan", "item.quickiefabric.construction2": "finished building plan",
"item.quickiefabric.pencil": "pencil", "item.quickiefabric.pencil": "pencil",
"item.quickiefabric.levelup": "level up", "item.quickiefabric.levelup": "level up",
"item.quickiefabric.backpack_black": "black backpack",
"item.quickiefabric.backpack_blue": "blue backpack",
"item.quickiefabric.backpack_brown": "brown backpack", "item.quickiefabric.backpack_brown": "brown backpack",
"item.quickiefabric.backpack_cyan": "cyan backpack",
"item.quickiefabric.backpack_green": "green backpack",
"item.quickiefabric.backpack_pink": "pink backpack",
"item.quickiefabric.backpack_red": "red backpack",
"item.quickiefabric.backpack_white": "white backpack", "item.quickiefabric.backpack_white": "white backpack",
"item.quickiefabric.backpack_yellow": "yellow backpack",
"block.quickiefabric.orenethersulphor": "nether sulfur", "block.quickiefabric.orenethersulphor": "nether sulfur",
"block.quickiefabric.oresalpeter": "salpeter ore", "block.quickiefabric.oresalpeter": "salpeter ore",
"block.quickiefabric.oresandsalpeter": "salpeter stone", "block.quickiefabric.oresandsalpeter": "salpeter stone",
@ -30,7 +37,7 @@
"block.quickiefabric.lavahoarder": "lava hoarder", "block.quickiefabric.lavahoarder": "lava hoarder",
"block.quickiefabric.itemhoarder": "item hoarder", "block.quickiefabric.itemhoarder": "item hoarder",
"block.quickiefabric.monsterhoarder": "monster hoarder", "block.quickiefabric.monsterhoarder": "monster hoarder",
"container.quickiefabric.backpack": "Destroyer - do not use", "container.quickiefabric.backpack": "backpack",
"msg.buildingplan.start": "started recording of construction at %s,%s,%s", "msg.buildingplan.start": "started recording of construction at %s,%s,%s",
"msg.buildingplan.end": "finished recording of construction at %s,%s,%s", "msg.buildingplan.end": "finished recording of construction at %s,%s,%s",
"msg.buildingplan.null": "The building plan is damaged.", "msg.buildingplan.null": "The building plan is damaged.",

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_black"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_blue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_cyan"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_green"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_pink"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_red"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "quickiefabric:item/backpack_yellow"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:black_wool"
}
},
"result": {
"item": "quickiefabric:backpack_black"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:blue_wool"
}
},
"result": {
"item": "quickiefabric:backpack_blue"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:cyan_wool"
}
},
"result": {
"item": "quickiefabric:backpack_cyan"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:green_wool"
}
},
"result": {
"item": "quickiefabric:backpack_green"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:pink_wool"
}
},
"result": {
"item": "quickiefabric:backpack_pink"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:red_wool"
}
},
"result": {
"item": "quickiefabric:backpack_red"
}
}

View File

@ -0,0 +1,22 @@
{
"type": "crafting_shaped",
"pattern": [
"wlw",
"lsl",
"wlw"
],
"key": {
"s": {
"item": "minecraft:string"
},
"l": {
"item": "minecraft:leather"
},
"w": {
"item": "minecraft:yellow_wool"
}
},
"result": {
"item": "quickiefabric:backpack_yellow"
}
}