
Swingdude
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by Swingdude
-
[1.9] (SOLVED) Custom Block working fine but not textured in Inventory
Swingdude replied to EM3R50N's topic in Modder Support
item.getRegistryName returns a string I believe. In addition, it returns it in the format modid:itemName. Or you could use a name that you set in the constructor and then add the modId in that code. It is trying to find a model at modid:modid:itemName, which doesn't exist. -
Thanks. Seems odd it wouldn't be included, seeming as the old version did include it.
-
it seems that calling Item.getItemFromBlock returns null for any modded block. It is being called outside of the main class, so that might influence it. I register my blocks like this: b.setRegistryName(name); GameRegistry.register(b); Am i missing anything?
-
Look at this block: if (blockPos.getY() >= this.worldObj.getSeaLevel() || this.worldObj.canSeeSky(blockPos)) { return false; } This will ONLY spawn your mob BELOW 63 (unless you have customized it). Your debug message will print no matter if it can spawn or not because it is unconditional. Try adding a debug message inside this block: else { boolean canSpawn = super.getCanSpawnHere(); if(canSpawn) { System.out.println("Spawned at " + blockPos.getX() + " " + blockPos.getY() + " " + blockPos.getZ()); } return canSpawn; } Print canSpawn. Are you getting the message that says it spawned or the one about it trying to spawn? If none of this works, I'm not sure.
-
I forgot: At least for BlockContainers, you must override getRenderType() (I believe that's the method). I am using 1.9 right now, so I don't know what you should return (I believe it's an int), but I had the same problem with one of my models. For some reason, BlockContainers are invisible by default. EDIT: Might want to change the int and see what happens. Didn't see you had it. EDIT 2: Change it to 3.
-
It renders in your hand as it's supposed to? Maybe try unhooking (don't delete!) the TESR and see how it renders. If it renders in your hand normally, it would be something with the block render (TESR most likely)
-
What does the block currently look like in game? Are there any errors in the log about the json files?
-
What is your block name, and what are the names of the json files? From what I have found, the json file has to have the exact same name as the block.
-
Here is some relevant code from EntityList: Class <? extends Entity > oclass = (Class)stringToClassMapping.get(entityName); if (oclass != null) { entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); } It's looking for a constructor in your RenderObsidianGolem class that uses a world. It seems to be looking there instead of your entity class. It's looking there because you tell it to look there when you register the mob (code from ModEntities.init()): public static void init() { registerModEntityWithEgg(RenderGolemObsidian.class, "golemObsidian", 0x3F5505, 0x4E6414); } registerModEntityWithEgg(RenderGolemObsidian.class, "golemObsidian", 0x3F5505, 0x4E6414); RenderGolemObsidian.class So it is trying to initialize your render class as an entity.
-
It doesn't seem like you are actually rendering anything in the TESR. You are binding a texture, but not rendering anything. I could be mistaken, but in 1.7.10 you would have to get the model and then bind the texture and render it. You might not need a TESR, though. What do you want the block to look like, and can you post the JSONs?
-
[SOLVED][1.9] Changing block's collision box
Swingdude replied to Charanor's topic in Modder Support
Look at how the cauldron does it. Essentially, getBoundingBox() refers to what you can get in your outline. Think of stairs. You can point your crosshair above the stair and still get the black outline. The bounding box is FULL_BLOCK_AABB (use that) To have custom hitboxes (what you collide with), addCollisionBoxToList should be useful. Just override it and put in your custom hitboxes. They use local coordinates, so 0,0,0 is a corner and 1,1,1 is the opposite. -
So you are saying that when you right click at all with an item, it will act as if you held it down for one second? You could try setting a a counter that starts at 0 and increments by one every time Item#onUpdate is called. If the counter is less than 20, then call whatever method you are using to handle the right click action.
-
[UNSOLVED] [1.9] Having trouble with custom biomes
Swingdude replied to Swingdude's topic in Modder Support
I updated my forge version, and yet, it seems the problem has not gone away. All of the system outputs seems to have put out the same info. -
[UNSOLVED] [1.9] Having trouble with custom biomes
Swingdude replied to Swingdude's topic in Modder Support
Is this a problem with forge? I wonder... -
[UNSOLVED] [1.9] Having trouble with custom biomes
Swingdude replied to Swingdude's topic in Modder Support
Can anyone help? Any help is appreciated! -
I'm in the same boat. For simple blocks and items, wuppy29 has a good, simple json generator. The models changed slightly in 1.9, though, so where you see "builtin" you have to change it to "item" or "block" depending on if it is an item or block. For multi-texture blocks, TheGreyGhost has a working example called "Minecraft by Example." mbe_01 is a simple, multi-textured block. Here is the link: https://github.com/TheGreyGhost/MinecraftByExample. As for custom models, I got the OBJ Loader semi-working (it doesn't support some commands yet, which is screwing with my textures), but I don't know much about anything else. Forge has a debug class which can give you the general idea: https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java and assets: https://github.com/MinecraftForge/MinecraftForge/tree/master/src/test/resources/assets/forgedebugmodelloaderregistry I have not yet updated my tile entities, so I do not know how to update it. A tutorial from 1.8 might give you some pointers.
-
Hello there, I have recently updated from 1.7.10 (I figured that being two versions behind would not be good.) However, my biome (which was working back in 1.7.10) has broken with the update. I iterated through using the Iterator in the biome registry and outputted the results into the log, however, it seems that my biome is not there. I used getIdByBiome on my biome, and it returned 0, so I suspect I messed up registering it. Here is my code for registration: BiomeManager.addSpawnBiome(cosmicBiome); BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(cosmicBiome, 100)); The weight is made high so I don't have to travel far to find my biome. Here is the declaration code: cosmicBiome = new NormalBiome((new BiomeProperties("cosmicBiome").setBaseHeight(0.1f).setHeightVariation(0.4f)), "cosmicBiome", cosmicDirt, cosmicGrass); NormalBiome is a class I made that passes in the name and BiomeProperties and uses the last two arguments as the filler and top blocks. Any help is appreciated. Thanks EDIT: I am using version 12.16.0.1813 (the latest as of March 29 at 8:48 PM EST)
-
[1.7.10] UV map proportions are really weird
Swingdude replied to Silly511's topic in Modder Support
Are they on top of each other? If so, you need to select all and unwrap. If you marked a seam by accident, make sure you remove it. Maybe upload a picture to imgur and post it here. -
No problem. It's happened to me before, both the texture being messed up and looking for hours with the answer being simple.
-
[SOLVED] [1.7.10] Wrong tile entity updating
Swingdude replied to Swingdude's topic in Modder Support
Wow. I can't believe I missed that. Thanks. -
What does your BLOOD_SPHERE_TEXTURE look like? It's possible that the uv layout could be incorrect. Personally, I prefer to draw the model in a program like Blender and import that and its uv layout to the mod, but whatever you feel comfortable with is fine.
-
[1.7.10] [SOLVED] How to make a block that is not 1x1x1?
Swingdude replied to kauan99's topic in Modder Support
Block#setBlockBounds will work for this case. The coords given are local coordinates. It does what it says, however, which means that it only changes the collision box. I would suggest looking at modeling for a physically smaller block. -
Hello, I am creating a custom model in my mod, a telescope. When someone right-clicks it, the telescope should spin around to face away from the user. When only one telescope is in the world, it works fine. However, once more than one telescope is in the world, only the first telescope spins, not the one right-clicked. I have tested it, and it works fine with one telescope. I have a feeling it is something quite obvious that I have been missing. The code is a bit messy, but that is because I have tried so many things. A debug message I wrote that printed the coordinates of the tile entity outputted the wrong coordinates, aka the telescope that is rotating. I think it is a problem with the TileEntity in the renderTileEntityAt Telescope.java: package mod.galaxy.block.telescope; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class Telescope extends BlockContainer{ TileEntityTelescope temb; public Telescope (Material material, CreativeTabs tab) { super(material); setCreativeTab(tab); } @Override public boolean renderAsNormalBlock(){ return false; } @Override public int getRenderType(){ return -1; } @Override public boolean isOpaqueCube(){ return false; } @Override public boolean shouldSideBeRendered(IBlockAccess i, int x, int y, int z, int side){ return false; } @Override public TileEntity createNewTileEntity(World world, int par2) { return temb = new TileEntityTelescope(); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p, int par6, float par7, float par8, float par9){ temb.setFinalRot((360 - Math.round(p.rotationYaw)) % 360); openGui(p); return true; } public void openGui(EntityPlayer p){ } } TileEntityTelescope.java: package mod.galaxy.block.telescope; import java.util.Timer; import java.util.concurrent.TimeUnit; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class TileEntityTelescope extends TileEntity { /* Rotation */ float rotation = 0f; float finalRot = 0f; /* Scale */ public float scale = 0.35f; @Override public void updateEntity(){ if (worldObj.isRemote) { for(int i = 0; i < 5; i++){ if(rotation < finalRot) rotation += 1; else if(rotation > finalRot) rotation -= 1; } } } public void setFinalRot(int i){ finalRot = i; } public float getCurrentRotation(){ return rotation; } } RenderTileEntityTelescope.java: package mod.galaxy.block.telescope; import org.lwjgl.opengl.GL11; import mod.galaxy.Galaxy; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; public class RenderTileEntityTelescope extends TileEntitySpecialRenderer { ResourceLocation texture; ResourceLocation objModelLocation; IModelCustom model; TileEntityTelescope te; public RenderTileEntityTelescope(int tier){ texture = new ResourceLocation(Galaxy.MODID, "textures/models/TelescopeTier" + tier + ".png"); objModelLocation = new ResourceLocation(Galaxy.MODID, "models/TelescopeTier" + tier + ".obj"); model = AdvancedModelLoader.loadModel(objModelLocation); } @Override public void renderTileEntityAt(TileEntity p_147500_1_, double posX, double posY,double posZ, float p_147500_8_) { te = (TileEntityTelescope) p_147500_1_; if(te.rotation != te.finalRot) System.out.println(te.xCoord + " " + te.yCoord + " " + te.zCoord + " " + te.getWorldObj().getBlock(te.xCoord, te.yCoord, te.zCoord)); float scale = te.scale; float rotation = te.getCurrentRotation(); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glTranslated(posX + 0.5, posY + 0.01, posZ + 0.5); GL11.glScalef(scale, scale, scale); GL11.glRotatef(rotation, 0, 1, 0); GL11.glPushMatrix(); model.renderAll(); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Any help at all would be appreciated. A screenshot of the problem, in which the telescope that is rotated is obviously not the one that my cursor is on, can be found at http://imgur.com/68ho2ZA. Sorry if I posted this in the wrong section and thank you!