Code Monkey home page Code Monkey logo

displaymodellib's Introduction

DisplayModelLib

A library to help with the complexities of managing display entities & interactions.

Adding DisplayModelLib to your project

  1. Add the MetaMechanists repository.
<repository>
  <id>metamechanists-repo-releases</id>
  <name>MetaMechanists Repository</name>
  <url>https://repo.metamechanists.org/releases</url>
</repository>
  1. Add DisplayModelLib as a dependency. You can find the latest version here https://repo.metamechanists.org/#/releases/org/metamechanists/DisplayModelLib
<dependency>
  <groupId>org.metamechanists</groupId>
  <artifactId>DisplayModelLib</artifactId>
  <version>2</version>
</dependency>
  1. Shade DisplayModelLib into your plugin.

Examples

Example 1

new ModelBuilder()
    .add("main", new ModelCuboid()
            .material(Material.LIGHT_BLUE_CONCRETE)
            .brightness(3)
            .size(1.2F, 1.2F, 1.2F)
            .rotation(Math.PI/4))
    .buildAtBlockCenter(location);

beacon_matrix.png

Example 2

new ModelBuilder()
    .add("coil1", new ModelCuboid()
            .material(Material.ORANGE_CONCRETE)
            .size(0.1F, 0.8F, 1.1F)
            .location(0.3F, 0, 0))
    .add("coil2", new ModelCuboid()
            .material(Material.ORANGE_CONCRETE)
            .size(0.1F, 0.8F, 1.1F)
            .location(-0.3F, 0, 0))
    .add("coil3", new ModelCuboid()
            .material(Material.ORANGE_CONCRETE)
            .size(1.1F, 0.8F, 0.1F)
            .location(0, 0, 0.3F))
    .add("coil4", new ModelCuboid()
            .material(Material.ORANGE_CONCRETE)
            .size(1.1F, 0.8F, 0.1F)
            .location(0, 0, -0.3F))
    .buildAtBlockCenter(location);

beacon_Battery.png

Example 3

new ModelBuilder()
    .add("wall1", new ModelCuboid()
            .material(Material.WHITE_CONCRETE)
            .location(0.3F, -0.21F, -0.3F)
            .size(0.2F, 0.6F, 1.1F)
            .rotation(Math.PI / 4))
    .add("wall2", new ModelCuboid()
            .material(Material.WHITE_CONCRETE)
            .location(-0.3F, -0.21F, 0.3F)
            .size(0.2F, 0.6F, 1.1F)
            .rotation(Math.PI / 4))
    .add("wall3", new ModelCuboid()
            .material(Material.WHITE_CONCRETE)
            .location(0.3F, -0.21F, 0.3F)
            .size(1.1F, 0.6F, 0.2F)
            .rotation(Math.PI / 4))
    .add("wall4", new ModelCuboid()
            .material(Material.WHITE_CONCRETE)
            .location(-0.3F, -0.21F, -0.3F)
            .size(1.1F, 0.6F, 0.2F)
            .rotation(Math.PI / 4))

    .add("water", new ModelCuboid()
            .material(Material.BLUE_CONCRETE)
            .location(0, -0.3F, 0)
            .size(1.0F, 0.4F, 1.0F)
            .rotation(Math.PI / 4))
    .add("concrete", new ModelCuboid()
            .material(Material.BROWN_CONCRETE)
            .brightness(Utils.BRIGHTNESS_OFF)
            .location(0, -0.2F, 0)
            .size(0.3F)
            .rotation(Math.PI / 4))
        
    // This item is not visible by default - try using .item(<itemstack)
    .add("item", new ModelItem()
            .facing(BlockFace.DOWN)
            .size(0.5F)
            .location(0, 0.1F, 0))

    .buildAtBlockCenter(location);

img.png

displaymodellib's People

Contributors

lordidra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.