Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

jun2040

Members
  • Posts

    64
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jun2040's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. I still can't fix it. Here's my whole mod: https://github.com/jun2040/unixmod
  2. @RaphGamingz I did that but this time whenever I right click the block it says [16:35:22] [Client thread/WARN] [minecraft/ScreenManager]: Failed to create screen for menu type: unixmod:bioreactor
  3. Oops Sorry. I was really sleepy last night. Correct code: package com.jun2040.unixmod.blocks; import com.jun2040.unixmod.items.ModItems; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IWorldPosCallable; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; import net.minecraftforge.items.wrapper.InvWrapper; import static com.jun2040.unixmod.blocks.ModBlocks.BIOREACTOR_CONTAINER; public class BioreactorContainer extends Container { private TileEntity tileEntity; private PlayerEntity playerEntity; private IItemHandler playerInventory; public BioreactorContainer(int windowId, World world, BlockPos pos, PlayerInventory playerInventory, PlayerEntity player) { super(BIOREACTOR_CONTAINER, windowId); TileEntity tileEntity = world.getTileEntity(pos); this.playerEntity = player; this.playerInventory = new InvWrapper(playerInventory); tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { addSlot(new SlotItemHandler(h, 0, 64, 24)); }); layoutPlayerInventorySlots(10, 70); } @Override public boolean canInteractWith(PlayerEntity playerIn) { return isWithinUsableDistance(IWorldPosCallable.of(tileEntity.getWorld(), tileEntity.getPos()), playerEntity, ModBlocks.BIOREACTOR); } private int addSlotRange(IItemHandler handler, int index, int x, int y, int amount, int dx) { for (int i = 0 ; i < amount ; i++) { addSlot(new SlotItemHandler(handler, index, x, y)); x += dx; index++; } return index; } private int addSlotBox(IItemHandler handler, int index, int x, int y, int horAmount, int dx, int verAmount, int dy) { for (int j = 0 ; j < verAmount ; j++) { index = addSlotRange(handler, index, x, y, horAmount, dx); y += dy; } return index; } private void layoutPlayerInventorySlots(int leftCol, int topRow) { // Player inventory addSlotBox(playerInventory, 9, leftCol, topRow, 9, 18, 3, 18); // Hotbar topRow += 58; addSlotRange(playerInventory, 0, leftCol, topRow, 9, 18); } }
  4. I'm trying to make a block that has a gui but every time I activate it, my game just crashes. Code: package com.jun2040.unixmod.blocks; import com.jun2040.unixmod.UnixMod; import com.mojang.blaze3d.platform.GlStateManager; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; public class BioreactorScreen extends ContainerScreen<BioreactorContainer> { private ResourceLocation GUI = new ResourceLocation(UnixMod.MODID, "textures/gui/bioreactor.png"); public BioreactorScreen(BioreactorContainer container, PlayerInventory inv, ITextComponent name) { super(container, inv, name); } @Override public void render(int mouseX, int mouseY, float partialTicks) { this.renderBackground(); super.render(mouseX, mouseY, partialTicks); this.renderHoveredToolTip(mouseX, mouseY); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.minecraft.getTextureManager().bindTexture(GUI); int relX = (this.width - this.xSize) / 2; int relY = (this.height - this.ySize) / 2; this.blit(relX, relY, 0, 0, this.xSize, this.ySize); } } Error: ---- Minecraft Crash Report ---- // I bet Cylons wouldn't have this problem. Time: 12/12/19 11:18 PM Description: Ticking entity java.lang.NullPointerException: Ticking entity at com.jun2040.unixmod.blocks.BioreactorContainer.canInteractWith(BioreactorContainer.java:38) ~[?:?] {re:classloading} at net.minecraft.entity.player.ServerPlayerEntity.tick(ServerPlayerEntity.java:338) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.updateEntity(ServerWorld.java:602) ~[?:?] {re:classloading} at net.minecraft.world.World.func_217390_a(World.java:736) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:397) ~[?:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:800) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646) [?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace: at com.jun2040.unixmod.blocks.BioreactorContainer.canInteractWith(BioreactorContainer.java:38) at net.minecraft.entity.player.ServerPlayerEntity.tick(ServerPlayerEntity.java:338) at net.minecraft.world.server.ServerWorld.updateEntity(ServerWorld.java:602) -- Entity being ticked -- Details: Entity Type: minecraft:player (net.minecraft.entity.player.ServerPlayerEntity) Entity ID: 126 Entity Name: Dev Entity's Exact location: -149.92, 22.00, -45.12 Entity's Block location: World: (-150,22,-46), Chunk: (at 10,1,2 in -10,-3; contains blocks -160,0,-48 to -145,255,-33), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Entity's Momentum: 0.00, -0.08, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.world.World.func_217390_a(World.java:736) at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:397) -- Affected level -- Details: All players: 1 total; [ServerPlayerEntity['Dev'/126, l='mod test', x=-149.92, y=22.00, z=-45.12]] Chunk stats: ServerChunkCache: 2246 Level dimension: DimensionType{minecraft:overworld} Level name: mod test Level seed: -2385347844768643725 Level generator: ID 01 - flat, ver 0. Features enabled: true Level generator options: {biome:"minecraft:plains",layers:[{block:"minecraft:bedrock",height:1b},{block:"minecraft:dirt",height:20b},{block:"minecraft:grass_block",height:1b}],structures:{village:{}}} Level spawn location: World: (-176,22,-112), Chunk: (at 0,1,0 in -11,-7; contains blocks -176,0,-112 to -161,255,-97), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 54794 game time, 3461 day time Level storage version: 0x04ABD - Anvil Level weather: Rain time: 36009 (now: false), thunder time: 52923 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:865) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:800) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646) at java.lang.Thread.run(Thread.java:748) -- System Details -- Details: Minecraft Version: 1.14.4 Minecraft Version ID: 1.14.4 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_202, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 535933160 bytes (511 MB) / 2076704768 bytes (1980 MB) up to 3771203584 bytes (3596 MB) CPUs: 12 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 4.1.0+62+5bfa59b ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /eventbus-1.0.0-service.jar eventbus PLUGINSERVICE /forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-1.0.1-milestone.0.1+94458e7-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-launcher.jar runtimedistcleaner PLUGINSERVICE /forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-launcher.jar fml TRANSFORMATIONSERVICE FML: 28.1 Forge: net.minecraftforge:28.1.87 FML Language Providers: javafml@28.1 minecraft@1 Mod List: client-extra.jar Minecraft {minecraft@1.14.4 DONE} main UnixMod {unixmod@0.1 DONE} forge-1.14.4-28.1.87_mapped_snapshot_20191111-1.14.3-recomp.jar Forge {forge@28.1.87 DONE} Player Count: 1 / 8; [ServerPlayerEntity['Dev'/126, l='mod test', x=-149.92, y=22.00, z=-45.12]] Data Packs: vanilla, mod:unixmod, mod:forge Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'forge'
  5. What is Compound NBT and when do I use it? Also, how do I use it?
  6. Is copy-pasting the entire code the only way to bake multiple models? This is the code: try { IUnbakedModel model = ModelLoaderRegistry.getModelOrLogError(new ResourceLocation("toomanyores:block/water_wheel.obj"), "Missing water wheel model"); if (model instanceof OBJModel) { IBakedModel bakedModel = model.bake(event.getModelLoader(), ModelLoader.defaultTextureGetter(), new BasicState(model.getDefaultState(), true), DefaultVertexFormats.BLOCK); IBakedModel bakedInvModel = model.bake(event.getModelLoader(), ModelLoader.defaultTextureGetter(), new BasicState(model.getDefaultState(), true), DefaultVertexFormats.ITEM); bakedInvModel = new PerspectiveMapWrapper(bakedInvModel, BLOCK_TRANSFORMS); event.getModelRegistry().put(new ModelResourceLocation("toomanyores:waterwheel", ""), bakedModel); event.getModelRegistry().put(new ModelResourceLocation("toomanyores:waterwheel", "inventory"), bakedInvModel); } Do I have to copy this code and paste it to bake new models?
  7. I've been searching for animating block models for obj but all I find is for json blocks. Is it possible with obj models? If it is, how do I do it? I also want the animation to be for the models, not the textures.
  8. I did that and it doesn't work. It seems like the objLoader is not trying to find .obj. Its searching for the json file. [09:50:30] [Server-Worker-6/WARN] [minecraft/ModelBakery]: Unable to load model: 'unixmod:block/fabricator.obj' referenced from: unixmod:fabricator#: java.io.FileNotFoundException: unixmod:models/block/fabricator.obj.json [09:50:31] [Server-Worker-6/WARN] [minecraft/ModelBakery]: Unable to load model: 'unixmod:fabricator#inventory' referenced from: unixmod:fabricator#inventory: java.io.FileNotFoundException: unixmod:models/item/fabricator.json
  9. @Yanny7 I am using TextureStitchEvent.Pre but it's not working. The lighting works now tho. Thanks.
  10. @Yanny7 My textures not working... And I got this glitch(?) thing going on with my block.
  11. Um. I meant I commented that out and fixed that. I uncommented it. But the textures are still dark and there's this weird thing going on with my block and things beside the block. Do you know how to register multiple models on onModelBakeEvent()?
  12. @TheMikeste1 I created the model.json for my block and the block doesn't seem to render the model for some reason. I also got some problems with the item. here's my github: https://github.com/jun2040/unixmod Edit: I commented out the model registries thing... The model works now but the item's not working and the model's texture is too dark.
  13. I've been fiddling with OBJLoader for a week now and I keep getting the unable to load model error. I think the OBJLoader is not called properly because I used the tutorial from older versions. does anyone know how to call OBJLoader.INSTANCE.addDomain properly?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.