Adjust more recipes
This commit is contained in:
parent
c45d94e586
commit
b0405eb534
22 changed files with 42 additions and 322 deletions
|
@ -110,8 +110,6 @@ public class OTEMod
|
|||
// Register the setup method for modloading
|
||||
bus.addListener(this::setup);
|
||||
|
||||
ModDyes.InitColors();
|
||||
|
||||
ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, OTEServerConfig.SPEC, "otemod-rss-server.toml");
|
||||
|
||||
|
||||
|
@ -152,16 +150,6 @@ public class OTEMod
|
|||
private void setup(final FMLCommonSetupEvent event)
|
||||
{
|
||||
ModMessages.register();
|
||||
|
||||
System.out.println("-----------------------------------------------");
|
||||
for (DyeColor color : DyeColor.values()) {
|
||||
System.out.println(color.toString() + " " + color.getId());
|
||||
}
|
||||
System.out.println("-----------------------------------------------");
|
||||
|
||||
event.enqueueWork(()->{
|
||||
ModDyes.UpdateBlockEntities();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,6 @@ package dev.zontreck.otemod.blocks;
|
|||
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.implementation.CreativeModeTabs;
|
||||
import dev.zontreck.otemod.implementation.ModDyes;
|
||||
import dev.zontreck.otemod.mixins.DyeColorMixin;
|
||||
import net.minecraft.client.resources.model.Material;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
|
@ -22,8 +19,6 @@ import net.minecraftforge.registries.DeferredRegister;
|
|||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModBlocks {
|
||||
|
||||
private static BlockBehaviour.StatePredicate shulkerState = (p_152653_, p_152654_, p_152655_) -> {
|
||||
|
@ -222,10 +217,4 @@ public class ModBlocks {
|
|||
|
||||
public static final RegistryObject<Block> DARK_RED_CARPET = registerWithItem(BLOCKS.register("dark_red_carpet", ()->new CarpetBlock(BlockBehaviour.Properties.copy(Blocks.RED_CARPET))), new Item.Properties());
|
||||
|
||||
public static final RegistryObject<Block> DARK_RED_BED = registerWithItem(BLOCKS.register("dark_red_bed", ()->new BedBlock(DyeColor.byName("dark_red", DyeColor.RED), BlockBehaviour.Properties.copy(Blocks.RED_BED).mapColor((X)->{
|
||||
return X.getValue(BedBlock.PART) == BedPart.FOOT ? ModDyes.DARK_RED.getMapColor() : MapColor.WOOL;
|
||||
}).noOcclusion())), new Item.Properties().stacksTo(1));
|
||||
|
||||
public static final RegistryObject<Block> DARK_RED_SHULKER_BOX = registerWithItem((BLOCKS.register("dark_red_shulker_box", ()->new ShulkerBoxBlock(ModDyes.DARK_RED, BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).strength(2.0F).dynamicShape().noOcclusion().isSuffocating(shulkerState).isViewBlocking(shulkerState)))), new Item.Properties().stacksTo(1));
|
||||
|
||||
}
|
||||
|
|
|
@ -56,6 +56,8 @@ public class ModItemModelsProvider extends ItemModelProvider
|
|||
item(ModItems.LIGHT_BLUE_BRICK);
|
||||
item(ModItems.CYAN_BRICK);
|
||||
item(ModItems.DARK_RED_DYE);
|
||||
item(ModItems.RED_BRICK);
|
||||
item(ModItems.DARK_RED_BRICK);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -98,8 +98,6 @@ public class ModBlockLootTablesProvider extends BlockLootSubProvider
|
|||
dropSelf(ModBlocks.DIRTY_RED_POOL_TILE_SLAB.get());
|
||||
dropSelf(ModBlocks.DARK_RED_WOOL.get());
|
||||
dropSelf(ModBlocks.DARK_RED_CARPET.get());
|
||||
dropSelf(ModBlocks.DARK_RED_BED.get());
|
||||
add(ModBlocks.DARK_RED_SHULKER_BOX.get(), createShulkerBoxDrop(ModBlocks.DARK_RED_SHULKER_BOX.get()));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package dev.zontreck.otemod.implementation;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.blocks.ModBlocks;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ModDyes
|
||||
{
|
||||
public static List<DyeColor> DYES = new ArrayList<>();
|
||||
|
||||
public static DyeColor DARK_RED;
|
||||
|
||||
public static void InitColors() {
|
||||
DARK_RED = DyeColor.byName("dark_red", DyeColor.WHITE);
|
||||
if(DARK_RED == DyeColor.WHITE) DARK_RED = DyeColor.byName("DARK_RED", DyeColor.BLACK);
|
||||
if(DARK_RED == DyeColor.BLACK) {
|
||||
OTEMod.LOGGER.error("Dye colors cannot be obtained properly: " + DARK_RED + " - " + DyeColor.byName("dark_red", DyeColor.WHITE));
|
||||
}
|
||||
DYES.add(DARK_RED);
|
||||
}
|
||||
|
||||
public static void UpdateBlockEntities()
|
||||
{
|
||||
Set<Block> shulkerSet = BlockEntityType.SHULKER_BOX.validBlocks;
|
||||
List<Block> shulkerList = new ArrayList<>();
|
||||
for(Block shulker : shulkerSet)
|
||||
{
|
||||
shulkerList.add(shulker);
|
||||
}
|
||||
shulkerList.add(ModBlocks.DARK_RED_SHULKER_BOX.get());
|
||||
BlockEntityType.SHULKER_BOX.validBlocks = ImmutableSet.copyOf(shulkerList);
|
||||
|
||||
|
||||
Set<Block> bedSet = BlockEntityType.BED.validBlocks;
|
||||
List<Block> bedList = new ArrayList<>();
|
||||
for (Block bed : bedSet) {
|
||||
bedList.add(bed);
|
||||
}
|
||||
bedList.add(ModBlocks.DARK_RED_BED.get());
|
||||
|
||||
BlockEntityType.BED.validBlocks = ImmutableSet.copyOf(bedList);
|
||||
}
|
||||
|
||||
}
|
|
@ -70,6 +70,10 @@ public class ModItems {
|
|||
|
||||
public static final RegistryObject<Item> DARK_RED_DYE = CreativeModeTabs.addToOTEModTab(ITEMS.register("dark_red_dye", ()->new Item(new Item.Properties())));
|
||||
|
||||
public static final RegistryObject<Item> RED_BRICK = CreativeModeTabs.addToOTEModTab(ITEMS.register("red_brick", ()->new Item(new Item.Properties())));
|
||||
|
||||
public static final RegistryObject<Item> DARK_RED_BRICK = CreativeModeTabs.addToOTEModTab(ITEMS.register("dark_red_brick", ()->new Item(new Item.Properties())));
|
||||
|
||||
|
||||
//public static final RegistryObject<Item> POSSUM_SPAWN_EGG = ITEMS.register("possum_spawn_egg", () -> new ForgeSpawnEggItem(ModEntityTypes.POSSUM, 0x938686, 0xc68787, new Item.Properties())));
|
||||
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
package dev.zontreck.otemod.mixins;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mixin(DyeColor.class)
|
||||
public abstract class DyeColorMixin {
|
||||
@Shadow
|
||||
@Final
|
||||
@Mutable
|
||||
public static DyeColor[] $VALUES;
|
||||
private static final DyeColor DARK_RED = addVariant("DARK_RED", "dark_red", 128000001, MapColor.COLOR_BLACK, 128000001, 128000001);
|
||||
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
@Mutable
|
||||
private static final DyeColor[] BY_ID = Arrays.stream($VALUES).sorted(Comparator.comparingInt(DyeColor::getId)).toArray((p_41067_) -> {
|
||||
return new DyeColor[p_41067_];
|
||||
});
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
@Mutable
|
||||
private static final Int2ObjectOpenHashMap<DyeColor> BY_FIREWORK_COLOR = new Int2ObjectOpenHashMap<>(Arrays.stream($VALUES).collect(Collectors.toMap((p_41064_) -> {
|
||||
return p_41064_.getFireworkColor();
|
||||
}, (p_41056_) -> {
|
||||
return p_41056_;
|
||||
})));
|
||||
|
||||
@Shadow @Final private int id;
|
||||
|
||||
@Invoker("<init>")
|
||||
public static DyeColor invokeInit(String internalName, int internalId, int id, String p_41047_, int p_41048_, MapColor p_41049_, int p_41050_, int p_41051_) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
private static DyeColor addVariant(String internalName, String p_41047_, int p_41048_, MapColor p_41049_, int p_41050_, int p_41051_) {
|
||||
ArrayList<DyeColor> variants = new ArrayList<DyeColor>(Arrays.asList(DyeColorMixin.$VALUES));
|
||||
DyeColor color = DyeColorMixin.invokeInit(internalName, variants.get(variants.size() - 1).ordinal() + 1, variants.get(variants.size() - 1).ordinal() + 1, p_41047_, p_41048_, p_41049_, p_41050_, p_41051_);
|
||||
variants.add(color);
|
||||
DyeColorMixin.$VALUES = variants.toArray(new DyeColor[0]);
|
||||
return color;
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package dev.zontreck.otemod.mixins;
|
||||
|
||||
import dev.zontreck.otemod.blocks.ModBlocks;
|
||||
import dev.zontreck.otemod.implementation.ModDyes;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.ShulkerBoxBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
@Mixin(ShulkerBoxBlock.class)
|
||||
public class ShulkerBoxBlockMixin {
|
||||
|
||||
@Inject(locals = LocalCapture.CAPTURE_FAILHARD,
|
||||
method = "getBlockByColor",
|
||||
at = @At(value = "HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private static void getBlockByColorInject(DyeColor p_56191_, CallbackInfoReturnable<Block> cir) {
|
||||
if (p_56191_ == null) {
|
||||
cir.setReturnValue(Blocks.SHULKER_BOX);
|
||||
} else {
|
||||
if(p_56191_ == ModDyes.DARK_RED)
|
||||
{
|
||||
cir.setReturnValue(ModBlocks.DARK_RED_SHULKER_BOX.get());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package dev.zontreck.otemod.mixins;
|
||||
|
||||
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.animal.AbstractGolem;
|
||||
import net.minecraft.world.entity.monster.Shulker;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
@Mixin(Shulker.class)
|
||||
public abstract class ShulkerMixin extends AbstractGolem {
|
||||
@Shadow
|
||||
protected static final EntityDataAccessor<Byte> DATA_COLOR_ID = SynchedEntityData.defineId(Shulker.class, EntityDataSerializers.BYTE);
|
||||
|
||||
protected ShulkerMixin(EntityType<? extends AbstractGolem> p_27508_, Level p_27509_) {
|
||||
super(p_27508_, p_27509_);
|
||||
}
|
||||
|
||||
@Inject(locals = LocalCapture.CAPTURE_FAILHARD,
|
||||
method = "getColor",
|
||||
at = @At(shift = At.Shift.BEFORE, value = "RETURN"),
|
||||
cancellable = true
|
||||
)
|
||||
private void getColorInject(CallbackInfoReturnable<DyeColor> cir) {
|
||||
byte b0 = this.entityData.get(DATA_COLOR_ID);
|
||||
cir.setReturnValue( b0 != 64 && b0 <= 63 ? DyeColor.byId(b0) : null);
|
||||
}
|
||||
|
||||
@Inject(locals = LocalCapture.CAPTURE_FAILHARD,
|
||||
method = "defineSynchedData",
|
||||
at = @At(shift = At.Shift.BEFORE, value = "TAIL"),
|
||||
cancellable = true
|
||||
)
|
||||
private void defineSynchedDataInject(CallbackInfo ci) {
|
||||
this.entityData.set(DATA_COLOR_ID, (byte)64);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
public-f net.minecraft.world.level.block.entity.BlockEntityType f_58915_ #validBlocks
|
|
@ -44,6 +44,9 @@
|
|||
"item.otemod.light_blue_brick": "Light Blue Brick",
|
||||
"item.otemod.cyan_brick": "Cyan Brick",
|
||||
"item.otemod.dark_red_dye": "Dark Red Dye",
|
||||
"item.otemod.red_brick": "Red Brick",
|
||||
"item.otemod.dark_red_brick": "Dark Red Brick",
|
||||
|
||||
|
||||
|
||||
"block.otemod.eternium_ore_block": "Eternium Ore",
|
||||
|
@ -109,8 +112,6 @@
|
|||
"block.otemod.dirty_red_pool_tile_slab": "Dirty Red Pool Tile Slab",
|
||||
"block.otemod.dark_red_wool": "Dark Red Wool",
|
||||
"block.otemod.dark_red_carpet": "Dark Red Carpet",
|
||||
"block.otemod.dark_red_bed": "Dark Red Bed",
|
||||
"block.otemod.dark_red_shulker_box": "Dark Red Shulker Box",
|
||||
|
||||
|
||||
"enchantment.otemod.mob_egging": "Mob Egging",
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 363 B |
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB |
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"otemod:dark_red_bed"
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"otemod:dark_red_shulker_box"
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"otemod:dark_red_bed"
|
||||
]
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"CCC",
|
||||
"DDD"
|
||||
],
|
||||
"key": {
|
||||
"C": {
|
||||
"item": "otemod:dark_red_wool"
|
||||
},
|
||||
"D": {
|
||||
"tag": "forge:wooden_planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "otemod:dark_red_bed",
|
||||
"count": 1
|
||||
}
|
||||
}
|
15
src/main/resources/data/otemod/recipes/dark_red_brick.json
Normal file
15
src/main/resources/data/otemod/recipes/dark_red_brick.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:brick"
|
||||
},
|
||||
{
|
||||
"item": "otemod:dark_red_dye"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "otemod:dark_red_brick",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "building",
|
||||
"group": "bed",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "otemod:dark_red_dye"
|
||||
},
|
||||
[
|
||||
{
|
||||
"item": "minecraft:black_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:brown_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cyan_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gray_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:green_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:light_blue_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:light_gray_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:lime_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:magenta_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:orange_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:pink_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:purple_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:red_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:yellow_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:white_bed"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:blue_bed"
|
||||
}
|
||||
]
|
||||
],
|
||||
"result": {
|
||||
"item": "otemod:dark_red_bed"
|
||||
}
|
||||
}
|
15
src/main/resources/data/otemod/recipes/red_brick.json
Normal file
15
src/main/resources/data/otemod/recipes/red_brick.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:brick"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:red_dye"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "otemod:red_brick",
|
||||
"count": 1
|
||||
}
|
||||
}
|
|
@ -7,13 +7,13 @@
|
|||
],
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "minecraft:white_concrete"
|
||||
"item": "otemod:red_brick"
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:red_terracotta"
|
||||
"item": "otemod:dark_red_brick"
|
||||
},
|
||||
"C": {
|
||||
"item": "minecraft:terracotta"
|
||||
"item": "minecraft:brick"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
"compatibilityLevel": "JAVA_17",
|
||||
"refmap": "otemod.refmap.json",
|
||||
"mixins": [
|
||||
"DyeColorMixin",
|
||||
"ShulkerBoxBlockMixin",
|
||||
"ShulkerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Reference in a new issue