Jump to content

ratismal

Forge Modder
  • Posts

    28
  • Joined

  • Last visited

Everything posted by ratismal

  1. public BlockRetaw(Fluid fluid, Material material) { super(ModFluids.retaw, materialRetaw, Reference.MODID + ":" + "retaw"); setUnlocalizedName("retaw"); setHardness(1F); setQuantaPerBlock(LEVELS); setTickRate(20); } You've set the name to "retaw". It looks for retaw.json. That file doesn't exist. It returns an error.
  2. With Blender, you would export the model as a OBJ file, and then import it into your game. As for moving around, I can only suggesting looking up some Blender tutorials. However, after doing more research, an OBJ is more for advanced modelling. If you're making a more of a blocky entity, this may be of some interest to you (rendering manually). That tutorial was made for 1.7.10, but it still should be mostly applicable for 1.8.9.
  3. I don't have much experience with modelling entities, but as for modelling software, Blender is a pretty decent free modelling program. I know you can make OBJ files from it, not sure what else or if that's applicable for entities.
  4. ratismal

    Forum Karma

    Hey, I've been lurking around the Modder Support forums, trying the best I can to help others as well as ask my own questions as they come up. However, for my efforts I've ended up with more negative karma than positive. I don't really care who has pressed the smite button on me, it was obviously their opinion that I was being a dick or something and I deserved negative karma. I'm making this thread because I've been wondering if it's possible to figure out which post I received negative karma on, so I know what to avoid doing in the future. If someone could get back to me on this, I'd be very appreciative. Thank you for your time, Ratismal
  5. A Tick is 1/20 of a second. It is the base operation time in Minecraft. Everything the game is updated once a tick. A Handler is something that handles things, usually events. (EventHandler, KeyHandler, etc). Therefore, a TickHandler is a Handler that handles Ticks.
  6. KeyBinding.setKeyBindState(bind.getKeyCode(), false); is used to "depress" the button. Essentially, when you press the button by setting it's state to true, it will remain pressed until something depresses it. For example, if you set the state to true, the act of physically using the button will depress it. Otherwise, you have to set the state to false or the button will remain pressed and will continue to break things. This is why you need the TickHandler. You need it to check if the player is still looking at the block to determine if the block has been broken. When the player is no longer looking at the block, you need to set the state to false or the player will keep digging. This thread may be of interest to you.
  7. Yes, getting the "only break that block" done might take a bit of work. If you don't mind me asking @oznecniV97, what do you need this for? If you're only breaking a single block, it might be easier just to manually hold down left click. If you're trying to make a mod to make mining easier, it would be far easier to just toggle left mouse button on and off yourself and not worry about only breaking a single block.
  8. Ok, I figured out what was wrong with the model. I was using "all" as the variable name for my model, but the game was interpreting me to mean that I wanted to ignore the texture in my model and replace it with my "all" texture. I have fixed this by renaming the variable to "sides". I would still like to know how texture priorities work, if someone would be kind enough to grace me with an answer.
  9. Option B is relatively simple to execute. What I would do is find the KeyBinding of the left click button, and press it. I'm assuming this is the left click KeyBinding: KeyBinding bind = FMLClientHandler.instance().getClient().gameSettings.keyBindAttack; I'm assuming you want to stop once the block is broken. You also have to consider the player looking away from it. I would do a raytrace to see which block the player is looking at, store it's BlockPos, and compare it to the BlockPos the player is currently looking at. I'll let you figure out that part on your own. After, do something like this: KeyBinding bind = FMLClientHandler.instance().getClient().gameSettings.keyBindForward; if (!bind.isKeyDown() ) { //Player is not digging, make them start KeyBinding.setKeyBindState(bind.getKeyCode(), true); else if (oldBlockPos != currentBlockPos) {//Player is no longer looking at the block. Either it has been broken, or they lost interest. KeyBinding.setKeyBindState(bind.getKeyCode(), false); } Keep in mind I haven't tested this, but it should work.
  10. I'd assume you could do a if (blkst.getProperties().containsKey(HINGE)) { // do stuff here } to check if the block has that property. You could also probably make a function like public static boolean hasProperty(IBlockState state, IProperty property) { return state.getProperties().containsKey(property); } and put it in a helper class so you can run it from anywhere.
  11. What's the answer to this? If it's a .jar, you just have to associate .jars with Java again. If it's a .exe, you'll have to do some RegEdit witchcraft like what Mrredstone231 suggested. EDIT: For example, if it's a .jar:
  12. I'm having a little bit of a hard time understanding this sentence. Which of these scenarios are you trying to achieve? a) You press the button. The block instantly breaks, and the pickaxe takes damage. b) You press the button. This causes the player to dig the block until it breaks, like as you would with left clicking. c) Other. Please clarify? EDIT: What Failender mentioned is also very good. You should always be aware of which side you are working on; client or server. Any Minecraft functions are exclusively client side, so calling them on the server will result in a crash. You should avoid using those functions if possible.
  13. Hi, I've been trying to get my block to render the way I want it to, but have been getting nothing but grief. I have the JSON file for the block here (Github). What I want to achieve is this: The block has two Properties in it's BlockState. One to determine what mode the block is on, and the other to determine if the block is visible. The block's texture differs depending on it's mode. Currently, the Properties are changing correctly, and the texture differs correctly based on the mode. The part I'm having difficulties with is the visible part. Initially, I tried to overwrite the MODE textures with a blank texture when VISIBLE was false. However, the MODE textures seem to have some sort of crazy precedence over the VISIBLE textures, and thus the blank texture was never used. Thus, my first question is this: Do certain Properties have priorities over others, and if so how is the priority determined? What I'm now trying to do is to change the block's model based on the VISIBLE property. As seen in the above JSON file, I'm trying to change the model to "blankblock" when VISIBLE is false. "blankblock" has the blank texture hardcoded in, which I had hoped to override the MODE textures. I know that the block does use the "blankblock" model, as I once misspelled the texture path and it gave me an error. However, there is no visual change. Thus, my second question is this: Why doesn't the texture change with the "blankblock" model? The blankblock.json file in question is here (Github). The original basictrigger.json file is here (Github). I would very much appreciate an answer to either of these two questions, as I have been trying to get this to work all night to no avail. I will be glad to provide any additional information. Thank you in advance, Ratismal
  14. Glad you got it working! Don't forget to mark the thread "solved".
  15. Not exactly sure where you're coming from here. Here's EnderIO's blocks: EnderIO's Github Here's PneumaticCraft's blocks: PneumaticCraft's Github Out of the three examples you gave, only Immersive Engineering actually has blocks returning multiple TileEntities. It's definitely possible, but it's not a something that is widely practiced.
  16. Have you looked in the TextureCompass class? (net.minecraft.client.renderer.texture.TextureCompass) It looks promising. It contains an updateCompass function which you pass in coords to where you want the compass to point to.
  17. Unless I'm going insane, that link brings me to a stackoverflow about HTML, CSS, and Javascript. And despite Javascript and Java both having "Java" in their name, they are not the same. Can you verify your link?
  18. This probably isn't the answer you're looking for, but would you consider making a new block for each tileentity? It would prevent mixing up different tileentities types, and also end up with cleaner looking code. I've never actually tried making several blocks from the same class, so I'm not too clear about the benefits of doing so.
  19. Not sure, but there's an easy way to check. Do a console output to see what the meta is. You could also put console outputs in both the onBlockPlacedBy function and the createNewTileEntity functions to see which is called first.
  20. You're trying to cast a TileEntityFissionController to a TileEntityFissionPort. In order to do this, one must extend the other. I'm guessing that both of those classes extend a more generic class, probably something like TileEntityReactorComponent. Thus, the cast is not going to work. This is because of inheritance. What happens is the Controller inherits everything from Component. The Port inherits everything from Component. The Port and the Controller have no relation to eachother. Casting is not possible. You should check if that tileentity is an instanceof TileEntityReactorComponent or TileEntityReactorPort before entering a switch statement that might try to cast one to the other.
  21. I think the easiest way to do this is to essentially "press" the forward button. To do this, you need to get the forward button's KeyBinding. In your onKeyInput listener, after you check if the key is pressed, get the forward button's KeyBinding from the gameSettings class. Check if the forward KeyBinding is pressed, and if it is set it to unpressed. Likewise, if it's not pressed, set it to pressed. For example: public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.keepForward.isPressed()) KeyBinding bind = FMLClientHandler.instance().getClient().gameSettings.keyBindForward; if (bind.isKeyDown()) { //Player is going forwards, make them stop KeyBinding.setKeyBindState(bind.getKeyCode(), false); } else { //Player is not going forwards, make them start KeyBinding.setKeyBindState(bind.getKeyCode(), true); } } }
  22. This. For future reference, adding pause on a new line at the bottom of a bat file will prevent it from closing automatically. There's really no reason for your gradlew commands to be executed from a bat, but knowing that may be helpful in future scenarios.
  23. Hmm. It should, but it wasn't. I'm not sure what would cause that. In any case, I'm just happy that it's working. I'll stop poking it lest it also stops
  24. Thanks! I forgot that player.addChatMessage(...) worked server-side. Just out of curiosity, is there a reason why the update() function isn't consistently called client-side?
  25. You're probably going to want to use a GuiHandler. Here's a base to start off with. public class GuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { /** * Check IDs here, return container **/ return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int { /** * Check IDs here, return GUI **/ return null; } } When you use player.openGui(...), the one of the parameters is an integer ID. In the GuiHandler, you're going to want to check the ID passed in through parameters against a reference GUI ID. This is how the game knows which GUI to open. As a reference, you can check out the source of my mod here. It's for 1.8, but it should still be applicable for 1.7.10 if memory serves correctly.
×
×
  • Create New...

Important Information

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