Jump to content

ChampionAsh5357

Members
  • Posts

    3284
  • Joined

  • Last visited

  • Days Won

    62

Everything posted by ChampionAsh5357

  1. You either do one of two things: you create a json model that contains both the gun and scope combined or you json model holds a parent location to one model and the adds elements to create the other portion of the model.
  2. Depends on which block since most do not have an event when the block is randomly ticked.
  3. Read the source code and notice that there is a event hook from forge called ProjectileImpactEvent#Throwable.
  4. I thought I just explained that using some combination of capabilities and item property overrides. My guess is you haven't read the documentation on either.
  5. Capabilities and Item Property Overrides You would need to use a ISTER (ItemStackTileEntityRenderer) for that. However, it seems pointless since you're not using any data that requires a part of some other existing item or block to render in your scene. Stick to using json models.
  6. You can store variables onto itemstacks by either using nbt data or capabilities. Choose one of the two systems you wish to use and run with it. If the data is correctly synced with the client then you can also use a property override to update the model.
  7. Look at options.txt within the run folder and you will find overrideWidth and overrideHeight. Set these to the values you want I believe.
  8. First, extending an interface is arbitrary the way you are doing it. IRecipeType does not need to be extended and can be just declared a static final variable using IRecipeType#register. Second, IRecipeSerializer needs to be extended on a ForgeRegistryEntry class. The reason I say this is even though you might have already done it is that if you looked at the original class, you can see it extends a basic implementation of a registry. So yes, you do need a RegistryEvent using the old method or could update to using DeferredRegister and RegistryObject.
  9. Break it down. IForgeContainerType#create returns an instance of ContainerType based on its IContainerFactory. IContainerFactory has two create methods. One method contains three variables (the window id, the player inventory, and a packet buffer) while the other one returns the packet buffer as null. Because of this, one of your Container constructors must contain only the window id and player inventory or include the packet buffer as well. Similar to the tile entity, this is the default constructor being used to declare the type and will be updated when called correctly. For myself, I just use a new constructor instance of a container type with diamond syntax to assume the generic and then using a method reference operator on the correct class. Otherwise, you could just simply use the standard interface for your class.
  10. My guess is that you just used the standard Minecraft Teleporter assuming that it works for all dimensions. Note: you can't do that as the teleporter handles logic specifically for teleporting to and from the nether. My knowledge on the matter however is a bit outdated. However, you can verify this by debugging your code at the method you have selected and watch it return null.
  11. You would need to have your own custom implementation of IRecipe. When you are setting the IRecipeType, make sure its the same as the vanilla system you would like to use. From there, you can write your own IRecipeSerializer which is basically just writing a deserializer to read data from a json file. If you want examples, take a look at the item.crafting folder inside the Minecraft source. That should provide plenty of reference on how to execute this.
  12. No, I replicated the same process and it works fine. The item that you chose may not be the honey bottle, or you're call of the registry is not on both the client and server.
  13. I would recommend looking at BrewingRecipeRegistry#addRecipe.
  14. If you're talking about within the GUI, you just create another rectangle with the overlay texture that changes based on how much fluid is in the tank.
  15. If it's a client side mod, it will only appear for the client the mod is downloaded on.
  16. TranslationTextComponent, Item#onItemUseFinish
  17. It has its own custom properties that are unique to that block.
  18. It makes no sense if the block is an extension of OreBlock. That's coded for the sole purpose of programming all ores into a single class. Most mods just use a standard Block instance or have their own single class handler for ores.
  19. That should work fine
  20. Assuming you are checking the values on the logical client side, get the current instance of Minecraft running (if the event doesn't support it use Minecraft#getInstance) and then call GameSettings#keyBindLeft or GameSettings#keyBindRight from the instance within Minecraft.
  21. You do realize you have to create your own optional dependency for every mod you want to add support for? Minecraft you can just check if the block is an instance of OreBlock. However, every other mod you would need to check individually as there is likely no centralization.
  22. Why would this override vanilla keybinds? You are calling a method from those already declared KeyBindings to see if that KeyBinding is pressed.
  23. That would make sense as they are the same value. It doesn't always return null. It will do this when the world and/or chunk initially loads since the logical client doesn't exist until it is loaded on the server. However, after the initial startup it should be on both logical sides. I haven't tested it as much so I'm not completely sure this is the case all the time.
  24. Combine the two models into a single model. Create some parameter that checks whether the entity is moving. A simple DataParameter<Boolean> should do the trick nicely. You could also check the velocity of the entity depending on if the entity Set the value to true whenever the entity is moving and false when it is not. Override preRenderCallBack in your EntityRenderer and have your ModelRenderer#showModel value switch whenever the player is moving or not. You should probably keep a cached value inside the renderer so that you do not call the change every frame as that would be redundant.
  25. Assuming you mean when the player strafes left and right, there are KeyBinding for those values in GameSettings. If not, create KeyBindings for those values. That's probably the easiest way as KeyBinding has a boolean method that checks if the key is down (for continuous querying) for if the key is pressed (for the initial press of the key). Also, whenever you handle any input from the keyboard, there should be a KeyBinding assuming that its a feature within the modification you are creating.
×
×
  • Create New...

Important Information

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