diff --git a/dependencies.gradle b/dependencies.gradle index a029ec0ce..936916096 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,6 +4,7 @@ dependencies { implementation("com.github.GTNewHorizons:CodeChickenCore:1.1.11:dev") implementation("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev") implementation("com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev") + compileOnly("org.projectlombok:lombok:1.18.24") annotationProcessor("org.projectlombok:lombok:1.18.24") diff --git a/repositories.gradle b/repositories.gradle index 83329ef8e..c227b16ec 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,14 +1,4 @@ // Add any additional repositories for your dependencies here repositories { - maven { - name = "GTNH" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - } - maven { - url "https://cursemaven.com" - } - maven { - url = "https://jitpack.io" - } } diff --git a/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java b/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java index 9f27dce98..e8a5309d6 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java +++ b/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java @@ -11,7 +11,7 @@ public interface IAdvancedChisel { /** * Gets the next mode the button in the GUI should switch to given the current mode. - * + * * @param stack The {@link ItemStack} representing the chisel * @param current The {@link IChiselMode} that is currently active * @return The next {@link IChiselMode} in the loop @@ -20,7 +20,7 @@ public interface IAdvancedChisel { /** * Gets an {@link IChiselMode} instance from a String name - * + * * @param chisel The {@link ItemStack} representing the chisel * @param name The name of the {@link IChiselMode mode} * @return An {@link IChiselMode} that has the name {@code name} diff --git a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java index 860623a7c..13f2dd12d 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java +++ b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java @@ -19,7 +19,7 @@ public interface ICarvable extends ICTMBlock { *

* Typically you can refer this method to {@link CarvableHelper#getVariation(int)} but this method is provided for * more complex metadata handling. - * + * * @param metadata The metadata of the block * @param world {@link IBlockAccess} object, usually a world. Use of {@link IBlockAccess} Is necessary due to * this method's use in rendering. @@ -34,7 +34,7 @@ public interface ICarvable extends ICTMBlock { /** * Gets the {@link ISubmapManager} for this block when it is in item form. - * + * * @return A {@link ISubmapManager} */ @Override diff --git a/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java b/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java index fa91a4121..6b9523e65 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java +++ b/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java @@ -14,7 +14,7 @@ public interface IChiselItem { /** * Checks whether the chisel can have its GUI opened - * + * * @param world {@link World} object * @param player The player holding the chisel. It can always be assumed that the player's current item will be * this. @@ -25,7 +25,7 @@ public interface IChiselItem { /** * Called when an item is chiseled using this chisel - * + * * @param world {@link World} object * @param chisel The {@link ItemStack} representing the chisel * @param target The {@link ICarvingVariation} representing the target item @@ -39,7 +39,7 @@ public interface IChiselItem { *

* It is not necessary to take into account whether this item has any variants, this method will only be * called after that check. - * + * * @param world {@link World} object * @param chisel The {@link ItemStack} representing the chisel * @param target The {@link ICarvingVariation} representing the target item @@ -49,7 +49,7 @@ public interface IChiselItem { /** * Allows you to control if your item can chisel this block in the world. - * + * * @param world World object * @param player {@link EntityPlayer The player} holding the chisel. * @param x X coord of the block being chiseled @@ -63,7 +63,7 @@ public interface IChiselItem { /** * Allows you to control if your item has chiseling modes. - * + * * @param chisel The {@link ItemStack} representing the chisel. * @return True if the chisel supports modes. False otherwise. */ diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java b/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java index 566142176..e316ff4af 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java @@ -19,10 +19,13 @@ import com.cricketcraft.chisel.api.FMPIMC; import com.cricketcraft.chisel.api.rendering.TextureType; +import codechicken.microblock.MicroMaterialRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import team.chisel.block.BlockCarvableGlowie; +import team.chisel.client.render.FullBrightMicroMaterial; import team.chisel.ctmlib.ISubmapManager; public class CarvableHelper { @@ -187,11 +190,21 @@ public void registerVariation(String name, IVariationInfo info) { Block block = info.getVariation() .getBlock(); - if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) { - FMPIMC.registerFMP( - block, - info.getVariation() - .getBlockMeta()); + if (block instanceof BlockCarvableGlowie) { + int meta = info.getVariation() + .getBlockMeta(); + + MicroMaterialRegistry.registerMaterial( + new FullBrightMicroMaterial(block, meta), + block.getUnlocalizedName() + ((meta > 0) ? ("_" + meta) : "")); + + } else { + if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) { + FMPIMC.registerFMP( + block, + info.getVariation() + .getBlockMeta()); + } } if (forbidChiseling) return; diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java b/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java index 2b56c02d3..aef471522 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java @@ -14,7 +14,7 @@ public class CarvingUtils { /** * A simple way to compare two {@link ICarvingVariation} objects based on the {@link ICarvingVariation#getOrder() * getOrder()} method. - * + * * @param v1 The first {@link ICarvingVariation variation}. * @param v2 The second {@link ICarvingVariation variation}. * @return A positive integer if the first's order is greater, a negative integer if the second's is greater, and 0 @@ -26,7 +26,7 @@ public static int compare(ICarvingVariation v1, ICarvingVariation v2) { /** * Gets an {@link ItemStack} representing the passed {@link ICarvingVariation}. - * + * * @param variation An {@link ICarvingVariation} * @return An {@link ItemStack} */ @@ -48,7 +48,7 @@ public static ICarvingRegistry getChiselRegistry() { /** * Creates a standard {@link ICarvingVariation} for the given data. Use this if you do not need any custom behavior * in your own variation. - * + * * @param block The block of the variation * @param metadata The metadata of both the block and item * @param order The sorting order. @@ -61,7 +61,7 @@ public static ICarvingVariation getDefaultVariationFor(Block block, int metadata /** * Creates a standard {@link ICarvingGroup} for the given name. Use this if you do not need any custom behavior in * your own group. - * + * * @param name The name of the group. * @return A standard {@link ICarvingGroup} instance. */ diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java index 9ab7fd076..19654b289 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java @@ -18,7 +18,7 @@ public interface ICarvingRegistry { /** * Finds the group the block/meta pair belongs to in the registry. - * + * * @param block The block of the variation * @param meta The metadata of the variation * @return The {@link ICarvingGroup} that the block/meta pair belongs to @@ -27,7 +27,7 @@ public interface ICarvingRegistry { /** * Gets an {@link ICarvingGroup} by its name. - * + * * @param name The name of the group * @return An {@link ICarvingGroup} */ @@ -35,7 +35,7 @@ public interface ICarvingRegistry { /** * Gets the {@link ICarvingVariation} instance represented by this block/meta pair. - * + * * @param block The block of the variatoin * @param meta The metadata of the variation * @return The {@link ICarvingVariation} containing this block/meta pair @@ -44,7 +44,7 @@ public interface ICarvingRegistry { /** * Gets the list of {@link ICarvingVariation}s from the group that contains this block/meta pair. - * + * * @param block The block of the variation * @param meta The metadata of the variation * @return All of the {@link ICarvingVariation}s in the group that contains this block/meta pair @@ -53,7 +53,7 @@ public interface ICarvingRegistry { /** * Gets the oredict name for the group that contains this block/meta pair. - * + * * @param block The block of the variation * @param meta The metadata of the variation * @return A string oredict name for the group @@ -62,7 +62,7 @@ public interface ICarvingRegistry { /** * Gets the possible output items for this {@link ItemStack}. To be used for machines/GUIs that chisel items. - * + * * @param chiseled The {@link ItemStack} being chiseled * @return A list of stacks that can be chiseled from the passed {@link ItemStack stack} */ @@ -70,7 +70,7 @@ public interface ICarvingRegistry { /** * Gets the sound resource string for the group represented by this block/meta pair. - * + * * @param block The block of the variation * @param metadata The metadata of the variation * @return The string resource for the sound that can be used in @@ -83,7 +83,7 @@ public interface ICarvingRegistry { *

* Mostly a convenience for calling {@link #getVariationSound(Block, int)} with * {@link Block#getBlockFromItem(Item)}. - * + * * @param item The item of the variation * @param metadata The metadata of the variation * @return The string resource for the sound that can be used in @@ -100,7 +100,7 @@ public interface ICarvingRegistry { /** * Adds a variation to the registry. - * + * * @param groupName The name of the group to add to. * @param block The block of the variation * @param metadata The metadata of the variation @@ -111,7 +111,7 @@ public interface ICarvingRegistry { /** * Adds a variation to the registry. - * + * * @param groupName The name of the group to add to * @param variation The {@link ICarvingVariation} to add */ @@ -119,7 +119,7 @@ public interface ICarvingRegistry { /** * Adds a group to the registry. - * + * * @param group The {@link ICarvingGroup} to add. */ void addGroup(ICarvingGroup group); @@ -130,7 +130,7 @@ public interface ICarvingRegistry { * This in effect removes all variations associated with the group, though they are not explicitly removed from the * object. If you maintain a reference to the {@link ICarvingGroup} that is removed, it will still contain its * variations. - * + * * @param groupName The name of the group to remove. * @return The {@link ICarvingGroup} that was removed. */ @@ -139,7 +139,7 @@ public interface ICarvingRegistry { /** * Removes a varaition with the passed {@link Block} and metadata from the registry. If this variation is registered * with mutiple groups, it will remove it from all of them. - * + * * @param block The {@link Block} of the {@link ICarvingVariation variation} * @param metadata The metadata of the {@link ICarvingVariation variation} * @return The ICarvingVariation that was removed. Null if nothing was removed. @@ -149,7 +149,7 @@ public interface ICarvingRegistry { /** * Removes a varaition with the passed {@link Block} and metadata from the registry, but only from the specified * {@link ICarvingGroup} name. - * + * * @param block The {@link Block} of the {@link ICarvingVariation variation} * @param metadata The metadata of the {@link ICarvingVariation variation} * @param group The name of the group that the variation should be removed from @@ -162,7 +162,7 @@ public interface ICarvingRegistry { *

* Doing this means that all blocks that are registered to this oredict name will act as if they are a part of this * group. - * + * * @param groupName The name of the group * @param oreName The oredict name */ @@ -173,7 +173,7 @@ public interface ICarvingRegistry { *

* This is the sound that is used when a block from this group is chiseled.
* Does not need to be explicitly set. - * + * * @param name The name of the group * @param sound The resource string for the sound */ diff --git a/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java b/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java index 1465a8c58..8c8be963a 100644 --- a/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java +++ b/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java @@ -42,7 +42,7 @@ protected Object registerIcons(ICarvingVariation variation, String modName, Stri register.registerIcon(modName + ":" + texturePath + "-top") }; } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { IIcon[] icons = (IIcon[]) cachedObject; @@ -57,7 +57,7 @@ protected Object registerIcons(ICarvingVariation variation, String modName, Stri register.registerIcon(modName + ":" + texturePath + "-top") }; } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { IIcon[] icons = (IIcon[]) cachedObject; @@ -65,18 +65,18 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int si } }, CTMV("ctmv", "top"){ - + @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return Pair.of(new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-ctmv"), 2, 2), register.registerIcon(modName + ":" + texturePath + "-top")); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { Pair data = (Pair) cachedObject; return side < 2 ? data.getRight() : data.getLeft().getSubIcon(0, 0); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { Pair data = (Pair) cachedObject; @@ -96,13 +96,13 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock return map.getSubIcon(1, 0); return map.getSubIcon(0, 0); } - + @Override @SideOnly(Side.CLIENT) protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) { RenderBlocksColumn ret = theRenderBlocksColumn; Pair data = (Pair) cachedObject; - + ret.blockAccess = world; ret.renderMaxX = 1.0; ret.renderMaxY = 1.0; @@ -117,13 +117,13 @@ protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAcces @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return Pair.of(new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-ctmh"), 2, 2), register.registerIcon(modName + ":" + texturePath + "-top")); - } - + } + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return CTMV.getIcon(variation, cachedObject, side, meta); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { Pair data = (Pair) cachedObject; @@ -143,7 +143,7 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock p = ctm.isConnected(world, x, y, z - 1, side, block, meta); n = ctm.isConnected(world, x, y, z + 1, side, block, meta); } - + TextureSubmap map = data.getLeft(); if (p && n) return map.getSubIcon(1, 0); @@ -159,14 +159,14 @@ else if (n) protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-v9"), 3, 3); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return ((TextureSubmap)cachedObject).getSubIcon(1, 1); } @Override - protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { + protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getVIcon(this, (TextureSubmap) cachedObject, x, y, z, side); } }, @@ -175,12 +175,12 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-v4"), 2, 2); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return ((TextureSubmap)cachedObject).getSubIcon(0, 0); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getVIcon(this, (TextureSubmap) cachedObject, x, y, z, side); @@ -196,12 +196,12 @@ protected Object registerIcons(ICarvingVariation variation, String modName, Stri new TextureSubmap(baseIcon, 2, 2) ); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return ((Triple)cachedObject).getLeft(); } - + @Override @SideOnly(Side.CLIENT) protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) { @@ -220,13 +220,13 @@ protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAcces @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-r16"), 4, 4); - } - + } + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return V9.getIcon(variation, cachedObject, side, meta); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getRIcon(this, (TextureSubmap) cachedObject, x, y, z, side); @@ -236,30 +236,30 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-r9"), 3, 3); - } - + } + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return V9.getIcon(variation, cachedObject, side, meta); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getRIcon(this, (TextureSubmap) cachedObject, x, y, z, side); } }, R4("r4"){ - + @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return new TextureSubmap(register.registerIcon(modName + ":" + texturePath + "-r4"), 2, 2); - } - + } + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return V4.getIcon(variation, cachedObject, side, meta); } - + @Override protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getRIcon(this, (TextureSubmap) cachedObject, x, y, z, side); @@ -267,9 +267,9 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock }, NORMAL, CUSTOM; - + /* Some util stuff for shared code between v* and r* */ - + public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) { int variationSize = (type == TextureType.V9) ? 3 : 2; @@ -304,23 +304,23 @@ public static IIcon getVIcon(TextureType type, TextureSubmap map, int x, int y, return map.getSubIcon(index % variationSize, index / variationSize); } - + public static IIcon getRIcon(TextureType type, TextureSubmap map, int x, int y, int z, int side) { rand.setSeed(getCoordinateRandom(x, y, z)); rand.nextBoolean(); int size = type == TextureType.R4 ? 2 : type == TextureType.R9 ? 3 : 4; return map.getSubIcon(rand.nextInt(size), rand.nextInt(size)); } - + private static long getCoordinateRandom(int x, int y, int z) { // MC 1.8 code... long l = (x * 3129871) ^ z * 116129781L ^ y; l = l * l * 42317861L + l * 11L; return l; } - + /* End of that mess */ - + private static final TextureType[] VALUES; private static final CTM ctm = CTM.getInstance(); private static final Random rand = new Random(); @@ -337,31 +337,31 @@ private static long getCoordinateRandom(int x, int y, int z) { private TextureType(String... suffixes) { this.suffixes = suffixes.length == 0 ? new String[] { "" } : suffixes; } - + private static void initStatics() { if (theRenderBlocksCTM == null) { theRenderBlocksCTM = new RenderBlocksCTM(); theRenderBlocksColumn = new RenderBlocksColumn(); } } - + public ISubmapManager createManagerFor(ICarvingVariation variation, String texturePath) { return new SubmapManagerDefault(this, variation, texturePath); } - + public ISubmapManager createManagerFor(ICarvingVariation variation, Block block, int meta) { return new SubmapManagerExistingIcon(this, variation, block, meta); } - + @SideOnly(Side.CLIENT) protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { return register.registerIcon(modName + ":" + texturePath); } - + protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, int side, int meta) { return (IIcon) cachedObject; } - + protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlockAccess world, int x, int y, int z, int side, int meta) { return getIcon(variation, cachedObject, side, meta); } @@ -370,7 +370,7 @@ protected IIcon getIcon(ICarvingVariation variation, Object cachedObject, IBlock protected RenderBlocks createRenderContext(RenderBlocks rendererOld, IBlockAccess world, Object cachedObject) { return rendererOld; } - + public static TextureType getTypeFor(CarvableHelper inst, String modid, String path) { if (path == null) { return CUSTOM; @@ -388,7 +388,7 @@ public static TextureType getTypeFor(CarvableHelper inst, String modid, String p } return CUSTOM; } - + // This is ugly, but faster than class.getResource private static boolean exists(String modid, String path, String postfix) { ResourceLocation rl = new ResourceLocation(modid, "textures/blocks/" + path + postfix + ".png"); @@ -399,18 +399,18 @@ private static boolean exists(String modid, String path, String postfix) { return false; } } - + @SideOnly(Side.CLIENT) public abstract static class AbstractSubmapManager implements ISubmapManager { protected final TextureType type; protected ICarvingVariation variation; protected Object cachedObject; - + private AbstractSubmapManager(TextureType type, ICarvingVariation variation) { this.type = type; this.variation = variation; } - + @Override public IIcon getIcon(int side, int meta) { return type.getIcon(variation, cachedObject, side, meta); @@ -420,7 +420,7 @@ public IIcon getIcon(int side, int meta) { public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { return type.getIcon(variation, cachedObject, world, x, y, z, side, world.getBlockMetadata(x, y, z)); } - + @Override public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { initStatics(); @@ -428,15 +428,15 @@ public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, I rb.setRenderBoundsFromBlock(block); return rb; } - + @Override public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { } - + @Override - public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { + public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { } - + public Object getCachedObject() { return cachedObject; } @@ -446,7 +446,7 @@ public Object getCachedObject() { private static class SubmapManagerDefault extends AbstractSubmapManager { private String texturePath; - + private SubmapManagerDefault(TextureType type, ICarvingVariation variation, String texturePath) { super(type, variation); this.texturePath = texturePath; @@ -457,24 +457,24 @@ public void registerIcons(String modName, Block block, IIconRegister register) { cachedObject = type.registerIcons(variation, modName, texturePath, register); } } - + @SideOnly(Side.CLIENT) private static class SubmapManagerExistingIcon extends AbstractSubmapManager { - + private Block block; private int meta; - + private SubmapManagerExistingIcon(TextureType type, ICarvingVariation variation, Block block, int meta) { super(type, variation); this.block = block; this.meta = meta; } - + @Override public IIcon getIcon(int side, int meta) { return block.getIcon(side, this.meta); } - + @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { return getIcon(side, world.getBlockMetadata(x, y, z)); @@ -484,4 +484,4 @@ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { public void registerIcons(String modName, Block block, IIconRegister register) { } } -} \ No newline at end of file +} diff --git a/src/main/java/team/chisel/Features.java b/src/main/java/team/chisel/Features.java index 177e16ae0..980818eee 100644 --- a/src/main/java/team/chisel/Features.java +++ b/src/main/java/team/chisel/Features.java @@ -237,7 +237,7 @@ void addRecipes() { @Override void addBlocks() { - BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableAntiBlock() + BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableGlowie(Material.rock) .setCreativeTab(ChiselTabs.tabOtherChiselBlocks); if (!Configurations.allowChiselCrossColors) { diff --git a/src/main/java/team/chisel/block/BlockCarvable.java b/src/main/java/team/chisel/block/BlockCarvable.java index e302e6b5d..beab85148 100644 --- a/src/main/java/team/chisel/block/BlockCarvable.java +++ b/src/main/java/team/chisel/block/BlockCarvable.java @@ -104,7 +104,7 @@ public static class SoundType extends Block.SoundType { /** * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and * step.soundName must be specified in the sounds.json - * + * * @param soundName block of the sound. Will automatically be expanded to "mod:dig.soundName" and * "mod:step.soundName" respectively) * @param volume default 1.0f @@ -120,7 +120,7 @@ public SoundType(String soundName, float volume, float frequency) { /** * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the * sounds.json - * + * * @param soundNameBreak block break sound * @param soundNameStep block step sound * @param volume default 1.0f @@ -136,7 +136,7 @@ public SoundType(String soundNameBreak, String soundNameStep, float volume, floa /** * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the * sounds.json - * + * * @param soundNameBreak block break sound * @param soundNameStep block step sound * @param soundNamePlace block place sound diff --git a/src/main/java/team/chisel/block/BlockCarvableSand.java b/src/main/java/team/chisel/block/BlockCarvableSand.java index 029ae9dce..ba347f8cb 100644 --- a/src/main/java/team/chisel/block/BlockCarvableSand.java +++ b/src/main/java/team/chisel/block/BlockCarvableSand.java @@ -92,7 +92,7 @@ public static class SoundType extends Block.SoundType { /** * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and * step.soundName must be specified in the sounds.json - * + * * @param soundName block of the sound. Will automatically be expanded to "mod:dig.soundName" and * "mod:step.soundName" respectively) * @param volume default 1.0f @@ -108,7 +108,7 @@ public SoundType(String soundName, float volume, float frequency) { /** * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the * sounds.json - * + * * @param soundNameBreak block break sound * @param soundNameStep block step sound * @param volume default 1.0f @@ -124,7 +124,7 @@ public SoundType(String soundNameBreak, String soundNameStep, float volume, floa /** * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the * sounds.json - * + * * @param soundNameBreak block break sound * @param soundNameStep block step sound * @param soundNamePlace block place sound diff --git a/src/main/java/team/chisel/client/render/FullBrightLighting.java b/src/main/java/team/chisel/client/render/FullBrightLighting.java new file mode 100644 index 000000000..d9e05fcb1 --- /dev/null +++ b/src/main/java/team/chisel/client/render/FullBrightLighting.java @@ -0,0 +1,35 @@ +package team.chisel.client.render; + +import codechicken.lib.render.CCRenderState; + +public class FullBrightLighting implements CCRenderState.IVertexOperation { + + public static FullBrightLighting instance = new FullBrightLighting(); + public int id; + + public boolean load() { + if (!CCRenderState.computeLighting) { + return false; + } + CCRenderState.pipeline.addDependency(CCRenderState.colourAttrib); + CCRenderState.pipeline.addDependency(CCRenderState.lightCoordAttrib); + return true; + } + + public void operate() { + CCRenderState.setBrightness(FULL_BRIGHT_BLOCK_BRIGHTNESS); + } + + public int operationID() { + return id; + } + + { + id = CCRenderState.registerOperation(); + } + + // magic number from 'RenderBlocksCTMFullbright' + // this is the brightness of the neonite, anti, glotek blocks + // so we use it for custom microblock lighting + private final static int FULL_BRIGHT_BLOCK_BRIGHTNESS = 0xF000F0; +} diff --git a/src/main/java/team/chisel/client/render/FullBrightMicroMaterial.java b/src/main/java/team/chisel/client/render/FullBrightMicroMaterial.java new file mode 100644 index 000000000..a496e5c73 --- /dev/null +++ b/src/main/java/team/chisel/client/render/FullBrightMicroMaterial.java @@ -0,0 +1,33 @@ +package team.chisel.client.render; + +import net.minecraft.block.Block; + +import codechicken.lib.render.CCRenderState; +import codechicken.lib.render.ColourMultiplier; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Vector3; +import codechicken.microblock.BlockMicroMaterial; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FullBrightMicroMaterial extends BlockMicroMaterial { + + public FullBrightMicroMaterial(final Block block, final int meta) { + super(block, meta); + } + + @SideOnly(Side.CLIENT) + public void renderMicroFace(final Vector3 pos, final int pass, final Cuboid6 bounds) { + CCRenderState.pipeline.builder() + .add((CCRenderState.IVertexOperation) pos.translation()) + .add((CCRenderState.IVertexOperation) this.icont()) + .add((CCRenderState.IVertexOperation) ColourMultiplier.instance(FULL_BRIGHT_COLOR_MULTIPLIER)) + .add((CCRenderState.IVertexOperation) FullBrightLighting.instance) + .render(); + } + + // magic number from 'RenderBlocksCTMFullbright' + // this is what makes the neonite, anti, glotek blocks burn bright as my ass does + // so we use it for custom microblock render + private final static int FULL_BRIGHT_COLOR_MULTIPLIER = 0xFFFFFFFF; +} diff --git a/src/main/java/team/chisel/inventory/ContainerAutoChisel.java b/src/main/java/team/chisel/inventory/ContainerAutoChisel.java index f0a631358..6aa341bbe 100644 --- a/src/main/java/team/chisel/inventory/ContainerAutoChisel.java +++ b/src/main/java/team/chisel/inventory/ContainerAutoChisel.java @@ -118,7 +118,7 @@ public ItemStack slotClick(int slotId, int p_75144_2_, int p_75144_3_, EntityPla /** * Added validation of slot input - * + * * @author CrazyPants */ @Override