Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

eatthenight

Members
  • Content Count

    43
  • Joined

  • Last visited

Posts posted by eatthenight

  1. 24 minutes ago, Tessa said:

    Okay, so making and sending custom packets appears to be pretty challenging and I doubt that I have the knowledge to take that beast on. In some tutorials I see people using the ItemStackHandler Capability, in which case they often have inventories in an entity instead of a container. Would that be an alternative or do you guys know a different workaround for me?

    capabilities have to be synced too so no you must use packets and its not that difficult to be honest. 

    https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/

     

  2. 18 hours ago, Animefan8888 said:

    Maybe change the uv's to not have decimals?

    I didnt made the model one of my modelers made it so i didnt know, anyway i overlooked this:

    Texture hxhmod:textures/block/joystation.png with size 676x676 will have visual artifacts at mip level 4, it can only support level 2.
    Please report to the mod author that the texture should be some multiple of 16x16.

    so it has to do with the size of the texture

  3. so i have a custom model made for me and somehow the texture is glitched when placed but not when the player holds the item block and i dont know what it could be cause this is my first time using custom block models.

     

    2019-11-20_20_14_04.thumb.png.ae30b737ef1f91c0e80b59771af91544.png

    2019-11-20_20_15_47.thumb.png.59363e59ad8352b0f6f760aa2931b9f4.png

     

    blockstate json file:

    Spoiler
    
    {
        "variants": {
            "normal": [
                { "model": "hxhmod:joystation" }
            ]
        }
    }

     

    model json file:

    Spoiler
    
    {
    	"parent": "block/cube_all",
    	"textures": {
    		"0": "hxhmod:block/joystation"
    	},
    	"elements": [
    		{
    			"from": [3.1, 0, 3.6],
    			"to": [12.9, 0.35, 12.4],
    			"faces": {
    				"north": {"uv": [11.622, 2.161, 13.082, 3.576], "texture": "#0"},
    				"east": {"uv": [11.674, 2.08, 12.973, 3.488], "texture": "#0"},
    				"south": {"uv": [11.703, 2.108, 12.944, 3.467], "texture": "#0"},
    				"west": {"uv": [11.974, 2.161, 12.973, 3.512], "texture": "#0"},
    				"up": {"uv": [11.864, 2.27, 12.972, 3.469], "texture": "#0"},
    				"down": {"uv": [11.731, 2.056, 13.001, 3.359], "texture": "#0"}
    			}
    		},
    		.
    		.
    		.

     

    any ideas?

  4. so i added a layer to the player and i want to render an obj model i made based on values in my player capability, how do i load obj models and render them? i read that you have to write your own parser but as i have no clue to how to do that are there any tutorials or maybe open source code i could use for reference? i dont know much about opengl rendering outside from basic minecraft stuff so this is difficult for me thanks :))

  5. so im currently workin on a rpg type level up system, that means the player will obviously be able to improve his attack defense and all that..

    but now i was wondering cuz i want the player to have big numbers as health up to like 1000 or even more, should i directly modify the players entity attributes or what's yall suggestion?

    my idea was:

    saving custom health and maxHealth values (i think modifying the entity attributes only works up to some values) in my capability and every time the player gets hurt i would calculate the damage with using my stats values if the health of my own stored value drops below zero i would set the actual health value to zero and that would kill the player. would this be any good? what would be the best approach if i want the player to level his health? as like my abilities and all will do much damage (and i want the damage to be much higher as the vanilla) i was wondering what would be the "best" way to do this how would yall do this?

    thanks :)) 

  6. 7 minutes ago, Draco18s said:

    This does not do what you think it does. Adding this to the Gui class will just cause a class not found exception in another place.

    Omitting it and registering the gui only from the client proxy, meanwhile, works just fine.

    i answered his question how you load something on only one side. i know that registering the gui in the client proxy is enough. and well no you can set the side of the event too with SideOnly(Side.Client) so the event will only be called on the client side but you’re right registering in a client proxy would be the most convenient way probably..

  7. 47 minutes ago, cinsiian said:

    Thank you guys, now textures work perfectly but I have few last things to ask.

    1) How can I see if the air bubble bar is rendered(so i can move the mana bar up so it does not contrast)?

    2) What is the correct way to get/set the capability?, I used:

    
    player.getCapability(ManaProvider.MANA, null).orElseThrow(null).get()
    player.getCapability(ManaProvider.MANA, null).orElseThrow(null).set()

    It's really buggy, sometimes it doesnt even do anything

    you could check if the player is inside water i think there was a way to get if the player is underwater

  8. 10 minutes ago, cinsiian said:

    I do get an error when I try to get the Capability of the mana:

    
    [11set2019 21:20:03.439] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: cinsiian.urtima.common.capability.mana.PlayerMana cannot be cast to net.minecraftforge.common.util.LazyOptional
    	Index: 2
    	Listeners:
    		0: NORMAL
    		1: net.minecraftforge.eventbus.EventBus$$Lambda$2050/614462502@67307e64
    		2: ASM: cinsiian.urtima.common.CommonHandler@4023efd4 onPlayerLogsIn(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V
    java.lang.ClassCastException: cinsiian.urtima.common.capability.mana.PlayerMana cannot be cast to net.minecraftforge.common.util.LazyOptional
    	at cinsiian.urtima.common.capability.mana.ManaProvider.getCapability(ManaProvider.java:20)
    	at net.minecraftforge.common.capabilities.CapabilityDispatcher.getCapability(CapabilityDispatcher.java:102)
    	at net.minecraftforge.common.capabilities.CapabilityProvider.getCapability(CapabilityProvider.java:118)
    	at net.minecraft.entity.LivingEntity.getCapability(LivingEntity.java:3110)
    	at net.minecraft.entity.player.PlayerEntity.getCapability(PlayerEntity.java:2277)
    	at cinsiian.urtima.common.CommonHandler.onPlayerLogsIn(CommonHandler.java:89)
    	at net.minecraftforge.eventbus.ASMEventHandler_7_CommonHandler_onPlayerLogsIn_PlayerLoggedInEvent.invoke(.dynamic)
    	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
    	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
    	at net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerLoggedIn(BasicEventHooks.java:43)
    	at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:203)
    	at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:119)
    	at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:63)
    	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:241)
    	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:148)
    	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:882)
    	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:800)
    	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646)
    	at java.lang.Thread.run(Unknown Source)
    
    IMana mana = (IMana) player.getCapability(ManaProvider.MANA, null);

     

    show more of your code and dont cast to IMana

  9. 14 hours ago, Animefan8888 said:

    Looks like you need to GLStateManager.translate in the post event to the player in question because it is translated back before the post event is fired.

    so i tried to translate by using some test values and it seems the other player sees the player who meditates with no arms so now its not even rendered?

    on the client who meditates its rendered with the offset i used for GLStateManage.translate...

    EDIT: the client player only sometimes gets the data if the player meditates seems like i have to fix my packets for meditating.

  10. so i have a pose which should be rendered when the player is mediating, which works fine but only in singleplayer.

    somehow in multiplayer the player who mediates his arms are rendered correctly on the client but other players see him with no arms and his arms are rendered on their own model.

     

    here is a screenshot though its hard to show it properly..

     

    image.png.ba9554656ce76f65e2f4b6d1de6ba560.png

    player who meditates:

    image.png.58492cb3dc91a31123ca10a3f79a4915.png

     

    in RenderPlayerEvent.Pre i set the arms hidden and in the post event i set the rotation and render the arm:

    if(event.getEntityPlayer().getCapability(NenProvider.NEN_CAP, null).isMeditating()) {
    				event.getRenderer().getMainModel().bipedRightArm.isHidden = false;
    				event.getRenderer().getMainModel().bipedRightArm.rotationPointZ = -MathHelper.sin((float) Math.toRadians(event.getEntityPlayer().renderYawOffset)) * 5.0F;
    				event.getRenderer().getMainModel().bipedRightArm.rotationPointY = 20;
    				event.getRenderer().getMainModel().bipedRightArm.rotationPointX = -MathHelper.cos((float) Math.toRadians(event.getEntityPlayer().renderYawOffset)) * 5.0F;
    				event.getRenderer().getMainModel().bipedRightArm.rotateAngleX = (float) -1.0;
    				event.getRenderer().getMainModel().bipedRightArm.rotateAngleY = (float) -Math.toRadians(event.getEntityPlayer().renderYawOffset);
    				event.getRenderer().getMainModel().bipedRightArm.rotateAngleZ = (float) 3.4;
    				event.getRenderer().getMainModel().bipedRightArm.renderWithRotation(0.0625F);
    				event.getRenderer().getMainModel().bipedRightArm.rotationPointY = 2;
    				
    				event.getRenderer().getMainModel().bipedLeftArm.isHidden = false;
    				event.getRenderer().getMainModel().bipedLeftArm.rotationPointZ = -MathHelper.sin((float) Math.toRadians(event.getEntityPlayer().renderYawOffset)) * -5.0F;
    				event.getRenderer().getMainModel().bipedLeftArm.rotationPointY = 20;
    				event.getRenderer().getMainModel().bipedLeftArm.rotationPointX = -MathHelper.cos((float) Math.toRadians(event.getEntityPlayer().renderYawOffset)) * -5.0F;
    				event.getRenderer().getMainModel().bipedLeftArm.rotateAngleX = (float) -1.0;
    				event.getRenderer().getMainModel().bipedLeftArm.rotateAngleY = (float) -Math.toRadians(event.getEntityPlayer().renderYawOffset);
    				event.getRenderer().getMainModel().bipedLeftArm.rotateAngleZ = (float) -3.4;
    				event.getRenderer().getMainModel().bipedLeftArm.renderWithRotation(0.0625F);
    				event.getRenderer().getMainModel().bipedLeftArm.rotationPointY = 2;
    			}

     

  11. 2 minutes ago, Animefan8888 said:

    The RenderPlayerEvent is called for all Player entities. You'll just have to do what you have been doing just twice and differently. IE

    if eventPlayer is clientPlayer
       // Render what you have
    else

      // Render with different settings that make it look correct.

    exactly but what im confused about is event.getEntityPlayer() should give the player who's rendered if im not mistaken? but why does it render on the client player and not on the player who's actually mediating? like the arms are rendered on the position of the client players arms..... but i use the values of event.getEntityPlayer() to set the position so it should be rendered on the correct position? it seems somehow event.getEntityPlayer gives me the wrong player? im rotating the arms of the right player just the position is wrong cuz when i mediate my player has no arms.

     

  12. 3 minutes ago, Animefan8888 said:

    Ok you'll have to render it different if it isn't the client player than you would if it was the client player. @Lyon

    but how do you do that? how do i get the model of other players and change the rotation of arms and stuff..? idk because it seems everything works fine except the position is set to the clients player arms and not of the player who’s actually mediating..

  13. 1 hour ago, Animefan8888 said:

    Check if the entity player is the client player? Assuming I understand this correctly.

    player == Minecraft#player

    i have the exact same problem with my mediating pose.. but doing it that way it would only render correctly for the client player and not for every other player too. basically im in multiplayer and if the other player meditates, his arms are rendered on mine ://

  14. im currently workin on the feature to charge for my custom abilities. i have a player capability which stores all abilities and values like if the player is charging..

    i use PlayerInteractEvent.RightClickEmpty event where i check which ability is selected and start the initial charging, but now i need to check if the right click button was released to stop the charging and do the ability stuff.

    how do i check if the player holds rightclick so i can send a packet to stop charging when right click was released? can i somehow get the vanilla keybindings and check if the key is down?

     

    @SubscribeEvent
    	public void onRightClickNenSkill(PlayerInteractEvent.RightClickEmpty event) {
    		EntityPlayer player = event.getEntityPlayer();
    		INen nen = player.getCapability(NenProvider.NEN_CAP, null);
    		if(player.getHeldItemMainhand().isEmpty() && player.getHeldItemOffhand().isEmpty()) {
    			if(event.getHand() == EnumHand.MAIN_HAND) {
    				int index = GuiIngameNenSkills.getIndex();
    				if(nen.getSkills().size() > index) {
    					System.out.println("YOU USED YOUR SKILL " + nen.getSkills().get(index).getId());
    					PacketHandler.INSTANCE.sendToServer(new PacketActivateSkill(index));
    				}
    			}
    		}
    	}

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.