Yanny7
Members-
Posts
64 -
Joined
-
Last visited
Everything posted by Yanny7
-
I got it working private ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/block/fluid_pipe.png"); @Override public void render(BoilerTile tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); GlStateManager.translated(x, y, z); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bindTexture(texture); RenderHelper.disableStandardItemLighting(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.enableBlend(); GlStateManager.disableCull(); bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(0, 1.1, 1).tex(0, 1).endVertex(); bufferbuilder.pos(1, 1.1, 1).tex(1, 1).endVertex(); bufferbuilder.pos(1, 1.1, 0).tex(1, 0).endVertex(); bufferbuilder.pos(0, 1.1, 0).tex(0, 0).endVertex(); tessellator.draw(); GlStateManager.enableCull(); GlStateManager.disableBlend(); RenderHelper.enableStandardItemLighting(); GlStateManager.popMatrix(); } and in Block class extends this: @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT_MIPPED; }
-
Hi, I have problem to draw texture overlay over block side. I am not familiar with OpenGL so I tried to look into other projects/mc source code, but without success. Currently I have this code in TER: private ResourceLocation texture = new ResourceLocation(Reference.MODID, "textures/block/machine_top.png"); @Override public void render(BoilerTile tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); bindTexture(texture); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(x, y + 1.1, z + 1.0D).tex(0, 1).endVertex(); bufferbuilder.pos(x + 1.0D, y + 1.1, z + 1.0D).tex(1, 1).endVertex(); bufferbuilder.pos(x + 1.0D, y + 1.1, z).tex(1, 0).endVertex(); bufferbuilder.pos(x, y + 1.1, z).tex(0, 0).endVertex(); tessellator.draw(); GlStateManager.popMatrix(); } Results in this (texture is too dark): Can you please guide me how to draw texture overlay correctly?
-
[1.14.4][SOLVED] translated ItemStack display name
Yanny7 replied to Yanny7's topic in Modder Support
Actually it was correct with quotes, without quotes is json invalid. I forgot to re-generate my resources locally (I am using multiple json lang files and with script I am merging them to output one), so it is already working -
How can I provide translation for ItemStack? I tried this, but without success: itemStack.setDisplayName(new TranslationTextComponent("part.name", text1, text2, text3); In lang file I have "part.name": "Text: %s %s %s" I still see in tooltip "part.name" as display name
-
[1.14.4][Solved] Create recipes for machine with json
Yanny7 replied to Tieso2001's topic in Modder Support
its not so hard, this is how I created recipes for crusher: Just implement own IRecipe<IInventory>, then extend recipe serializer, dont forget to register it, this is how JSON looks like, and finally, get recipe in your machine: -
[1.14.4][SOLVED] storing complex sets of data in capability
Yanny7 replied to andGarrett's topic in Modder Support
You can inspire yourself from existing CapabilityItemHandler -
@Mod.EventBusSubscriber(modid = "YOUR_MODID", bus = Mod.EventBusSubscriber.Bus.FORGE) public class ForgeEventSubscriber { @SubscribeEvent public static void onInitBiomesGen(WorldTypeEvent.BiomeSize event) { for (Biome biome : ForgeRegistries.BIOMES) { biome.addFeature( GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature( Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, YOUR_BLOCK.getDefaultState(), 8), Placement.COUNT_RANGE, new CountRangeConfig(10, 0, 40, 120)) ); } } }
-
just replace that variables with your values, code is copy-pasted from my project
-
You should use ModBlocks.PLASTICORE.getDefaultState()
-
My bad, I copied more than I intended. I already updated my post
-
Here is example, just replace YOUR_BLOCK with your registered block and all property.<type> with your values @Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class ForgeEventSubscriber { @SubscribeEvent public static void onInitBiomesGen(WorldTypeEvent.BiomeSize event) { for (Biome biome : ForgeRegistries.BIOMES) { biome.addFeature( GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature( Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, YOUR_BLOCK.getDefaultState(), property.veinSize), Placement.COUNT_RANGE, new CountRangeConfig(property.veinCount, property.heightMin, property.heightBase, property.heightMax)) ); } } }
-
I tried it, but without success. I marked my folder as "Generated Sources Root", but when I add into build.gradle "from sourceSets.generated.output" it fails saying something that: Could not get unknown property 'generated' for SourceSet container of type org.gradle.api.internal.tasks.DefaultSourceSetContainer. I spend few hours googling about gradle and sourceSets, but there is nothing helpfull. Can you please provide some example how to add it into gradle file? Edit I found simple solution to this, just extend sourceSet.main.resources.srcDirs: ... client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' // Add generated resource files sourceSets.main.resources.srcDirs += ['src/generated/resources'] mods { toomanyores { source sourceSets.main } } } ...
-
Hi, by default, resources are load from path src/main/resources but I would like to have another location containing resource files, e.g. generated/resources. I need to separate this because in generated folder I have a lot of files and while development I often change them, rename and so on, so I can easely loose track of files which are not used anymore, but are still there. With this approach I can delete whole generated folder and re-generate it from script again Is it possible to have them separated and on build/run merge this two folders?