
MCRaichu
Members-
Posts
63 -
Joined
-
Last visited
Everything posted by MCRaichu
-
Matthew 7:7 "Ask and it will be given to you" Block Class Gui Handler Container Class GuiContainer
-
Matthew 7:7 "Ask and it will be given to you" Block Class Gui Handler Container Class GuiContainer
-
Hi, I have create a custom crafting table (following TheGreyGhost's tutorial) and now I have the problem that my gui is not drawn. This problem generated two questions: [*]Is it neccesary to have a TileEntity? Looking at the Workbench it is only a Block and the Container is holding the inventory for crafting and result. [*]The drawGuiContainerForegroundLayer() and drawGuiContainerBackgroundLayer() are never executed, but GuiHandler works fine and returns a Gui (client side). Any idea why? Thanks in advance, McRaichu Turorial: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe31_inventory_furnace
-
thanks for the reply, i don't have any negative uv coordinates and they are in the right range. And nothing in the logs. Does the loader require triangles or quads? the forge test on github has quads but i think it would crash before loading if it wasn't possible to use triangles.
-
Hi, I created a model using blender and it works fine (model is in the game), but the texture mapping is off. Are there any restrictions or other things i have to make sure before exporting? Regards, McRaichu
-
Hi, I created a flying mob which is rideable. I can mount and fly horizontal but now I want to do the vertical movement too and I can't figure out how. Basically I want the same movement as in creative. My current idea is using to keyinputevent and send a packet to the server to set the corresponding motion. But in my opinion this isn't the best solution. If anyone has another idea or knows that a good solution already exists I would really appreciate it.
-
I looked at the iron golem but couldn't figure out what is used. Thanks.
-
Hi, I'm trying to render a mob differently while it is attacking. But since the combat AI is executed at the server (the attackTarget is only set there), what would be the best way to synchronize them? I know datawatcher is an option but when i tried it was totally out of sync.
-
Bump and update: Inside the BlockStateLoader.load function the variants get parsed corret. but any parameter of the variants other than model (e.g. texture) is not used. the only thing comming to my mind is, that something is different within the b3d models. i downloaded the chest.b3d from https://github.com/MinecraftForge/MinecraftForge/tree/master/src/test/resources/assets/forgedebugmodelloaderregistry/models/block and if I use it I get circular depndecies and outofmemory exceptions.
-
Thanks, I found the B3DLoader class. But it can't find the source of my problem. I went from the B3DLoader to ModelLoader to WeightedRandomModel(Variants variants). And here, when creating my inventory variant the TRSRTransformation is only an identity matrix.... meaning no transformation applied. And i don't understand why. I checked other threads and they have the same stuff in their json files and it works.
-
[SOLVED][1.7.10] TileEntity under water is surrounded by a bubble?!
MCRaichu replied to Frag's topic in Modder Support
Second question first: simply do myBlock extends TileEntity. no need to always extend BlockContainer. First question: Block has following methods I think the passable is check inside water. try making you own material and override isSolid() and blocksMovement(), both returning false; This is just an idea and I'm using 1.8. -
[1.8] Check if player is looking at the moon, whilst holding an item
MCRaichu replied to DARKHAWX's topic in Modder Support
As far as i know the sun and moon are rendered based on the player position going from east to west meaning the x-Axis. therefore i would try the following: get the Look vector lets call him lv = player.getLook(1.0F); (length is 1) now check if the z coordinate is close to 0 (by a chosen threshold you have to find out, maybe 0.1) meaning the player is looking east or west. if that's true. set lv.z to 0 and create a vec3 x = new Vec3(1,0,0) basically the x-Axis. With lv.dotproduct(x) you get the angle the player is looking up or down (in respect to the x-Axis). compare it the CelestialAngle (check with threshold, again) and TADA you are looking at the moon. small hint: i don't know how the CelestialAngle is measured so this is only the basic idea i had after reading your question. it will be a lot of trial and error. For the line of sight, check OpenModularTurret on github. awesome coding-style, easy to read and helped me to write my own. https://github.com/OpenModularTurretsTeam/OpenModularTurrets/blob/master/src/main/java/openmodularturrets/util/TurretHeadUtil.java -
bump. and another question: what forge class is responsible for parsing the json files? i would like to check what the parser is looking for.
-
Hi, I have a problem with a b3d model. everything works great except that the transformation in the .json file don't work. Does anyone have an idea why? Here my .json file { "forge_marker": 1, "defaults": { "textures": { "texture": "ool:blocks/refinery.png" }, "model": "ool:refinery.b3d" }, "variants": { "normal": [{ "transform": { "translation": [ 0, 10.0, 0], "scale": 0.5 } }], "inventory": [{ "transform": { "firstperson": { "rotation": [ 0, 0, 0], "translation": [ 3, 10.0, 0.0], "scale": 1.0 }, "thirdperson": { "rotation": [ 0, 0, 180 ], "translation": [ 3, 10.0, 0.0], "scale": 0.35 }, "gui": { "scale": 1.0 } } }], "status": { "on": {"model": "ool:refinery.b3d", "texture": "ool:blocks/refinery.png"}, "off": {"model": "ool:refinery.b3d", "texture": "ool:blocks/refinery.png"} } } }
-
[1.8] Get TileEntities within a boundingbox [SOLVED]
MCRaichu replied to MCRaichu's topic in Modder Support
I currently facing the problem that it is called from WorldServer which extends World and i get IllegalAccessExc. when invoking. But using WorldServer as class of getDeclaredMethod it throws a NoSuchMethodException. EDIT: forget it. works. well except the tileentitymaps from the chunks appear empty.... EDIT 2: had a mistake at my tileentities. they didn't exist. so everything works. thanks diesieben -
[1.8] Get TileEntities within a boundingbox [SOLVED]
MCRaichu replied to MCRaichu's topic in Modder Support
Since I have never done reflection, could you help me a bit? the oracle reference is not very helpful. Here my code so far (not tested): public static List getTileEntitiesWithinAABB(World world, Class tileEntityClass, AxisAlignedBB aabb) { int i = MathHelper.floor_double((aabb.minX - MAX_ENTITY_RADIUS) / 16.0D); int j = MathHelper.floor_double((aabb.maxX + MAX_ENTITY_RADIUS) / 16.0D); int k = MathHelper.floor_double((aabb.minZ - MAX_ENTITY_RADIUS) / 16.0D); int l = MathHelper.floor_double((aabb.maxZ + MAX_ENTITY_RADIUS) / 16.0D); ArrayList arraylist = Lists.newArrayList(); for (int i1 = i; i1 <= j; ++i1) { for (int j1 = k; j1 <= l; ++j1) { boolean chunkLoaded = false; try { //isChunkLoaded(i1, j1, true) Method method = world.getClass().getMethod("isChunkLoaded", int.class,int.class,boolean.class); chunkLoaded = (Boolean) method.invoke(world, i1, j1, true); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(chunkLoaded) { Iterator iterator = world.getChunkFromChunkCoords(i1, j1).getTileEntityMap().values().iterator(); while (iterator.hasNext()) { TileEntity te = (TileEntity)iterator.next(); if(tileEntityClass.isInstance(te)) { if (te.getRenderBoundingBox().intersectsWith(aabb)) { arraylist.add(te); } } } } } } return arraylist; } -
[1.8] Get TileEntities within a boundingbox [SOLVED]
MCRaichu replied to MCRaichu's topic in Modder Support
Figured. It is basically copying the entity method but certain things bother me. For example: getEntitiesWithinAABB does a isChunkLoaded check, but since its protected i can't call it. can i ignore it since my entity (the one searching) is only loaded when the chunk is loaded? -
Hi, I'm trying to detect all TileEntities within a certain radius. I've been looking but it seems there is no method to do that. Basically what I'm looking for is getEntitiesWithinAABB from World but for TileEntities. If no method exists I will write my own but would be nice to save the effort. Regards, McRaichu
-
Hi, I get following error when loading a .b3d model. I can't figure out what is wrong. I checked other posts but coulnd't find anything related. java.lang.RuntimeException: No base model or submodel provided for this MultiModel.Baked. at net.minecraftforge.client.model.MultiModel$Baked.<init>(MultiModel.java:50) at net.minecraftforge.client.model.MultiModel.bake(MultiModel.java:196) at net.minecraftforge.client.model.ModelLoader$WeightedPartWrapper.bake(ModelLoader.java:393) at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.bake(ModelLoader.java:458) at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:122) at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:29) at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:130) at net.minecraft.client.Minecraft.startGame(Minecraft.java:512) Here my setup: tiberium.json { "forge_marker": 1, "defaults": { "textures": { "all": "ool:textures/blocks/tiberium.png" }, "model": "ool:tiberium.b3d" }, "variants": { "normal": [{ "transform": { "rotation": [{"y": 45}] } }], "inventory": [{ "transform": { "firstperson": { "translation": [0, -0.2, 0.15] }, "thirdperson": { "translation": [0, -0.05, 0.025], "scale": [0.45, 0.45, 0.45] }, "gui": { "translation": [0, 0.04, 0], "scale": [0.7, 0.7, 0.7] } } }] } } My preInit: itemTiberium = Item.getItemFromBlock(StartupCommon.tiberium); B3DLoader.instance.addDomain(Reference.MODID); ModelLoader.setCustomModelResourceLocation(itemTiberium, 0, new ModelResourceLocation(Reference.MODID + ":" + Tiberium.unl_name, "inventory")); EDIT: solved, error had nothing to do with b3d. called wrong init-method.
-
Hi, I created a rocket (Throwabel) with custom renderer and everthing works fine. But the rendered rocket stays where it is spawned. The server side rocket actually moves and explodes on impact but the client side doesn't. I used to debugger to check and for some reason the fields motionX,motionY,.motionZ are not set on the client side. Therefore it doesn't move. Any idea what I'm doing wrong. Register Entity and Renderer: int entityID = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerModEntity(NodRocket.class, Reference.MODID+".NodRocket", entityID, mod , 64, 20, false); RenderingRegistry.registerEntityRenderingHandler(NodRocket.class, new NodRocketRenderer(Minecraft.getMinecraft().getRenderManager())); Spawning the rocket: if(aimed){ if(!this.worldObj.isRemote){ NodRocket projectile = new NodRocket(this.getWorld(), false, target); //EntitySnowball projectile = new EntitySnowball(this.worldObj); projectile.setPosition(sourceVec.xCoord,sourceVec.yCoord,sourceVec.zCoord); Vec3 d0 = targetVec.subtract(sourceVec); projectile.setThrowableHeading(d0.xCoord,d0.yCoord,d0.zCoord,0.6f,0.00f); this.worldObj.spawnEntityInWorld(projectile); } } The Rocket class itself
-
Can you explain what you mean with ordering of the code?
-
Hi, i have a small problem with my TileEntitySpecialRenderer. Depending on how I look at the block, it switches between very bright and very dark. Any ideas? GL11.glPushMatrix(); GlStateManager.translate(relativeX + centreOffsetX, relativeY + centreOffsetY, relativeZ + centreOffsetZ); GlStateManager.scale(SCALE_FACTOR, SCALE_FACTOR, SCALE_FACTOR); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); this.bindTexture(nodTurretBaseTexture); // texture worldrenderer.startDrawingQuads(); addBaseVertices(worldrenderer); tessellator.draw(); GL11.glPopMatrix(); EDIT: I found out it has something to do with the item rendering. the switch depends on the lighting of the item I'm holding and RenderHelper.disableStandardItemLighting(); turns it dark all the time. Does anyone know why the item affects the block?
-
I looked at the door but since I only have one block with a high model, would it make sense to seperate the model and create multiple blocks or should i use invisble blocks like in the tutorial linked?
-
Hi, what is the best way to create a bounding box for a model bigger than one block. For example, I have a block with a TileEntitySpecialRenderer creating a model of 1x3 (width x height). How can I set the according boundaries. I looked at the tutorial about Multiple blocks structure and the usage of gag-blocks http://www.minecraftforge.net/wiki/Multiple_blocks_structures, but i also read about the method addCollisionBoxesToList(). In the case of the later one i would need some explanation on how it is working and how to set the bounding box correctly and if it is even useful for my case. Regards, McRaichu
-
I solved it. My antivirus somehow consideres the project a thread and created a sandbox ...