Jump to content

Skyriis

Members
  • Posts

    176
  • Joined

  • Last visited

Everything posted by Skyriis

  1. Hey Guys, i'm trying to render my own projectile and get strange results. Sometimes it works and sometimes the Projectile behave weird. I recorded the my issue here: https://youtu.be/pZzjO-KiXuE Here is my code for the renderer: @Override public void doRender(EntityShockRifleProjectile entity, double x, double y, double z, float entityYaw, float partialTicks) { this.bindEntityTexture(entity); GlStateManager.pushMatrix(); GlStateManager.disableLighting(); GlStateManager.disableCull(); GlStateManager.translate((float) x, (float) y, (float) z); GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) - 90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch), 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); GlStateManager.enableRescaleNormal(); GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F); GlStateManager.scale(0.05625F * 3, 0.05625F * 3, 0.05625F * 3); GlStateManager.translate(-4.0F, 0.0F, 0.0F); final Color projectileColor = new Color(0, 139, 255, 255); GlStateManager.color(1F / 255F * projectileColor.getRed(), 1F / 255F * projectileColor.getGreen(), 1F / 255 * projectileColor.getBlue(), 1F / 255 * projectileColor.getAlpha()); final double width = 8.0D; final double height = 0.5D; for (int j = 0; j < 4; ++j) { GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); GlStateManager.glNormal3f(0.0F, 0.0F, 0.05625F); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(-width, -height, 0.0D).tex(0.0D, 0.0D).endVertex(); bufferbuilder.pos(width, -height, 0.0D).tex(1, 0.0D).endVertex(); bufferbuilder.pos(width, height, 0.0D).tex(1, 1).endVertex(); bufferbuilder.pos(-width, height, 0.0D).tex(0.0D, 1).endVertex(); tessellator.draw(); } GlStateManager.disableRescaleNormal(); GlStateManager.enableLighting(); GlStateManager.enableCull(); GlStateManager.popMatrix(); } I tried my best to figure out what is causing this behavior but i don't know that much about GL & Rendering. I would be very happy about help ^^ :Edit This issue just happens on the client who is shooting the projectile. The other players see those 'buggy' projectiles without any problems.
  2. Oh wow. This is a lot easier than i thought. Thanks for your help!
  3. I am currently trying to create a custom registry and registering an entry using the deffered register system. Here is the building of my registry: public static void registerRegistry(final RegistryEvent.NewRegistry e) { RegistryBuilder<CharacterClass> characterClassBuilder = new RegistryBuilder<>(); characterClassBuilder.setType(CharacterClass.class); characterClassBuilder.setName(new ResourceLocation(Constants.MOD_ID, "character_classes")); characterClassBuilder.create(); LogManager.getLogger(Constants.MOD_ID).debug("Created Character Class Registry"); } The event listener is added in my mod constructer (here in line 4) and the registry objects are registered through the deferred register object CHARACTER_CLASS_REGISTRY in the CharacterClasses class @Mod(Constants.MOD_ID) public BlutmondRPG() { final IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); // Gets BlutmondRPG Event Bus modBus.addListener(CharacterClassRegistry::registerRegistry); //Register Character Class Registry <<<<<<<<<< modBus.addListener(this::setup); // Register Client & Server Event Handler modBus.addListener(this::clientSetup); // Register Client only Event Handler CharacterClasses.register(modBus); } CharacterClasses.class private static final DeferredRegister<CharacterClass> CHARACTER_CLASS_REGISTRY = DeferredRegister.create(LazyForgeRegistry.of(CharacterClass.class), Constants.MOD_ID); private static boolean isInitialised = false; public static final RegistryObject<CharacterClass> DEFAULT_CLASS = CHARACTER_CLASS_REGISTRY.register("none", DefaultCharacterClass::new); public static void register(final IEventBus modEventBus) { if (isInitialised) { throw new IllegalStateException("Already initialised"); } CHARACTER_CLASS_REGISTRY.register(modEventBus); isInitialised = true; LogManager.getLogger(Constants.MOD_ID).debug("Registered Character Classes."); } those classes could be needed for understanding the whole code: CharacterClass LazyForgeRegistry On startup i'm getting the NullPointerException from my LazyForgeRegistry ("Registry of type CharacterClass not present"). Somehow GameRegistry.findRegistry(CharacterClass.class) returns null. Did i something wrong in my registerRegistry method?
  4. Use the TileEntityType.Builder.create method to create your TileEntityType and replace TileEntityType<?> with your TileEntityType. This should fix the issues
  5. It worked Thanks Guys
  6. You should maybe take a look on these links: https://mcforge.readthedocs.io/en/1.15.x/ #Forge Docs https://github.com/TheGreyGhost/MinecraftByExample #Code Examples https://www.youtube.com/playlist?list=PLmaTwVFUUXiBKYYSyrv_uPPoPZtEsCBVJ #Youtube Tutorials I hope those links help you to gain knowledge about forge.
  7. For anyone who is looking for the same as me: Industrial-Foregoing has a pretty readable code. Take a look here: Industrial-Foregoing, Titanium
  8. \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:17: error: variable buffer is already defined in class AudioStreamBuffer private int buffer; ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:42: error: incompatible types: int cannot be converted to ByteBuffer this.buffer = aint[0]; ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:47: error: incompatible types: ByteBuffer cannot be converted to int return OptionalInt.of(this.buffer); ^ \build\tmp\expandedArchives\forge-1.15.2-31.2.5_mapped_snapshot_20200527-1.15.1-sources.jar_9cd6b6f6d0e95001e684dcdb4ddabbf6\net\minecraft\client\audio\AudioStreamBuffer.java:52: error: incompatible types: ByteBuffer cannot be converted to int AL10.alDeleteBuffers(new int[]{this.buffer}); These is are the first few messages. And the Exception is: Any ideas how to fix that?
  9. com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not find forge.jar (net.minecraftforge:forge:1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f). Searched in the following locations: file:/C:/Users/Admin/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar > Could not find forge.jar (net.minecraftforge:forge:1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f). Searched in the following locations: file:/C:/Users/Admin/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html i got a new message
  10. Hey Guys, i'm trying to setup the mdk for intellij but i'm getting the following error: Could not find net.minecraftforge:forge:1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f. Searched in the following locations: - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.pom - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar - file:/C:/Users/Admin/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.pom - file:/C:/Users/Admin/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar - https://libraries.minecraft.net/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.pom - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f/forge-1.15.2-31.2.5_mapped_snapshot_20200525-1.15.1_at_58f55d53477400d2344e106bc542ed8397c4fe4f.jar Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html any ideas?
  11. Hi Guys, i've tried ~12 hours to understand how to create a own Crafting-System and Recipies for those but i still didn't got it. Are there any helpful tutorials out there which i could read/hear/look to get a better understanding? Greetings Skyriis
  12. So if i add: MinecraftForge.EVENT_BUS.register(this); and change clientSetup to: @SubscribeEvent public void clientSetup(final FMLClientSetupEvent e) { ScreenManager.registerFactory(ContainerList.ALLOY_FURNACE.get(), AlloyFurnaceScreen::new); Ref.LOGGER.debug("Screens Registered"); } it should work? #Edit: after a bit testing this works: @EventBusSubscriber(modid = Ref.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class ScreenHandler { @SubscribeEvent public static void clientSetup(final FMLClientSetupEvent e) { ScreenManager.registerFactory(ContainerList.ALLOY_FURNACE.get(), AlloyFurnaceScreen::new); Ref.LOGGER.debug("Screens Registered"); } } Thanks for the Help!
  13. I thought i'm register my screen here. #edit clientSetup is called from the Mod Constructor using: MinecraftForge.EVENT_BUS.addListener(this::clientSetup); and the container is registered using the DeferredRegistrer class private static final DeferredRegister<ContainerType<?>> CONTAINER_REGISTRY = new DeferredRegister<>(ForgeRegistries.CONTAINERS, Ref.MOD_ID); public static final RegistryObject<ContainerType<AlloyFurnaceContainer>> ALLOY_FURNACE = CONTAINER_REGISTRY.register("alloy_furnace_container", () -> IForgeContainerType.create(AlloyFurnaceContainer::createContainerClientSide)); public static void register() { CONTAINER_REGISTRY.register(FMLJavaModLoadingContext.get().getModEventBus()); Ref.LOGGER.debug("Registered Container."); }
  14. Screen: Block: TileEntity:
  15. Hey Guys, i've created my first tile entity but the screen won't open if i r-click on my block. I'm getting the following warning: [14:28:03] [Render thread/WARN] [minecraft/ScreenManager]: Failed to create screen for menu type: blutmondrpg:alloy_furnace_container ScreenManager Registration: private void clientSetup(final FMLClientSetupEvent e) { ScreenManager.registerFactory(ContainerList.ALLOY_FURNACE.get(), AlloyFurnaceScreen::new); } Container: Any ideas how to fix that?
  16. I've found the duplicate after generating one tag per run. Well i guess this is solved
  17. debug.log (without mapping debug spam cuz the file was too big) : https://pastebin.com/AZsghRud
  18. Not as far as i know. Here are my DataGen Classes: https://pastebin.com/SKW7YNhX https://pastebin.com/YD9r8yzZ https://pastebin.com/7HcH7EuP https://pastebin.com/Fnt2cvB3 Maybe someone else find the duplicate
  19. Hey Guys, i'm trying to generate my Tag-Jsons using the GatherDataEvent and a few classes. But if i run the "runData" preset it crashes. Here is my log: https://pastebin.com/zMCJFYfb Any ideas how to fix that?
  20. i didn't find any pull request related to water physics. As far as i could understand, the water physics are located in the Entity class of minecraft (for example: handleWaterMovement on line #1057). It whould be great if the forge team could add something to create custom fluid physics.
  21. Oh... Okay. Well i guess there is some work for me to do ^^ thanks
  22. No problem, i thought by changing the density and viscosity value of the FluidAttributes it whould work but it still behave like air and not like water. Maybe someone else know how to change that. Meanwhile i'll take a look in the minecraft source codes.
  23. But if i rename the tag file to water, forge thinks the fluid is another type of water. Which is not what i want. It should be a own fluid and only flow players, mobs, items, etc. away like water do
  24. https://pastebin.com/ZZiyuKaT Okay i moved it to this location (.\src\main\resources\data\minecraft\tags\fluids\crystallizer.json)
×
×
  • Create New...

Important Information

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