Jump to content

ChampionAsh5357

Members
  • Posts

    3284
  • Joined

  • Last visited

  • Days Won

    62

Everything posted by ChampionAsh5357

  1. Fun fact: that method is used inside of a different method that encompasses all mobs to see if they can spawn. The method is called MobEntity#canSpawn.
  2. Actually, the problem I described is wrong, so apologies. I missed a single line of code. First, the actual problem is that your global variable of your tile entity is not initialized since you decided to make a local variable in your constructor instead (lines 28 and 34). For your method, my understanding is that you should not mix methods outside the realm of the reference holder with the variables inside. You can, but it might lead to a problem later on when dealing with some client server syncing. I'm not sure, but I just tend to avoid it. Second, calling that method inside your tileentity class is just redundant when you are already literally in your instance of a tileentity. You can literally pass in your tileentity by simply using 'this' instead of passing in two variables you only use once.
  3. You know it tells you your error. Your tile entity is throwing a null value on the server at a specific line in a specific class. I think you should write your get method for the reference holder correctly. You also realize this is completely redundant. Why are you getting the current tile entity in the container from the world rather than passing in the tile entity? These two should tell you exactly how to solve your problem.
  4. 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.
  5. Depends on which block since most do not have an event when the block is randomly ticked.
  6. Read the source code and notice that there is a event hook from forge called ProjectileImpactEvent#Throwable.
  7. 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.
  8. 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.
  9. 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.
  10. Look at options.txt within the run folder and you will find overrideWidth and overrideHeight. Set these to the values you want I believe.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. I would recommend looking at BrewingRecipeRegistry#addRecipe.
  17. 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.
  18. If it's a client side mod, it will only appear for the client the mod is downloaded on.
  19. It has its own custom properties that are unique to that block.
  20. 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.
  21. 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.
  22. 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.
  23. Why would this override vanilla keybinds? You are calling a method from those already declared KeyBindings to see if that KeyBinding is pressed.
×
×
  • Create New...

Important Information

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