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

Fix player head not loading correct texture #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.nitnelave.CreeperHeal</groupId>
<artifactId>CreeperHeal</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
<name>CreeperHeal</name>

<licenses>
Expand Down Expand Up @@ -52,8 +52,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -174,7 +174,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ public static CreeperBlock newBlock(BlockState state)
return new CreeperPhysicsBlock(state);
switch (state.getType())
{
case PLAYER_HEAD:
case PLAYER_WALL_HEAD:
return new CreeperPlayerHead(state);
case WHITE_BED:
case ORANGE_BED:
case MAGENTA_BED:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.nitnelave.CreeperHeal.block;

import com.nitnelave.CreeperHeal.config.CfgVal;
import com.nitnelave.CreeperHeal.config.CreeperConfig;
import org.bukkit.block.BlockState;
import org.bukkit.block.Skull;
import org.bukkit.profile.PlayerProfile;

public class CreeperPlayerHead extends CreeperBlock {
private final PlayerProfile skullOwnerProfile;
CreeperPlayerHead(BlockState blockState) {
super(blockState);
Skull skull = (Skull) blockState;
skullOwnerProfile = skull.getOwnerProfile();
}

@Override
public void update(boolean shouldDrop) {
getLocation().getChunk().load();
getBlock().setBlockData(blockData);
Skull skullState = (Skull) blockState;
skullState.setOwnerProfile(skullOwnerProfile);
blockState.update();
getWorld().playSound(getLocation(), CreeperConfig.getSound(), CreeperConfig.getInt(CfgVal.SOUND_VOLUME) / 10F, 0.1F);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author: nitnelave
authors: [Jikoo]
description: Replaces terrain destroyed by creeper explosions
softdepend: [LWC, MobArena, Factions]
api-version: 1.16
api-version: 1.19

commands:
CreeperHeal:
Expand Down