Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom skull block support #683

Merged
merged 59 commits into from
Dec 4, 2020
Merged

Conversation

BrandonKaim
Copy link
Contributor

Adds custom skulls through fake player entities! Works on player spawn and when the block is placed! I added a config option to enable it (its disabled by default to prevent lag from users who don't want them)
CustomSkull

TODO:
- Add to config as a setting
- Spawn skulls on chunk load and not only on placement
- Cleanup
- Document more
Spawns fake skulls on spawn and added a config options for those who do not want skulls. This is set to false by default just incase they don't want added lag.
Changes how rotation is calculated, adds null checks for if the skull isn't an actual player skull, and optimizes it so there are no useless packets or variables being set.
Now removes skulls on chunk unload for performance and fixed small things.
Copy link
Member

@Camotoy Camotoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good!

@rtm516 rtm516 added PR: Feature When a PR implements a new feature Work in Progress The issue is currently being worked on. labels May 29, 2020
Removed setter and made naming convention like the other caches
Fix naming conventions, change using java ids to just using the blockstate for wall directions, and a few other things.
@rtm516
Copy link
Member

rtm516 commented May 30, 2020

Will this work with skulls on armour stands?

No, not from what I understand anyway. Maybe possible in the future but out of scope I think for this PR

@@ -104,6 +107,7 @@
private InventoryCache inventoryCache;
private ScoreboardCache scoreboardCache;
private WindowCache windowCache;
private Map<Position, Long> skullCache = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with an Object2LongMap.

if (BlockStateValues.getSkullRotation(blockState) == -1) {
y += 0.25f;
switch (BlockStateValues.getWallSkullDirection().get(blockState)) {
case "north]":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way you could exclude this bracket here from the switch statement?

@Camotoy
Copy link
Member

Camotoy commented Dec 1, 2020

@Hellohi3654 fixed in the latest commit and silenced to debug mode.

@RedSmarty
Copy link

Hello, i would love to see this thing in action, but i guess u still cant find a way to get those heads working in inventory. Hmm, correct me if i am wrong. I guess i found a way, i know its not good and is heavy, but
What if u just cache a lot of player heads and automatically create a pack for those heads?
Iirc player head png's are not that heavy.
And if u can use base64, it would be more lighter, maybe u will not want to use this,
But thats only my opinion. If u thought of another way, then pls let me know.

@Camotoy
Copy link
Member

Camotoy commented Dec 4, 2020

We could do this for the player's own head, but otherwise, it's not really worth it. Especially when using standalone, we can't guarantee what player heads the player will be using in their inventory.

@RedSmarty
Copy link

RedSmarty commented Dec 4, 2020

So there's no real way to distinguish between them? I wanted this bcoz many plugins rely on heads like slimefun, companions, bag of gold, etc. Maybe allow owners to package some important heads?
Edit :- just recalled, companion needs not to be in inventories lol

@jackson-57
Copy link
Member

I think it would be helpful for server owners to be able to specify a list of player heads to add in a pack. For example, if a server owner is running Slimefun, they could use a list of Slimefun player heads. I expanded on this a few weeks ago over in the #development channel in the Discord.

@RedSmarty
Copy link

Thats what i am saying, but i think i cant explain it correctly.

@zimzaza4
Copy link

zimzaza4 commented Dec 4, 2020

When I use Slimefun, all its head names become "CS-CoreLib's head"

@MissGamerz
Copy link

maybe intergrating into head database plugin to make this possible?

@BobtheBob123456
Copy link

Hi Guys,
First of, has this been implemented yet? Secondly, doesn't bedrock already support custom skulls (https://primagames.com/tips/can-you-get-player-heads-in-minecraft-bedrock-edition-answered).

And if it doesn't, could you use a resource pack/addon like the one seen here (https://foxynotail.com/add-ons/player-heads/).

That is All

@Kas-tle
Copy link
Member

Kas-tle commented Jul 18, 2022

Merged means that the proposed changes were incorporated into Geyser, so yes this has been implemented.

The article you linked is complete misinformation and is likely just trawling for search engine clicks. Bedrock edition does not have native support for arbitrarily skinned player heads.

A resource pack would not solve the issue as we need to be able to dynamically spawn in any player head. A resource pack would require that we know what heads are going to be spawned in beforehand. In the future, please use the Discord for questions like this rather than posting on a stale pull request.

@Hellohi3654
Copy link
Contributor

Hi Guys, First of, has this been implemented yet? Secondly, doesn't bedrock already support custom skulls (https://primagames.com/tips/can-you-get-player-heads-in-minecraft-bedrock-edition-answered).

And if it doesn't, could you use a resource pack/addon like the one seen here (https://foxynotail.com/add-ons/player-heads/).

That is All

Bedrock currently doesn't support custom skulls
At least it didn't when this pull request was merged

Geyser spawns a player in the place of custom skulls and removes the body of the player model just leaving the head which gives the illusion of custom skulls for bedrock players

Only problem with doing it is that if you have a tonne of custom skulls then it can cause a lot of lag for bedrock players

You could use a resource pack like the foxy no tail one but then you couldn't have custom player skulls as you would have to have every player skin possible in the resource pack or make the player leave and rejoin to download a resource pack everytime a new player skull is created

Besides that I think the foxy no tail resource pack just creates custom mobs to recreate all the mob skulls so this probably won't solve the lag problem

@OakLoaf
Copy link

OakLoaf commented Jan 6, 2023

Will this ever work for skulls on armour stands? I am not particularly worried about placed ones so ideally would be under a different config option

@Camotoy
Copy link
Member

Camotoy commented Jan 7, 2023

I think that can now be implemented, seeing as one of our developers implemented some performance improvements for skulls. It's just a matter of somebody getting around to it.

@Kas-tle
Copy link
Member

Kas-tle commented Jan 7, 2023

When I do the block mappings PR that is on top of the block and skull system so it would be included with that, but I imagine it will be a while even once the PR is open since custom blocks are a fairly major change and will require testing (and therefore take a while).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Feature When a PR implements a new feature Work in Progress The issue is currently being worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Player heads show up as Steve heads in the bedrock edition of Minecraft