mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-22 05:02:32 +00:00
fix: register all requested microblock metadata variants
This commit is contained in:
1 parent
4e0d7a684e
commit
74eb0ea7ba
4 files changed
+23
-4
No files matched your search
+3
-3
@@ -360,9 +360,9 @@ class DefaultContentFunctionalTest {
|
||||
add(expectedNames, expectedRemaps, Blocks.cobblestone, "minecraft:cobblestone", 0);
|
||||
add(expectedNames, expectedRemaps, Blocks.planks, "minecraft:planks", 5);
|
||||
add(expectedNames, expectedRemaps, Blocks.log, "minecraft:log", 3);
|
||||
add(expectedNames, expectedRemaps, Blocks.log2, "minecraft:log2", 0, "tile.log2");
|
||||
add(expectedNames, expectedRemaps, Blocks.log2, "minecraft:log2", 1, "tile.log2");
|
||||
add(expectedNames, expectedRemaps, Blocks.leaves, "minecraft:leaves", 3);
|
||||
add(expectedNames, expectedRemaps, Blocks.leaves2, "minecraft:leaves2", 0, "tile.leaves2");
|
||||
add(expectedNames, expectedRemaps, Blocks.leaves2, "minecraft:leaves2", 1, "tile.leaves2");
|
||||
add(expectedNames, expectedRemaps, Blocks.sponge, "minecraft:sponge", 0);
|
||||
add(expectedNames, expectedRemaps, Blocks.glass, "minecraft:glass", 0);
|
||||
add(expectedNames, expectedRemaps, Blocks.lapis_block, "minecraft:lapis_block", 0);
|
||||
@@ -419,7 +419,7 @@ class DefaultContentFunctionalTest {
|
||||
}
|
||||
}
|
||||
|
||||
assertEquals(119, expectedNames.size());
|
||||
assertEquals(121, expectedNames.size());
|
||||
assertEquals(expectedNames, actualNames);
|
||||
assertEquals(expectedRemaps, materialRemaps());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -17,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.microblock.ItemMicroPart;
|
||||
import codechicken.microblock.MicroMaterialRegistry;
|
||||
import codechicken.microblock.MicroRecipe;
|
||||
@@ -41,6 +43,22 @@ class MicroRecipeFunctionalTest {
|
||||
assertMicro(MicroRecipe.getCraftingResult(crafting), 2, 0, 2, material);
|
||||
}
|
||||
|
||||
@Test
|
||||
void cuttingDarkOakLogsAndLeavesRetainsTheirMetadata() {
|
||||
for (Block block : new Block[] { Blocks.log2, Blocks.leaves2 }) {
|
||||
String name = BlockMicroMaterial.materialKey(block, 1);
|
||||
assertTrue(MicroMaterialRegistry.getMaterial(name) instanceof BlockMicroMaterial);
|
||||
int material = MicroMaterialRegistry.materialID(name);
|
||||
InventoryCrafting crafting = grid();
|
||||
crafting.setInventorySlotContents(0, new ItemStack(new TestSaw(100)));
|
||||
crafting.setInventorySlotContents(3, new ItemStack(block, 1, 1));
|
||||
assertMicro(MicroRecipe.getCraftingResult(crafting), 2, 0, 4, material);
|
||||
ItemStack restored = MicroRecipe.create(1, 0, 8, material);
|
||||
assertSame(Item.getItemFromBlock(block), restored.getItem());
|
||||
assertEquals(1, restored.getItemDamage());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void recipeMetadataMaterialLookupAndCreationRoundTrip() {
|
||||
int material = glassMaterial();
|
||||
|
||||
@@ -53,7 +53,7 @@ public final class BlockMicroMaterial$ {
|
||||
}
|
||||
|
||||
public void createAndRegister(Block block, Seq<Object> meta, String oldName) {
|
||||
createAndRegister(block, 0, materialKey(block), oldName);
|
||||
createAndRegister(block, meta, materialKey(block), oldName);
|
||||
}
|
||||
|
||||
public void createAndRegister(Block block, Seq<Object> meta, String name, String oldName) {
|
||||
|
||||
Reference in new issue
Block a user