MCGravity

MCGravity By Lowbrain

Information

First of, this plugin is based on DewDD Gravity... plugin which currently doesn't support bukkit 1.10.

This plugin is intended to make minecraft more realistic by adding a new approach of real life gravity/physics.

Source code is available >>HERE<< !

PS : Make a backup of your server before you use this plugin for the first time juste in case :)

What has been done

  • Add strength multiplier
  • Remove DewDD Tr and Print dependencies
  • Clean the code (remove unnecessary comments, etc)
  • Add a configuration file (see configurations)
  • New way to calculate block stickiness/strength
  • Add reload command
  • You can now choose if you want a circular or square radius (see how it works)
  • You can now choose if you want to allow diagonal blocks or not (see how it works)
  • Add custom strength for each different types of blocks (make it more realistic)

Future plans

Performance wise, the plugin seems to work correctly. What I mean by that, it's that it doesn't seem to be slowing my server (CPU and RAM usage low). What I would like to do (or try to do) in the future is to better calculate physics. By that, I mean to add a way to calculate how much weight a block is supporting and how much can it support. Force, moment of force, etc.

How it works

When a player breaks (explosion included),places a block, it will look for the blocks around it to see if any of them are affected by the change. They are considered affected if they are no longer rooted to any other block in their strength radius. If the block has no roots, it will fall and it goes on and on until there is either no more blocks related or they all have roots.

For example, if you chop the bottom block of a three, the whole three will fall down.

Event

Gravity will only be applied when block breaks, explode or is placed.

Strength multiplier

  • The basics : the larger you build the stronger it is.
  • What it does : it looks around a block to see if there's other blocks that supports it. A support is considered a block with 2 or more connection (connected to another block) and must be connected to the main block. The amount of connected block is then multiplied by 0.25(configurable). Now you got you multiplier. Strength = regular strength * multiplier.

Circular vs square radius

A circular radius will be more realistic because instead of comparing the Z and X distance with the block's strength, it will compare the distance between the two blocks which will result in a more circular radius. A square radius just means a block with a strength of 5 will support a radius of 5 by 5.

Allowing diagonal

Allowing diagonal means that two blocks placed in diagonal (and not directly next to it) to each other are considered bonded.

Block's strength

The block's strength is the amount the block can't support (see radius) before they start falling. Be aware that for example, if you make a post out of obsidian (strength = 15) but uses wood plank (strength = 6) for your transversal beam, blocks will start falling after 6 since wood plank has a weaker strength and can only support 6 blocks.

You can also use a fix strength for all block by changing the configuration file.

Configurations

CONFIG_GRAVITY_MAXTIME_DO_THE_JOB
  • default value : 1000
  • description : Maximum time in millisecond the thread has to calculate everything. If the thread can't finish the job in time, it will stop for a bit then start again. Lower value will make it less fluid but improves performance (you shouldn't really need 1000ms but who knows)
CONFIG_GRAVITY_REPEAT_CHECKING_DELAY_AS_TICK
  • default value : 1
  • description : refresh rate in ticks. Lower value equals more fluid but can lower performance (didn't notice any compare to 20)
CONFIG_GRAVITY_STRENGTH_RADIUS ===-
  • default value : 5
  • description : fixed strength radius used when use_fixed_strength is true
CONFIG_GRAVITY_USE_FIXED_STRENGTH
  • default value : false
  • description : enable fixed strength(radius). When this is true, every blocks will have the same strength
CONFIG_GRAVITY_USE_SQUARE_RADIUS
  • default value : false
  • description : enable or disable square radius. true = square, false = circular
CONFIG_GRAVITY_USE_STRENGTH_MULTIPLIER
  • default value : true
  • description : whether or not you want to use the new strength multiplier
CONFIG_GRAVITY_STRENGTH_MULTIPLIER
  • default value : 0.25
  • description : the number that multiply the amount of connected blocks to get the total multiplier.

Commands

Reload

  • usage : /MCGravity reload
  • description : reload the current plugin using the modified or not config file.
  • permission : MCgravity.reload

Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    100764
  • Created
    Jun 28, 2016
  • Last Released File
    Jun 29, 2016
  • Total Downloads
    917
  • License

Categories

Members

Recent Files