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

cookiedragon234

Members
  • Content Count

    38
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by cookiedragon234

  1. Im not sure whether that would produce s spectrum allowing a significant amount of colour choices. Also in order to save the users chosen colour, I need to take the colour where they click. With a buffered image I can just do getRgb at the position they clicked, but with your method Im not sure how I would do that.
  2. Hi I am trying to create a colour picker gui element, which displays the HSV colour space, with the x and y axis representing Saturation and Value, and a separate slider for hue and alpha. Something like this is the goal: This is my code so far: final Minecraft mc = Minecraft.getMinecraft(); final BufferedImage bufferedImage = new BufferedImage(100,100, TYPE_INT_ARGB); final DynamicTexture dynamicTexture = new DynamicTexture(bufferedImage); ResourceLocation dynamicResource; private int hue = 1; private float alpha = 1; @Override public v
  3. @ATomo9_CY yes, it will override the user's input. Im not 100% sure about mouse input, but you can use stuff like mc.player.swingArm() for that
  4. @ricepuffz its an external dependency which you need to add. See https://github.com/SpongePowered/MixinGradle . Also as @DavidM said, coremodding is not recommended and since you don't know what it is, it's probably best you dont try to do it.
  5. Uh I dont completely get what that code is doing, but it didn't work anyway. I am experimenting with achieving this using GlScaled but running into some small problems. If anyone else has managed to do this with glscaled I would appreciate an example. I will post my code if I finish it and get it working.
  6. @DavidM the width of a string will change based on its height, they are proportional
  7. That is the correct way to do it This is my code @Mixin(value = AbstractClientPlayer.class) public abstract class MixinAbstractClientPlayer extends MixinEntityPlayer { @Shadow @Nullable protected abstract NetworkPlayerInfo getPlayerInfo(); @Inject(method = "hasSkin", at = @At("RETURN"), cancellable = true) public void hasSkin(CallbackInfoReturnable<Boolean> cir) { PlayerSkin.HasSkin event = new PlayerSkin.HasSkin(getPlayerInfo(), cir.getReturnValue()); MinecraftForge.EVENT_BUS.post(event); cir.setReturnValue(event.result); } @Inject(method = "get
  8. KeyBinding.setKeyBindState(mc.gameSettings.keyBind[whatever].getKeyCode(), true);
  9. I wrote the following code to resize a string until it fits within the specified width: public int drawStringClamped(String text, float x, float y, float width, int color) { int original = fontRenderer.FONT_HEIGHT; while (getStringWidth(text) > width && fontRenderer.FONT_HEIGHT > 0) { fontRenderer.FONT_HEIGHT--; } int out = drawString(text, x, y, color); fontRenderer.FONT_HEIGHT = original; return out; } This however does not work as the `getStringWidth` function does not take into account the string height! Is there an alternative way to do
  10. Does anyone know of a function to convert coordinates in 3d space into 2d space? An example usage for this would be drawing text on the users screen over a 3d position, obviously the location of the text logically is in 3d space, however for it to be rendered it must be rendered in 2d. An example of this already happening in the vanilla game is name tags, however I tried to use the EntityRenderer.drawNameplate function and this did nothing, the text simply did not show up. I tried running the function on world render as well as on ui render. If anyone knows of a function that can a
  11. It seems to fire for mobs but not players after more testing. I managed to solve this by using the AttackEntityEvent along with some other hacky mechanics.
  12. Could you provide some examples? I'm simply using mixins because I know it works and I've seen many examples of people using them to successfully create packet events: https://github.com/Hexeption/Nitro-Client/blob/master/src/main/java/uk/co/hexeption/client/mixin/mixins/MixinNetworkManager.java, https://github.com/cabaletta/baritone/blob/master/src/launch/java/baritone/launch/mixins/MixinNetworkManager.java, https://git.liquidbounce.net/CCBlueX/LiquidBase/blob/4b53d25e2893dbc5521d9a831a652b792f7803ea/src/main/java/net/ccbluex/liquidbase/injection/mixins/MixinNetworkManager.java, h
  13. Yes, and the mixin I just described is mixing into the netty networkmanager. I know its netty because when printing from the network manager it tells me that it is in the "netty" thread. I did dig into the code, and I found the class from which packets are sent and recieved, so I made a mixin to intercept the function calls.
  14. Yes actually we have, that must be why! How did you fix that?
  15. Scroll up. Also I don’t understand why me literally offering helpful advice to other people coming across this is met with “that’s a shit method” and “don’t mess with it at all”. Like geez, if you know a better way then feel free to contribute, but simply getting complaining isn’t contributing anything.
  16. I’d welcome any examples of a better way to do this?
  17. I'm wondering if there is anyway to trigger an action when the client kills another player? The LivingDeathEvent seems to be only server side. Is there an equivalent client side event which is triggered on a player death and allows me to check whether the damage source is from the client? Or is there maybe a packet that is sent upon a players death? Thanks.
  18. For anyone else looking for this in the future, create mixins for net.minecraft.network.NetworkManager like so: @Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) private void onSendPacket(Packet<?> packet, CallbackInfo callbackInfo) { //System.out.println("Packet Sent: " + packet.toString()); PacketSent event = new PacketSent(packet); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled() && callbackInfo.isCancellable()) { callbackInfo.cancel(); } packet = event.packet; } @Inject(method = "channelRead0", at
  19. Found a fix for anyone else with this issue. In build.gradle change: dependencies { compile("org.spongepowered:mixin:0.7.4-SNAPSHOT") } to dependencies { compile("org.spongepowered:mixin:0.7.4-SNAPSHOT") { exclude module: 'launchwrapper' exclude module: 'guava' exclude module: 'gson' exclude module: 'commons-io' } }
  20. Yep, I tried setting up a mods.toml and that didn't make any difference because I think thats for 1.14. I don't understand what you mean by how did I setup my workspace. I imported build.gradle in IntelliJ IDEA, and ran the commands that the documentation provided to set it up. This is my build.gradle: buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } maven { name = 'SpongePowered' url = 'http://repo.spongepowered.org/maven' } } depen
  21. When running the task runClient the actual mod is not loaded even though Minecraft starts up without any errors. I believe that these lines from the log could be part of it: [12:32:17] [main/INFO] [FML]: -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_211, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 409724112 bytes (390 MB) / 739770368 bytes (705 MB) up to 3808428032 bytes (3632 MB) JVM Flags: 0 total; IntCache: cache: 0, tcach
  22. It's not just packet events. And this topic wasn't really asking for advice on whether to use mixins. Me and my team already have a design that relies on mixins. Id really appreciate it if you could give me any advice on why it doesnt seem to be able to find the guava library? Is there a way I can download it manually perhaps?
  23. Mess is an interesting choice of word, I would say to allow the user to modify/monitor certain packets, for example adding a server tickrate counter to the HUD based on the frequency of server update packets received, or prevent the server from sending rotation packets in order to prevent the annoying rotation rubberbanding that can sometimes happen during lag.
×
×
  • Create New...

Important Information

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