Jump to content

GenElectrovise

Members
  • Posts

    132
  • Joined

  • Last visited

Posts posted by GenElectrovise

  1. Ok, so I'm at the stage of mod testing when I have to try running it in the launcher (and later on a dedicated server) to ensure compatability.

    Everything works apart from my custom glyph system, which can't find the files (FileNotFoundException).

     

    In my IDE, I use a formatted version of "../src/main/resources/assets/magiksmostevile/" to escape the running directory, then plunge into the mod resources to find the file on the path (appended to the end of that).

    I should have realised this wouldn't work from the launcher.

     

    It tries to access:

    "C:\User\AppData\Roaming\.minecraft\..\src\main\resources\assets\magiksmostevile\textures\items\general\vampire_bat_tooth.png" does not exist (as is clarifed by a logging line)

    ...which would work in the IDE. It escapes the run directory and tries to enter non-existant resources.

     

    What would work for accessing theses images both in the IDE and in the launcher?

     

    I tried plain old "src/main", but found that I had to escape "run" (changed to "../src/main")

  2. For normal Minecraft I think the general consensus (that I've heard -- don't quote me!) is that 1.8.9 is the best in terms of PvP mechanics, as it uses pre-1.9 combat and has the most bugs ruled out of the pre-1.9 versions. It is, however, missing 5 years of good features from 1.8.9 - 1.16

    For Forge, the latest version (and one behind, as of this writing) is the best if you need support, as versions older than that are not supported.

     

    Just some things to bear in mind :) 

  3. My aim is to make "glyphs" out of particles -- images to decorate the casting of rituals.

     

    How can I create particles of different colours if ParticleType and BasicParticleType have no colourising variables and Particles themselves (and their subclasses) cannot be registered and have a texture bound to them?

     

    Side note:

    The way I am planning to make the images is to read an array of bytes from a png file in the mod resources. The Glyph class will then take those bytes in groups of 4 (red, green, blue and alpha for each pixel) and apply these attributes to a particle, then add it to the world. Particle has all of these variables in it, I just can't see how to utilise them, as I said above.

     

    GitHub in signature

  4. On 6/11/2020 at 9:41 AM, diesieben07 said:

    You can never trust the client.

    Very true -- I moved all of the logic to the server.

     

    On 6/11/2020 at 9:41 AM, diesieben07 said:

    I am not sure why you need to "bounce packets around"

    Not entirely sure what I meant here... I think something about a 1 or 0 in an int[] for each ritual? Scrapped that idea!

     

    On 6/11/2020 at 9:41 AM, diesieben07 said:

    Just send a packet when the client wants to cast a ritual and verify on the server fi that is okay.

    Bit more complicated in this case but that's the general gist I went with.

     

    For anyone from the future, these links should help:

    https://github.com/GenElectrovise/MagiksMostEvile/tree/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/network/altar

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/tileentity/altar/AltarContainerScreen.java

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/tileentity/altar/AltarContainer.java

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/tileentity/altar/AltarTileEntity.java

  5. 12 minutes ago, OneHotEncoder said:

    It almost seems like a new ServerWorld instance is created each time?

    That seems likely.

     

    I assume you are using Forge 1.15.2? Please clarify :) 

     

    How are the portals stored and how do they work? If it is a Portal Block, then could you have whatever is teleporting the player in check for nearby Portal Blocks, like Minecraft does with the Nether? 

    Similar with entities.

  6. My solution: https://www.minecraftforge.net/forum/topic/86697-1152-can-players-fake-which-advancements-they-have/?do=findComment&comment=407476

     

     

    The answer is aptly summed up by 

    Quote

    You can never trust the client

     

    ==

     

    Hi!

     

    The Question:

    Can players fake which advancements they have?

     

    The Context: 

    My aim is for players, via the Altar, to be able to cast various rituals, which will do various things. They will be able to select a ritual to cast using buttons on the AltarContainerScreen (not yet added), which cycles a variable called the selectedIndex, handled in the AltarContainer#RitualSelector class. When the Container is opened, it should check which advancements the player has, then make rituals available based on which ones they have completed. I can retrieve their advancements on the Server, though as the packet containing the ResourceLocation of the selected ritual (to be verified and processed on the server) is sent by the client, I either need to retrieve the player's advancements on the client side, or bounce some packets with int arrays around (seems messy to me). I currently have a check in to make sure the logic is only handled on the server, though (of course) that is preventing the client from getting any of their advancements, meaning that they cannot cast any rituals.

     

    The bottom line (Literally! Pun intended...) is: Can I trust the client to not fake advancements?

  7. On 6/8/2020 at 2:05 PM, Draco18s said:

    (as the mojang website is a nightmare to try and search for information on)

    They'd probably better fix that :) 

     

    On 6/8/2020 at 2:05 PM, Draco18s said:

    There's some detail.

    So it is possible.... Interesting!

     

    On 6/8/2020 at 9:12 AM, Azaka7 said:

    Your best bet, until it's implemented completely, is going to be to use a sort of jigsaw structure generation. 

    Probably... I'll scout around a bit to see if there is a way, but otherwise, I agree!

  8.  

    11 minutes ago, Draco18s said:

    This is not a thing. Dinnerbone mentioned that it would be "a cool thing to have" six years ago. That's the most recent comment on it from anyone at Mojang.

    Ok pretty conclusive...

     

    How would you suggest I go about this then? Would it be something like world carvers? And for the sky "biome" a series of structures? (More of a sky archipelago than a biome, now :) )

  9. In one of the early MC 1.15 (not 1.16 I think) snapshots, I heard mention that biomes can now be detected vertically, i.e. the biome at the top of a mountain can (in theory) be different to the biome at the bottom, and they would be stacked on top of each other. I believe this was in relation to the possibility of a mountain-biome update... I don't believe MC uses this at all as yet... (if it exists at all!)

    Has anyone else heard anything about this?

     

    Either way, I ask this in the context of me wanting to create underground biomes which are unrelated to the biomes on the surface. An example of this would be, perhaps, an underground "Evile Aquifier" biome for, e.g. a Kraken to live in. Another example would maybe be an underground fire biome as well; a floating islands biome as well -- again, unrelated to the biomes present on the surface. I would want them to each have their own custom generation -- no stone here! Only certified Evile-Blocks allowed! :) 

    Would anyone have any suggestions on achieving this? 

     

    Many thanks!

  10. 15 hours ago, Ugdhar said:

    What about the code for those things that attack players that haven't slept? I believe they fly and attack with melee. Phantom I believe they are called.

    Thought about them... Not quite what I'm looking for I think, as they only circle, but would be worth looking at!

     

    14 hours ago, Budschie said:

    If you want your vampire bats to fly through walls, you can also look at the vex entity and its pathfinding:

    Vexes -- the most annoying and forgettable mob ever! I totally forgot about them! I gotta look at those! They've got more similar behaviour to what I intend for the Vampire Bats... I wasn't thinking they should go through walls, but that could be really interesting! I can always change it later! :) 

  11. Solution:

    As of now, I set the vampire bat's navigator and moveController variables like so in the constructor.

    		this.moveController = new VampireBatMoveHelperController(this, 60, true);
    		this.navigator = new FlyingPathNavigator(this, this.world);

    VampireBatMoveController can be viewed on my linked Github (linked below; the entity/vampire_bat package), but currently only extends FlyingMovementController, overriding nothing, pending additional functionality at a later date.

     

    ==

     

    Hi!

    I'm trying to make a vampire bat which will attack various entities. I have registered the Goals to find targets and the bats can, at the moment attack them -- but only by walking to them. As bats don't walk, this seems like something that should be fixed.

     

    How would I go about making them get to their targets through the air?

     

    I've tried looking at the Ghast code (no melee attacks and not really what I'm looking for) and the Bee code (all obfuscated beyond readability), but to no avail! Minecraft doesn't really have great support, it seems, for flying mobs :/... Or am I wrong in that?

    I've also researched pathfinding algorithms, but figured I should find out if Minecraft can do that for me before I write something from scratch!

     

    Thanks!

     

    Github: https://github.com/GenElectrovise/MagiksMostEvile/tree/1.15.2

  12. Woohoo! It works! Although I've found that my packet code can be replaced by the (now working) trackedInts, I'm sure I'll need this packet knowledge soon!

     

    Many thanks to you all!

     

    ===

     

    For anyone from the future:

    This link is to this commit. For reference to the rest of the Altar code, see the next link.

    https://github.com/GenElectrovise/MagiksMostEvile/commit/d2ae6d39bdadf06f5078d6fe095887b6acf9f1d2

    This is the full, latest, repo.

    https://github.com/GenElectrovise/MagiksMostEvile/tree/1.15.2

     

     

    Ps. As the altar networking code is currently unused, I have deprecated it. It will be removed at a later date when I have a better networking example.

  13. Ok, so can I clarify this is actually what I need to do:

     

    ==

    I'm sending the packet in AltarContainer#detectAndSendChanges, which means that I have an instance of the player accessing it through inv#player.

     

    I send the packet to that player, but when I receive that packet, I need an instance of either a World or a PlayerEntity to work with. If I have a World, I can get the PlayerEntity using their UUID; if I have a PlayerEntity I can use that directly.

     

    I need to access the currently openContainer, because then, if the openContainer is an instanceof AltarContainer, I can cast it and access the AltarContainerScreen? Because if this is taking place on the client, openContainer will give a ContainerScreen, as the Player should not directly interact with the Container itself?

     

    From there, I can update the values of the maxAmethystFlux and the currentAmethystFlux.

    ==

     

    Does this make any sense whatsoever? Am I doing everything totally wrong?

    If this is, in fact, the case, which simple method to get an instance of a World or the Player am I missing?

    Pushing changes to GitHub now... Thanks!

  14. https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/tileentity/altar/AltarTileEntity.java

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/main/registry/EvileDeferredRegistry.java#L125

    https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/main/registry/EvileDeferredRegistry.java#L59

    These should help :)

     

    1 hour ago, Ahndrek Li'Cyri said:

    do I use <TileEntityType<?>>

    Correct!

     

    And don't forget to register your DeferredRegister using: 

    TILE_ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());

    Or something similar. I do this in the constructor of my EvileDeferredRegistry, which is called in the constructor of my main mod class.

     

    1 hour ago, Ahndrek Li'Cyri said:

    i am unsure as to what these are suppose to be

    No surprises here :) ... It isn't very intuitive (I think). Somewhere on this forum is me asking this exact question xD!

    You have to use TileEntityBuilder.Builder#create:

    public static final RegistryObject<TileEntityType<AmethystCrystalTileEntity>> TILE_ENTITY_AMETHYST_CRYSTAL = TILE_ENTITIES.register("tile_entity_amethyst_crystal", () -> TileEntityType.Builder.create(AmethystCrystalTileEntity::new, EvileDeferredRegistry.AMETHYST_CRYSTAL.get()).build(null));

    You pass a new instance of your TileEntity (which must have a 0 argument constructor), and the Block you want to bind the TileEntity to. Then you have to call build(null) on the created Object.

    • Like 1
  15. Hi @TheGreyGhost!

    Sorry for the lengthy reply time! trackedInts haven't worked for me thus far -- an error in my implementation...

    After the lack of success with that, I decided to try packets (figured I'd have to learn eventually), but as yet, they too are evading me, this time by showering me in compiler errors... As I register the packet, I get this error on the ::onMessageRecieved and ::encode , though as far as I can see I give the correct args.

    Spoiler

    The type AltarMessageHandlerOnClient does not define onMessageReceived(MSG, Supplier<NetworkEvent.Context>) that is applicable here

     

    The type AltarEnergyUpdateMessageToClient does not define encode(MSG, PacketBuffer) that is applicable here

    I tried removing some of the arguments, as I thought they might be inferred from the method reference, but again to no avail.

     

    I fiddled around with the ::decode method a bit more, and the error changed to this:

    Spoiler

    The type of decode(PacketBuffer) from the type AltarEnergyUpdateMessageToClient is AltarEnergyUpdateMessageToClient, this is incompatible with the descriptor's return type: MSG

    ... which is even more perplexing. As MSG is a generic type specified in the SimpleChannel#register method, I thought perhaps this could be caused by the other compiler errors making the compiler unable to tell if AltarEnergyUpdateMessageToClient is a valid/consistant type?

     

    I have been using @Draco18s's reasonable realism repository  for good-practise reference, as well as the forge docs and your MinecraftByExample  section on network messages for reference...

     

    Again sorry for the slow reply, but at least I haven't been idle! :) 

    Many thanks.

×
×
  • Create New...

Important Information

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