GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GregTech/CODESTYLE.md at master · GregTechCEu/GregTech

Expand file tree

/

CODESTYLE.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
25 lines (20 loc) · 1.25 KB
/

CODESTYLE.md

Copy path

File metadata and controls

25 lines (20 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

It's recommended to use Intellij Idea as IDE, as it provides many powerful inspections to check & cleanup your code.

Naming conventions:

  • Standard java class naming convention (UpperCamelCase)
  • Standard java field & method naming convention (lowerCamelCase)
  • lower_camel_case for registry entries, string constant identifiers and keys

Class conventions:

  • Do not add unused code, like public modifiers in interfaces (tip: IDEA reports these just fine)
  • Fields are always declared in top of class
  • Use this.someField when changing self field value (makes code easier to understand without IDE)
  • Dedicate big logic into multiple methods
  • Do not have >1 nested classes, just create them in dedicated source files
  • Use blanks lines to dedicate logic statements in methods.

Minecraft-specific:

  • Avoid marking things as tickable or having tile entities unless absolutely required.
  • If creating interface in API, it's recommended to implement it as capability.
  • Implement capabilities in dedicated classes.
  • Always use GTLog.logger for logging purposes.
  • Use mutable block pos if doing something often or comparing many blocks (and mutable objects in general)
  • Prefer widget system to direct drawing in UI.

Failing to match these will get your changes 100% rejected.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.