Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Yanny7

Members
  • Joined

  • Last visited

Everything posted by Yanny7

  1. 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; }
  2. 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?
  3. 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
  4. 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
  5. 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:
  6. You can inspire yourself from existing CapabilityItemHandler
  7. Maybe you are missing few ObjectHolders for ItemList: @ObjectHolder("visionarymod:guidebook") public static Item guidebook; @ObjectHolder("visionarymod:steamvent") public static Item steamvent; and for BlockList: @ObjectHolder("visionarymod:steamvent") public static Block steamvent;
  8. @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)) ); } } }
  9. just replace that variables with your values, code is copy-pasted from my project
  10. You should use ModBlocks.PLASTICORE.getDefaultState()
  11. My bad, I copied more than I intended. I already updated my post
  12. 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)) ); } } }
  13. 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 } } } ...
  14. 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?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.