mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-25 07:33:44 +02:00 
			
		
		
		
	Compare commits
	
		
			11 Commits
		
	
	
		
			renovate/g
			...
			fix/stop-i
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | e2bb8a4b32 | ||
|   | c523feeb79 | ||
|   | 958c66b28f | ||
|   | c656190e14 | ||
|   | e914cb210e | ||
|   | 94c6af74d2 | ||
|   | ebb82bd66d | ||
|   | 66f907eb5d | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 9ffede2c5c | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | 97172df0dc | ||
| ![renovate[bot]](/assets/img/avatar_default.png)  | c9746b182c | 
| @@ -11,7 +11,7 @@ jobs: | ||||
|           DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||||
|           DISCORD_USERNAME: PlotSquared Release | ||||
|           DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png | ||||
|         uses: Ilshidur/action-discord@08d9328877d6954120eef2b07abbc79249bb6210 # ratchet:Ilshidur/action-discord@0.3.2 | ||||
|         uses: Ilshidur/action-discord@0.3.2 | ||||
|         with: | ||||
|           args: | | ||||
|             "<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>" | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
								
							| @@ -11,7 +11,7 @@ jobs: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|         uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1 | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
|   | ||||
							
								
								
									
										6
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -11,7 +11,7 @@ jobs: | ||||
|       - name: Checkout Repository | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Validate Gradle Wrapper | ||||
|         uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6 # v1 | ||||
|         uses: gradle/wrapper-validation-action@v1 | ||||
|       - name: Setup Java | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
| @@ -43,7 +43,7 @@ jobs: | ||||
|           ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||||
|       - name: Publish core javadoc | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}} | ||||
|         uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 | ||||
|         uses: cpina/github-action-push-to-another-repository@main | ||||
|         env: | ||||
|           SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||||
|         with: | ||||
| @@ -55,7 +55,7 @@ jobs: | ||||
|           target-directory: v7/core | ||||
|       - name: Publish bukkit javadoc | ||||
|         if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}} | ||||
|         uses: cpina/github-action-push-to-another-repository@0a14457bb28b04dfa1652e0ffdfda866d2845c73 # main | ||||
|         uses: cpina/github-action-push-to-another-repository@main | ||||
|         env: | ||||
|           SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||||
|         with: | ||||
|   | ||||
							
								
								
									
										6
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							| @@ -22,10 +22,10 @@ jobs: | ||||
|       - name: Checkout repository | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Initialize CodeQL | ||||
|         uses: github/codeql-action/init@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2 | ||||
|         uses: github/codeql-action/init@v2 | ||||
|         with: | ||||
|           languages: ${{ matrix.language }} | ||||
|       - name: Autobuild | ||||
|         uses: github/codeql-action/autobuild@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2 | ||||
|         uses: github/codeql-action/autobuild@v2 | ||||
|       - name: Perform CodeQL Analysis | ||||
|         uses: github/codeql-action/analyze@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2 | ||||
|         uses: github/codeql-action/analyze@v2 | ||||
|   | ||||
| @@ -18,6 +18,8 @@ | ||||
|  */ | ||||
| package com.plotsquared.bukkit.schematic; | ||||
|  | ||||
| import com.destroystokyo.paper.profile.PlayerProfile; | ||||
| import com.destroystokyo.paper.profile.ProfileProperty; | ||||
| import com.plotsquared.bukkit.util.BukkitUtil; | ||||
| import com.sk89q.jnbt.ByteTag; | ||||
| import com.sk89q.jnbt.CompoundTag; | ||||
| @@ -28,13 +30,20 @@ import com.sk89q.jnbt.Tag; | ||||
| import com.sk89q.worldedit.blocks.BaseItemStack; | ||||
| import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||||
| import com.sk89q.worldedit.world.item.ItemType; | ||||
| import io.papermc.lib.PaperLib; | ||||
| import org.apache.logging.log4j.LogManager; | ||||
| import org.apache.logging.log4j.Logger; | ||||
| import org.bukkit.Bukkit; | ||||
| import org.bukkit.ChatColor; | ||||
| import org.bukkit.DyeColor; | ||||
| import org.bukkit.World; | ||||
| import org.bukkit.block.Banner; | ||||
| import org.bukkit.block.Block; | ||||
| import org.bukkit.block.Container; | ||||
| import org.bukkit.block.Sign; | ||||
| import org.bukkit.block.Skull; | ||||
| import org.bukkit.block.banner.Pattern; | ||||
| import org.bukkit.block.banner.PatternType; | ||||
| import org.bukkit.enchantments.Enchantment; | ||||
| import org.bukkit.inventory.Inventory; | ||||
| import org.bukkit.inventory.ItemStack; | ||||
| @@ -45,11 +54,15 @@ import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Map.Entry; | ||||
| import java.util.Objects; | ||||
| import java.util.UUID; | ||||
|  | ||||
| public class StateWrapper { | ||||
|  | ||||
|     public org.bukkit.block.BlockState state = null; | ||||
|     public CompoundTag tag = null; | ||||
|     public CompoundTag tag; | ||||
|  | ||||
|     private boolean paperErrorTextureSent = false; | ||||
|     private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + StateWrapper.class.getSimpleName()); | ||||
|  | ||||
|     public StateWrapper(CompoundTag tag) { | ||||
|         this.tag = tag; | ||||
| @@ -227,15 +240,64 @@ public class StateWrapper { | ||||
|                         return true; | ||||
|                     } | ||||
|                     String player = skullOwner.getString("Name"); | ||||
|                     if (player == null || player.isEmpty()) { | ||||
|  | ||||
|                     if (player != null && !player.isEmpty()) { | ||||
|                         try { | ||||
|                             skull.setOwningPlayer(Bukkit.getOfflinePlayer(player)); | ||||
|                             skull.update(true); | ||||
|                         } catch (Exception e) { | ||||
|                             e.printStackTrace(); | ||||
|                         } | ||||
|                         return true; | ||||
|                     } | ||||
|  | ||||
|                     final CompoundTag properties = (CompoundTag) skullOwner.getValue().get("Properties"); | ||||
|                     if (properties == null) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     try { | ||||
|                         skull.setOwningPlayer(Bukkit.getOfflinePlayer(player)); | ||||
|                         skull.update(true); | ||||
|                     } catch (Exception e) { | ||||
|                         e.printStackTrace(); | ||||
|                     final ListTag textures = properties.getListTag("textures"); | ||||
|                     if (textures.getValue().isEmpty()) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     final CompoundTag textureCompound = (CompoundTag) textures.getValue().get(0); | ||||
|                     if (textureCompound == null) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     String textureValue = textureCompound.getString("Value"); | ||||
|                     if (textureValue == null) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     if (!PaperLib.isPaper()) { | ||||
|                         if (!paperErrorTextureSent) { | ||||
|                             paperErrorTextureSent = true; | ||||
|                             LOGGER.error("Failed to populate skull data in your road schematic - This is a Spigot limitation."); | ||||
|                         } | ||||
|                         return false; | ||||
|                     } | ||||
|                     final PlayerProfile profile = Bukkit.createProfile(UUID.randomUUID()); | ||||
|                     profile.setProperty(new ProfileProperty("textures", textureValue)); | ||||
|                     skull.setPlayerProfile(profile); | ||||
|                     skull.update(true); | ||||
|                     return true; | ||||
|  | ||||
|                 } | ||||
|                 return false; | ||||
|             } | ||||
|             case "banner" -> { | ||||
|                 if (state instanceof Banner banner) { | ||||
|                     List<Tag> patterns = this.tag.getListTag("Patterns").getValue(); | ||||
|                     if (patterns == null || patterns.isEmpty()) { | ||||
|                         return false; | ||||
|                     } | ||||
|                     banner.setPatterns(patterns.stream().map(t -> (CompoundTag) t).map(compoundTag -> { | ||||
|                         DyeColor color = DyeColor.getByWoolData((byte) compoundTag.getInt("Color")); | ||||
|                         PatternType patternType = PatternType.getByIdentifier(compoundTag.getString("Pattern")); | ||||
|                         if (color == null || patternType == null) { | ||||
|                             return null; | ||||
|                         } | ||||
|                         return new Pattern(color, patternType); | ||||
|                     }).filter(Objects::nonNull).toList()); | ||||
|                     banner.update(true); | ||||
|                     return true; | ||||
|                 } | ||||
|                 return false; | ||||
|   | ||||
| @@ -103,7 +103,7 @@ public class Done extends SubCommand { | ||||
|                 public void run(PlotAnalysis value) { | ||||
|                     plot.removeRunning(); | ||||
|                     boolean result = | ||||
|                             value.getComplexity(doneRequirements) <= doneRequirements.THRESHOLD; | ||||
|                             value.getComplexity(doneRequirements) >= doneRequirements.THRESHOLD; | ||||
|                     finish(plot, player, result); | ||||
|                 } | ||||
|             }); | ||||
|   | ||||
| @@ -20,7 +20,6 @@ package com.plotsquared.core.plot; | ||||
|  | ||||
| import com.google.common.collect.ImmutableSet; | ||||
| import com.google.common.collect.Lists; | ||||
| import com.google.common.collect.Sets; | ||||
| import com.google.inject.Inject; | ||||
| import com.plotsquared.core.PlotSquared; | ||||
| import com.plotsquared.core.command.Like; | ||||
| @@ -2418,7 +2417,6 @@ public class Plot { | ||||
|         if (!this.isMerged()) { | ||||
|             Location pos1 = this.getBottomAbs().withY(getArea().getMinBuildHeight()); | ||||
|             Location pos2 = this.getTopAbs().withY(getArea().getMaxBuildHeight()); | ||||
|             this.connectedCache = Sets.newHashSet(this); | ||||
|             CuboidRegion rg = new CuboidRegion(pos1.getBlockVector3(), pos2.getBlockVector3()); | ||||
|             return Collections.singleton(rg); | ||||
|         } | ||||
|   | ||||
| @@ -17,7 +17,7 @@ plugins { | ||||
|     eclipse | ||||
|     idea | ||||
|  | ||||
|     id("xyz.jpenilla.run-paper") version "2.0.1" | ||||
|     id("xyz.jpenilla.run-paper") version "2.1.0" | ||||
| } | ||||
|  | ||||
| group = "com.plotsquared" | ||||
| @@ -77,12 +77,12 @@ subprojects { | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         implementation(platform("com.intellectualsites.bom:bom-newest:1.25")) | ||||
|         implementation(platform("com.intellectualsites.bom:bom-newest:1.27")) | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         // Tests | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") | ||||
|         testImplementation("org.junit.jupiter:junit-jupiter:5.9.3") | ||||
|     } | ||||
|  | ||||
|     plugins.withId("java") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user