Coder Social home page Coder Social logo

lanternpowered / lantern Goto Github PK

View Code? Open in Web Editor NEW
109.0 17.0 12.0 16.58 MB

An open-source Minecraft server that implements the SpongeAPI.

License: MIT License

Java 91.23% Kotlin 8.77%
minecraft server minecraft-server sponge lantern spongeapi java

lantern's Introduction

Lantern Build Status Discord

A open source and compatible Minecraft server that implements the SpongeAPI. It is licensed under the MIT License.

Prerequisites

Clone

The following steps will ensure your project is cloned properly.

  1. git clone --recursive https://github.com/LanternPowered/Lantern.git
  2. cd Lantern

Building

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

In order to build LanternServer you simply need to run the gradle build command. You can find the compiled JAR file in ./build/libs labeled similarly to 'lanternserver-x.x.x-SNAPSHOT.jar'.

IDE Setup

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

For Eclipse

  1. Run gradle eclipse
  2. Run gradle genEclipseRunConfigurations
  3. Import LanternServer as an existing project (File > Import > General)
  4. Select the root folder for LanternServer
  5. Check LanternServer when it finishes building and click Finish

For IntelliJ

  1. Make sure you have the Gradle plugin enabled (File > Settings > Plugins)
  2. Click File > New > Project from Existing Sources > Gradle and select the root folder for LanternServer
  3. Select Use customizable gradle wrapper if you do not have Gradle installed.
  4. Once the project is loaded, run gradle genIntelliJRunConfigurations
  5. IntelliJ will now ask to reload the project, click Yes

lantern's People

Contributors

cybermaxke avatar gitter-badger avatar parlough avatar zephirenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lantern's Issues

Beds

Bed system:

  • Ability to place beds

  • Ability for players to enter beds and sleep while it's night

  • Don't allow player to sleep if they are too far away

  • Don't allow player to sleep if they are on fire

  • Cannot sleep if a monster is within 8 blocks horizontally(each axis) and 5 blocks vertically

  • Do not let a player sleep in an already occupied bed

  • Cause beds to explode(power 5) in nether or end when player tries to use it, setting fire to blocks around it.

  • Skip the night if all players are sleeping(maybe introduce an optional percentage in some config)

  • Set the player's spawn location once they sleep in the bed - Also goes along with spawnpoint command

  • Low priority - Falling onto a bed will bounce entities with 66% strength and reduce fall damage by 50%

Benefits?

Hey there!

I was just wondering what the benefits of using Lantern over Sponge are. I don't mean to sound rude, so I hope I don't come off like that.

Thanks :)

General To-Do list and problems for me and others

  • Cannot retrieve the item in player's hand, attempts to use some equipment system for it at the moment, but does not work - Fixed in 3720773?

  • No supplier for ItemStack.Builder - Fixed in cb2eb49

  • BlockRays do not work properly if at all - Test this more

  • Noteblocks do not function - Fixed in 337f846

  • Cannot spawn some types of rails

  • Grabbing spawn eggs removes their type - Waiting on more entity work - wait for 1.13

  • Cannot spawn jukebox(or I assume place disks in them) -
    Fixed in ca0ec58

  • All durability items like swords, pickaxes, and armor spawn with "unbreakable" tag. Durability is currently not implemented.

  • Multiplayer kind of works, but player location is not updated for others, so people don't move - Fixed in dbd0be5

  • It seems to be raining more than it should? - Fixed in f7f926b?

  • Setting user on fire with Nucleus for x ticks leaves them on fire indefinitely

  • Nucleus spawn does not think set location is safe sometimes

  • Keep getting warning about attempted offer of item durability to a fishing pole - Fixed in 627db57

  • Nucleus cannot set vanish status nor can I

  • Dropping item physics is strange. Doesn't project out and falls SUPER slowly, sometimes they will float a few blocks in the air

  • Sometimes item entities will fall through the ground

  • Breaking blocks does not drop them

  • No message(neither chat or action bar) sent when trying to build over 256 - Fixed in 91d0e88

  • Unlocks recipes every time you join

  • You can spawn the default heads but you cannot place them

  • Sometimes moving and throwing stacks out of your inventory loses them

  • Clearing inventory with nucleus say it's successful, but does not appear empty again until you try to click something or move something - Fixed in 995694a

  • It seems I can place doors, but when I relog they are gone and the door appears back in my inventory.

  • Url Parser is a bit off - Optional.get() is considered a link

  • Can sometimes leave world border

  • Still sends leave message if player is banned

Walking over magma blocks does not hurt you(need to make a new behavior) Moved to #20
Falling into the void doesn't kill you, just keeps going forever Moved to #20
Attacking, taking damage, running, swimming, and jumping don't take your exhaustion away Moved to #20
Can spawn bed but cannot place one Moved to #21

Commands to implement

This is waiting on 1.13 and the command refactor as we would have to recreate a lot of them then anyways.

MC Commands To Implement

  • /advancement

  • /blockdata

  • /clear

  • /clone -

  • /debug idk

  • /defaultgamemode

  • /effect

  • /enchant

  • /entitydata

  • /execute

  • /fill

  • /function - Functions are complicated

  • /give

  • /locate - We need to make this better than Minecraft's

  • /recipe

  • /reload - Can reload more than loot tables, advancements, and functions. Possibly lantern configs

  • /replaceitem

  • /save-all - Is this necessary?

  • /save-on and /save-off - Kind of strange. Low priority

  • /setblock

  • /setmaxplayers - This is a PE only feature, maybe we should add it as a rule? Or is it somewhere already?

  • /spawnpoint

  • /spreadplayers - This command is cool

  • /stats

  • /summon

  • /tellraw - Not sure how useful this is

  • /testfor These test for commands are strange

  • /testforblock

  • /testforblocks

  • /trigger

  • /wsserver - Okay this is PE only but could be interesting to implement Is client side or for proxies (velocity, bungeecoord)

  • /xp

Sponge/Other Commands To Implement

  • /get-data

  • /spawn - Makes sense to spawn the other spawn commands

  • /lantern version

  • /lantern plugin list - Not sure how to set up this and the other plugin commands

  • /lantern plugin info

  • /lantern plugin reload

  • /lantern plugin reloadall

  • /lantern timings

  • /lantern info/chunk/etc

Material concept

We need a material based concept, like in vanilla mc:
http://minecraft.gamepedia.com/Materials
These groups are used in multiple cases, one of these is defining which instrument will be used by a note block.

A thing to considers is to restructure the block properties so that these define the material of a block. Or a independent system, which seems silly if you can epand an existing system. I will need to think about about this before I start changing things.

Gradle generates wrapper on every import it seems

This makes me have to remove the wrapper changes from my commits as it causes unnecessary changes and slows down import times. Would be best to make the wrapper task run only on demand for when we truly want to update it.

You can see this how in a lot of your commits, the wrapper dates change.

Plugin/injection mistakes

You can easily make some mistakes when making a plugin and using injection. It would nice if we could catch these issues prematurely, the same could be done for sponge. A few examples:

  • Using java.util.logging.Logger instead of org.slf4j.Logger (org.apache.logging.log4j.Logger could also work, but is not available in the standard sponge api environment) minecraft-dev/MinecraftDev#361
  • Using wrong Named annotations with injection. The org.spongepowered.api.event.filter.cause.Named annotation got removed.
    • com.google.inject.name.Named - YES
    • javax.inject.Named - YES
    • org.spongepowered.api.event.filter.cause.Named - NO
  • Missing @Listener on listener methods. Could be warned about by checking if the method is never called and has a valid listener signature. MinecraftDev marks event methods as used/unused if a event method is/isn't annotated.
  • ...

A annotation processor could help warn about these issues at compile time.
MinecraftDev supports a lot of features that help with these problems so it's recommend to use that plugin.

NoClassDefFoundError: it/unimi/dsi/fastutil/ints/IntArraySet

I've just locally built and wanted to try this out (for the first time), but FYI upon connecting hit this:

โžœ  LanternServer git:(master) java -jar build/libs/lanternserver-1.0.0-SNAPSHOT-fat.jar
[03:05:54] [main/INFO]: Instantiated the Injector in production mode.
[03:05:54] [main/INFO]: Starting Lantern Server 1.0.0-SNAPSHOT
[03:05:54] [main/INFO]:    for  Minecraft 1.12.2 with protocol version 340
[03:05:54] [main/INFO]:    with SpongeAPI 7.0.0-SNAPSHOT
[03:05:54] [main/INFO]: Searching for plugins...
[03:05:54] [main/INFO]: 0 plugin(s) found
[03:05:56] [main/INFO]: Epoll is enabled.
[03:05:57] [main/INFO]: Successfully bound to: /0:0:0:0:0:0:0:0%0:25565
[03:05:57] [main/INFO]: Ready for connections.
[03:05:57] [main/INFO] [world/Overworld]: Generating spawn volume...
[03:05:57] [main/INFO] [world/Overworld]: Finished generating spawn volume.
[03:06:42] [async-0/INFO]: Finished authenticating.
[03:06:42] [server/INFO]: michaelpapa7: Skip forge handshake.
[03:06:43] [server/ERROR]: Error while handling org.lanternpowered.server.network.forge.message.type.handshake.MessageForgeHandshakeInStart@11f10d58
java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/ints/IntArraySet
	at org.lanternpowered.server.inventory.client.ClientContainer.<init>(ClientContainer.java:364) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.inventory.client.PlayerClientContainer.<init>(PlayerClientContainer.java:61) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.inventory.PlayerInventoryContainer.<init>(PlayerInventoryContainer.java:49) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.entity.living.player.LanternPlayer.<init>(LanternPlayer.java:260) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.network.NetworkSession.initPlayer(NetworkSession.java:819) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.network.forge.message.handler.handshake.HandlerForgeHandshakeInStart.handle(HandlerForgeHandshakeInStart.java:80) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.network.forge.message.handler.handshake.HandlerForgeHandshakeInStart.handle(HandlerForgeHandshakeInStart.java:47) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.network.NetworkSession.handleMessage(NetworkSession.java:254) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.network.NetworkSession.pulse(NetworkSession.java:461) ~[?:1.0.0-SNAPSHOT]
	at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4649) ~[?:1.8.0_151]
	at java.util.Collections$SetFromMap.forEach(Collections.java:5476) ~[?:1.8.0_151]
	at org.lanternpowered.server.network.NetworkManager.pulseSessions(NetworkManager.java:100) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.LanternServer.pulse(LanternServer.java:370) ~[?:1.0.0-SNAPSHOT]
	at org.lanternpowered.server.LanternServer.lambda$start$2(LanternServer.java:290) ~[?:1.0.0-SNAPSHOT]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_151]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_151]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_151]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_151]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.ClassNotFoundException: it.unimi.dsi.fastutil.ints.IntArraySet
	at org.lanternpowered.launch.LanternClassLoader.findClass(LanternClassLoader.java:486) ~[lanternserver-1.0.0-SNAPSHOT-fat.jar:1.0.0-SNAPSHOT]
	at org.lanternpowered.launch.LanternClassLoader.loadClass(LanternClassLoader.java:447) ~[lanternserver-1.0.0-SNAPSHOT-fat.jar:1.0.0-SNAPSHOT]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_151]
	... 21 more
> 

I loved how much faster than Sponge Vanilla it appears to start up... now if only it actually worked! ๐Ÿ˜„

Enchanting

Enchanting is a pretty cool system in Minecraft, let's add it ;)

Features -

Experience:

  • Ability to offer and get the various experience keys from a player
  • Gain experience from furnace and from certain kills
  • Lose experience from dying and enchanting

Enchantment table:

  • Ability to place and break the enchantment table tile entity
  • Ability to open the enchantment window
  • Ability to place lapis in lapis slot
  • Display all three enchantment choices
  • Ability to actually enchant item in input slot
  • Ability to enchant books as well

Anvil:

  • Ability to repair items with experience and items, or by combining them
  • Ability to move book enchantments to items
  • Do they do anything else? I suppose hurt you when they fall on you.

Enchantments:

  • Aqua Affinity - Increases underwater mining rate
  • Bane of Arthropods - Increases damage to arthropods
  • Blast protection - Reduces explosion damage
  • Curse of binding - Prevents removal
  • Curse of vanishing - Item destroyed on death
  • Depth strider - Increases underwater movement speed
  • Efficiency - Increases mining speed
  • Feather falling - Reduces fall damage
  • Fire aspect - Sets target on fire
  • Fire protection - Reduces fire damage
  • Flame - Arrows set target on fire
  • Fortune - Increases block drops
  • Frost walker - Walk on water
  • Infinity - Shooting consumes no arrows
  • Knockback - Increases knockback
  • Looting - Increases mob loot
  • Luck of the sea - Increases fhishing luck
  • Lure - Increases fishing rate
  • Mending - Repair with experience
  • Power - Increases arrow damage
  • Projectile protection - Reduces projectile damage
  • Protection - Reduces most damage
  • Punch - Increases arrow knockback
  • Respiration - Extends underwater breathing time
  • Sharpness - Increases damage
  • Silk touch - Mined blocks drop themselves
  • Smite - Increases damage to undead
  • Sweeping edge - Increases sweeping attack damage
  • Thorns - Damages attackers
  • Unbreaking - Increases effective durability

Extra:

I was wondering if we could maybe allow a few things through an enchantment config file in the asset folder?

  • Allow table to remember and keep lapis contents
  • Allow the changing of the material required for enchantment
  • Allow a multiplier for amount of item consumed to be set, or to disable completely

APIs we should look into adding to Sponge over time for our own implementation purposes

This is more of a Sponge issue but these are some general APIs that could/should be added to Sponge that we have already implemented in a fashion or will eventually.


  • Functions? Probably not useful but maybe

  • Per world spawn protection config

  • Anything else we think of

Death/damage/health/food system

Food and health system:
#42

  • Being able to die and respawn

Food exhaustion:

  • Swimming
  • Sprinting
  • Jumping
  • Jumping while sprinting
  • Attacking
  • Hunger/food poisoning effect
  • Regeneration
  • Damage
  • Breaking blocks

Heal sources:

  • Potion effects
  • Natural generation
  • Etc. add more

Damage sources:

  • Entity on fire
  • Fall damage
  • Falling into the void
  • Stepping over magma blocks
  • Stepping against cactus blocks
  • Suffocation
  • Lava
  • Wither effect
  • Poison
  • Explosions
  • Drowning
  • Lightning
  • Entities
    • Anvil hit damage
    • Firework explosion
    • Living entity attack
  • Snowballs against blazes
  • Etc. add more

Misc:

  • Critical hits
  • Boats taking damage

Optimize the usage of DataTransactionResults

Currently are a lot of DataTransactionResults generated through offer or remove methods and these results are most of the time not used. This could be improved by checking if the result is used on bytecode level and replacing the method call with one that doesn't generate a DataTransactionResult. This would require all the loaded classes to be transformed, another benefit is that this would also be applied to plugins.

This improvement can also be applied to official sponge implementations.

This is a low priority, but it would be nice if it could be done in the future.

Bintray Forbidden

I tried compiling, but the Bintray artifact leads to 403 forbidden.

Timings support

This is fairly low priority, as it does not have much use for now, but should definitely be taken on eventually. Some plugins depend on it and overall it will be nice for performance profiling.

I will probably handle this in a while as I have some of the work already done.

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.