Automatic Bounty Poster System

A Python & Java system to auto-generate personalized 'One Piece' style bounty posters from player data and display them in-game.

More About the Project

Python | Java | Denizen | Pillow | Web API

This system was created to increase player immersion and motivation in Pirate-Era. It gives players a personal incentive to increase their in-game bounty to have their own unique poster displayed. The system works via a Java plugin that uses Minecraft maps to display images. This plugin sends a web request to a custom Python tool, passing the player's UUID and bounty amount. The Python tool then uses Pillow to composite the player's skin and data onto a poster template, which is sent back and rendered in-game.

Automatic Bounty Poster System media

My Contributions

Backend Image Generation

In-Game Integration

Image On Map Rendering

public class MapImageRenderer extends MapRenderer {
  private BufferedImage image;

  // Version of the constructor for a image file
  public MapImageRenderer(File imageFile){
      try {
          this.image = ImageIO.read(imageFile);
          // Automatically resize the image to fit the map if needed
          if (this.image != null && this.image.getWidth() != 128 && this.image.getHeight() != 128) {
              this.image = resizeImage(image, 128, 128);
          }
      } catch (IOException e) {
          this.image = null;
      }
  }

  // Version of the constructor for a buffered image (less safe)
  public MapImageRenderer(BufferedImage imageFile){
      this.image = imageFile;
      // Automatically resize the image to fit the map if needed
      if (this.image != null && this.image.getWidth() != 128 && this.image.getHeight() != 128) {
          this.image = resizeImage(image, 128, 128);
      }
  }

  // The renderer of this renderer, this actually renders onto the map. So in this case an image
  @Override
  public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
      // Draw the image onto the canvas, the image has to exist because otherwise this is not called upon
      if(image != null){
          mapCanvas.drawImage(0, 0, image);
      }
  }
}