Jump to content

ElTotisPro50

Members
  • Posts

    266
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ElTotisPro50

  1. but the dude made it and he didnt "connected" the NetworkPlayerInfo with the setPlayerSkin method or something
  2. i saw this in a mod(the code is written in 1.16.5) but is giving me erros, it doesnt find player.playerInfo and playerInfo.playerTexturesLoaded, in the class that was made it doesnt extends anything public static void setPlayerSkin(AbstractClientPlayerEntity player, ResourceLocation texture) { if (player.getLocationSkin().equals(texture)) { return; } NetworkPlayerInfo playerInfo = player.playerInfo; if (playerInfo == null) return; Map<MinecraftProfileTexture.Type, ResourceLocation> playerTextures = playerInfo.playerTextures; playerTextures.put(MinecraftProfileTexture.Type.SKIN, texture); if (texture == null) { playerInfo.playerTexturesLoaded = false; } }
  3. thank you it worked, but 2 things, tell me where i have tu pubish my posts, i publish them in modder support isnt that right? and Diesieben how do you quickly find how to solve modding errors, i can do it but if i create my own program or something but im minecraft modding, what goes through your mind to solve those problems? for example i still cant solve my problem with drawing correctly a glowing line even if i look the minecraft classes
  4. so i watched this tutorial on youtube(https://www.youtube.com/watch?v=vZgYjHwKcHA&t=691s) for make sittable blocks and even if is a 1,12,2 tutorial video a kind of translated it to 1.16.5 code but is not working "correctly"; the SeatEntity spawns in MY position and not in the position of the chair, and it blocks me the mouse movement in Y, and i can't shift for exit the chair, i can break blocks but my hand is kind of freeze in time (https://imgur.com/a/6xoKrV5) this is my code: @SubscribeEvent public static void test(PlayerInteractEvent.RightClickBlock event) { PlayerEntity player = event.getPlayer(); if(player.getRidingEntity() != null) { return; } World world = event.getWorld(); BlockPos pos = event.getPos(); Vector3d vec = new Vector3d(pos.getX() + 0.5f,pos.getY(), pos.getZ() + 0.5f); double maxDistance = 4.5D; if((vec.x - player.getPosX()) * (vec.x - player.getPosX()) + (vec.y - player.getPosY()) * (vec.y - player.getPosY()) + (vec.z - player.getPosZ()) * (vec.z - player.getPosZ()) > maxDistance * maxDistance) { return; } BlockState state = world.getBlockState(pos); ItemStack mainStack = player.getHeldItemMainhand(); ItemStack offStack = player.getHeldItemOffhand(); if(!mainStack.isEmpty() || !offStack.isEmpty()) { return; } if(state.getBlock() instanceof StairsBlock) { //List<SeatStair> seats = world.getEntitiesWithinAABB(SeatStair.class, new AxisAlignedBB(pos,pos.add(1,1,1))); SeatStair seat = new SeatStair(EntityType.ARMOR_STAND,world,pos); world.addEntity(seat); player.startRiding(seat); } } public static class SeatStair extends Entity { public SeatStair(EntityType<QUESTIONMARK extends Entity> type, World world, BlockPos pos) { super(type,world); setPosition(pos.getX() + 0.5D,pos.getY() + 0.2D,pos.getZ() + 0.5D); } @Override protected void registerData() { } @Override public void tick() { super.tick(); BlockPos pos = getPosition(); if(!(getEntityWorld().getBlockState(pos).getBlock() instanceof StairsBlock)) { setDead(); return; } List<Entity> passengers = getPassengers(); if(passengers.isEmpty()) { setDead(); } for(Entity entity : passengers) { if(entity.isSneaking()) { setDead(); } } } @Override protected void readAdditional(CompoundNBT compound) { } @Override protected void writeAdditional(CompoundNBT compound) { } @Override public IPacket<QUESTIONMARK> createSpawnPacket() { return null; } }
  5. but it will deobfuscate a specific .class file(that is from other mod) that i added in my mod or what?
  6. ok that just explained me how forge obfuscate the fields but i need to really deobfuscate them not to explain mehow they do it(maybe im blind and in the page there is tool or something that deobfuscates the fields but i didnt see anything)
  7. i re-made the player model with RenderPlayerEvent so i can modify the model, but the event is making a "double" of steve like a mirror, i dont know which steve is the real and which one is the fake but i need to remove or make invisible the one below i tried to use .Pre to make invisible the model this is how it looks without the bipedPART.showModel = false: https://imgur.com/a/fMuXsBR i tried to make the steve that is rotated down invisible but im doing the opposite(made invisible the one that is looking up or the correct one) and thats not what i want @SubscribeEvent public static void renderPre(RenderPlayerEvent.Pre event) { event.getRenderer().getEntityModel().bipedHead.showModel = false; event.getRenderer().getEntityModel().bipedBody.showModel = false; event.getRenderer().getEntityModel().bipedRightArm.showModel = false; event.getRenderer().getEntityModel().bipedLeftArm.showModel = false; event.getRenderer().getEntityModel().bipedRightLeg.showModel = false; event.getRenderer().getEntityModel().bipedLeftLeg.showModel = false; } @SubscribeEvent public static void renderPost(RenderPlayerEvent.Post event) { event.getRenderer().getEntityModel().bipedHead.showModel = true; event.getRenderer().getEntityModel().bipedBody.showModel = true; event.getRenderer().getEntityModel().bipedRightArm.showModel = true; event.getRenderer().getEntityModel().bipedLeftArm.showModel = true; event.getRenderer().getEntityModel().bipedRightLeg.showModel = true; event.getRenderer().getEntityModel().bipedLeftLeg.showModel = true; if(ModKeys.ability1Key.isKeyDown()) { PlayerEntity player = event.getPlayer(); GlStateManager.enableBlend(); PlayerModel<AbstractClientPlayerEntity> model = event.getRenderer().getEntityModel(); ModelRenderer head = model.bipedHead; ModelRenderer rightarm = model.bipedRightArm; ModelRenderer leftarm = model.bipedLeftArm; ModelRenderer body = model.bipedBody; ModelRenderer rightleg = model.bipedRightLeg; ModelRenderer leftleg = model.bipedLeftLeg; head.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); rightarm.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); leftarm.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); body.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); rightleg.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); leftleg.render(event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.getEntitySolid(((AbstractClientPlayerEntity)player).getLocationSkin())), Minecraft.getInstance().getRenderManager().getPackedLight(player, 1f), OverlayTexture.NO_OVERLAY); } }
  8. what is a SRG?, ( https://imgur.com/a/RRPPegl ) "of how many classes/methods/fields do you need the SRG names" i dont understand your question, i need to convert those obfuscated fields or "SRG" as you said to readable fields
  9. im not a psycho hahaha, im programming everything in my mod (the code i leaved is from a obfuscated class of a mod called death note mod for 1.15.2, that was an example of how minecraft obfuscate the names)
  10. also there is a program called bearded octo nemesis that deobfuscate any .class files(is made for minecraft) but it doesnt work
  11. oh i know that the mod didnt obfuscated the methods, maybe minecraft did, an example is: world.func_numbers or player.func_numbers, this is from a mod called deathnote mod public class DeathNoteGUIGui extends DeathnoteModElements.ModElement { public static HashMap guistate = new HashMap<>(); private static ContainerType<GuiContainerMod> containerType = null; public DeathNoteGUIGui(DeathnoteModElements instance) { super(instance, 5); this.elements.addNetworkMessage(ButtonPressedMessage.class, ButtonPressedMessage::buffer, net.neio.deathnote.gui.DeathNoteGUIGui.ButtonPressedMessage::new, ButtonPressedMessage::handler); this.elements.addNetworkMessage(GUISlotChangedMessage.class, GUISlotChangedMessage::buffer, net.neio.deathnote.gui.DeathNoteGUIGui.GUISlotChangedMessage::new, GUISlotChangedMessage::handler); containerType = new ContainerType((ContainerType.IFactory)new GuiContainerModFactory()); FMLJavaModLoadingContext.get().getModEventBus().register(this); } @OnlyIn(Dist.CLIENT) public void initElements() { DeferredWorkQueue.runLater(() -> ScreenManager.func_216911_a(containerType, net.neio.deathnote.gui.DeathNoteGUIGui.GuiWindow::new)); } @SubscribeEvent public void registerContainer(RegistryEvent.Register<ContainerType<?>> event) { event.getRegistry().register(containerType.setRegistryName("death_note_gui")); } private static void handleButtonAction(PlayerEntity entity, int buttonID, int x, int y, int z) { World world = entity.field_70170_p; if (!world.func_175667_e(new BlockPos(x, y, z))) return; if (buttonID == 0) { Map<String, Object> $_dependencies = new HashMap<>(); $_dependencies.put("entity", entity); $_dependencies.put("guistate", guistate); $_dependencies.put("x", Integer.valueOf(x)); $_dependencies.put("y", Integer.valueOf(y)); $_dependencies.put("z", Integer.valueOf(z)); $_dependencies.put("world", world); WriteProcedureProcedure.executeProcedure($_dependencies); } } private static void handleSlotAction(PlayerEntity entity, int slotID, int changeType, int meta, int x, int y, int z) { World world = entity.field_70170_p; if (!world.func_175667_e(new BlockPos(x, y, z))) return; } } as you can see func_numbers is seen after "something."
  12. To draw something on the HUD you must use RenderGameOverlayEvent.Post with ElementType.ALL. Subscribing to a parent event class (like RenderGameOverlayEvent) directly almost never achieves useful results. When drawing on the HUD with a different texture, you must switch back to the normal HUD texture (AbstractGui.GUI_ICONS_LOCATION) afterwards. you should have said different words, instead of "switch back to the normal HUD TEXTURE AbstractGui.ICONS", "bind your Icons,draw your stuff and bind AbstractGui.ICONS", I could have understood that perfectly because you didnt say me BIND AbstractGui just SWITCH, i know it sound stupid but idk is easier even is an overlay is not so basic
  13. It worked!!!(you could have told me just that instead of "subscribing parenting RenderGameOverlayEvent" and that things) this is the code that works: @SubscribeEvent public static void renderOverlay(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getInstance(); if(event.getType() == RenderGameOverlayEvent.ElementType.ALL) { mc.getTextureManager().bindTexture(ICONS); drawTexturedModalRect(0,0,144,0,16,16,0); mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); } }
  14. im binding my texture, ICONS is my texture: public static final ResourceLocation ICONS = new ResourceLocation(TotisMod.MOD_ID,"textures/gui/icons.png") the random GuiUtil instance is because is for another thing ignore it, then why is not working is showing me like the texture of the hearts that you have when the wither affects you?(like the black hearts) but only one and a half because i said that the texture is 16x16
  15. @SubscribeEvent public static void renderOverlay(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getInstance(); GuiUtils gui = new GuiUtils(); if(event.getType() == RenderGameOverlayEvent.ElementType.ALL) { drawTexturedModalRect(0,0,144,0,16,16,0); mc.getTextureManager().bindTexture(ICONS); } } it DIDNT WORK
  16. dude you didnt explained me anything, "After rendering your stuff, bind that texture.", what does that mean??? i put drawTexturedModalRect and AFTER THAT mc.getTextureManager().bindTexture(ICONS);?? and you didnt tell me where i put the abstract gui thingy, and you told me to parent RenderGameOverlayEvent AbstractGui.GUI_ICONS_LOCATION; what is this how i implement this
  17. where i put AbstractGui.ICONS, and what do you mean with "subscribing to a parent event class", is like this? @SubscribeEvent public static void render1(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getInstance(); if(event.getType() == RenderGameOverlayEvent.ElementType.ALL) { mc.getTextureManager().bindTexture(ICONS); drawTexturedModalRect(0,0,144,0,16,16,1); } } @SubscribeEvent public static void render2(RenderGameOverlayEvent.Post event) { render1() AbstractGui.ICONS; }
  18. so im rendering an icon FROM A .PNG IMAGE, and is doing it well but the background of the icon is black when I change what i have in my hand, this is not TOO bad but if i want to render a image that covers the entire screen every time i select a diferent item the background will turn black(MY IMAGE IS .PNG AND THE BACKGROUND IS NOT BLACK) https://imgur.com/a/M0KgTaG (from imgur the background looks black but download the image and open it in a photo editor and you will see that is transparent) public static final ResourceLocation ICONS = new ResourceLocation(TotisMod.MOD_ID,"textures/gui/icons.png"); @SubscribeEvent public static void renderOverlay(RenderGameOverlayEvent event) //i cant use .Pre or .Post because the survival hunger and health bars will bug { Minecraft mc = Minecraft.getInstance(); if(event.getType() == RenderGameOverlayEvent.ElementType.TEXT) //if i use .ALL the background will ALWAYS be black and i HAVE to put this if statement or hunger and health bars will bug { mc.getTextureManager().bindTexture(ICONS); drawTexturedModalRect(0,0,144,0,16,16,1); //i tried to put for example 100 and 0 in Z level but apparently it doesnt change anything } }
  19. this doesnt work: Vector3d start = new Vector3d(2F, 0, 1); but it should, im putting the start of the line more forward and a more to the right(or left i dont know) and it should not be perfectly alined for me not to see it, please help me
  20. ok variable distance is because if i dont use distance the end of the line will always be the same, the end of the line is where im looking. And in "new Vec3d(0.1F, 0, 0)" or "start" i tried to put for example 0.5 in the Z value[you know that Z value means depth or how close is the line from me](new Vec3d(0.1F, 0, 0.5)) but the line disappears, im not setting such a hight value to make line disappear
  21. and i deleted GLStateManager,transtatef and rotate and it works but first is so close to me and second the line is drawing from the camera of the player, i need to draw it from the player eyes... https://imgur.com/a/Ynj7W8o
×
×
  • Create New...

Important Information

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