Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
${{ steps.paper-version.outputs.paper_details }}
call-publish-workflow:
name: Call publish workflow
uses: westkevin12/MockMC/.github/workflows/publish.yml@v1.21
uses: SecondLifeGaming/MockMC/.github/workflows/publish.yml@master
needs: tag
if: ${{ needs.tag.outputs.version != null }}
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ being the name of your branch you created earlier.

To create the pull request, head back to your fork on GitHub, and go to the `Pull Requests` tab, and click
the `New Pull Request` button.
On the left, make sure `Base repository` is set to `westkevin12/MockMC` and the branch next to it is set to the
On the left, make sure `Base repository` is set to `SecondLifeGaming/MockMC` and the branch next to it is set to the
latest version (e.g. `v1.20`).
On the right, make sure `Head repoitory` is set to `Usename/MockMC` with `Username` being your GitHub username and
the branch being the new branch you created.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ signing {
}

fun isAction(): Boolean {
return System.getenv("GITHUB_ACTIONS") == "true" && System.getenv("GITHUB_REPOSITORY") == "westkevin12/MockMC"
return System.getenv("GITHUB_ACTIONS") == "true" && System.getenv("GITHUB_REPOSITORY") == "SecondLifeGaming/MockMC"
}

fun getFullVersion(): String {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/mockmc/mockmc/MockMCExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,14 @@ private void injectMocksIntoFields(Object testInstance, @NotNull ExtensionContex
try
{
var constructor = type.getDeclaredConstructor();
constructor.setAccessible(true);
return constructor.newInstance();
} catch (ReflectiveOperationException e)
} catch (ReflectiveOperationException _)
{
return null;
}
}

@SuppressWarnings("deprecation")
private @NotNull <T extends Entity> EntityMock getEntityMock(Class<T> clazz)
{
return (EntityMock) getFirstWorld().spawn(getLocation(), clazz);
Expand Down Expand Up @@ -409,7 +409,7 @@ public void handleTestExecutionException(ExtensionContext context, Throwable thr
logger.info(HORIZONTAL_DIVIDER);
logger.info("");
logger.info("To help us out, please open an issue on our GitHub repository with this information at");
logger.info("https://github.com/westkevin12/MockMC/issues/new?template=feature_request.yml");
logger.info("https://github.com/SecondLifeGaming/MockMC/issues/new?template=feature_request.yml");
logger.info("or consider contributing by submitting a pull request. \uD83D\uDCAA");
logger.info("");
logger.info("Your support and contributions keep the MockMC magic alive.");
Expand Down
30 changes: 10 additions & 20 deletions src/test/java/org/mockmc/mockmc/block/data/BlockDataMockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
import static org.junit.jupiter.api.Assertions.assertThrowsExactly;
import static org.junit.jupiter.api.Assertions.assertTrue;

@SuppressWarnings(
{"deprecation", "removal", "unchecked"})
@SuppressWarnings("removal")
@Slf4j
@ExtendWith(
{MockMCExtension.class})
Expand Down Expand Up @@ -177,18 +176,6 @@ class GetAsString
@Test
void test_getAsString()
{
// https://jd.papermc.io/paper/1.16/org/bukkit/block/data/BlockData.html#getAsString(boolean)
// defaults:
// "minecraft:chest": {
// "facing": "north",
// "type": "single",
// "waterlogged": false
// },
//
// getAsString(true) : minecraft:chest[waterlogged=true]
// getAsString(false):
// minecraft:chest[facing=north,type=single,waterlogged=true]
// getAsString() : minecraft:chest[facing=north,type=single,waterlogged=true]

BlockDataMock data = BlockDataMockFactory.mock(Material.CAMPFIRE);
assertEquals("minecraft:campfire", data.getAsString(true));
Expand All @@ -199,7 +186,7 @@ void test_getAsString()
}

/*
* See: https://github.com/westkevin12/MockMC/issues/1433
* See: https://github.com/SecondLifeGaming/MockMC/issues/1433
*/
@ParameterizedTest
@CsvSource(
Expand Down Expand Up @@ -302,20 +289,23 @@ void test_getAsString()
"'WEATHERED_COPPER_DOOR', 'minecraft:weathered_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false]'",
"'WEATHERED_COPPER_TRAPDOOR', 'minecraft:weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false]'",
"'WEATHERED_CUT_COPPER_STAIRS', 'minecraft:weathered_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false]'",})
void givenSamples(Material material, String expectedOutput)
void assertBlockDataAsString(Material material, String expectedOutput)
{
var blockData = material.createBlockData();
var actual = blockData.getAsString(false);
assertEquals(expectedOutput, actual);
}

void givenSamples(Material material, String expectedOutput)
{
assertBlockDataAsString(material, expectedOutput);
}

@ParameterizedTest
@CsvFileSource(resources = "/blocks/block_data_as_string.csv")
void givenPossibleValues(Material material, String expectedOutput)
{
var blockData = material.createBlockData();
var actual = blockData.getAsString(false);
assertEquals(expectedOutput, actual);
assertBlockDataAsString(material, expectedOutput);
}
}

Expand Down Expand Up @@ -424,7 +414,7 @@ static Stream<Arguments> getPossibleBlockData()
}

blockDataMocks.add(material);
} catch (UnimplementedOperationException e)
} catch (UnimplementedOperationException _)
{
log.warn("Material {} is throwing an UnimplementedOperationException", material);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

@SuppressWarnings(
{"deprecation", "removal", "unchecked"})
{"deprecation", "removal"})
@ExtendWith(MockMCExtension.class)
class BlockStateMockTest
{
Expand Down Expand Up @@ -287,8 +287,8 @@ private static Stream<Arguments> getMaterialAndStates()
Arguments.of(Material.BAMBOO_SIGN, org.mockmc.mockmc.block.state.SignStateMock.class),
Arguments.of(Material.CRIMSON_SIGN, org.mockmc.mockmc.block.state.SignStateMock.class),
Arguments.of(Material.WARPED_SIGN, org.mockmc.mockmc.block.state.SignStateMock.class),
// Hanging Sign (TODO: Not implemented yet, see issue
// https://github.com/westkevin12/MockMC/issues/1088)
// Hanging Sign (Not implemented yet, see issue
// https://github.com/SecondLifeGaming/MockMC/issues/1088)
// Arguments.of(Material.OAK_HANGING_SIGN,
// org.mockmc.mockmc.block.state.HangingSignMock.class),
// Arguments.of(Material.SPRUCE_HANGING_SIGN,
Expand All @@ -311,8 +311,8 @@ private static Stream<Arguments> getMaterialAndStates()
// org.mockmc.mockmc.block.state.HangingSignMock.class),
// Arguments.of(Material.WARPED_HANGING_SIGN,
// org.mockmc.mockmc.block.state.HangingSignMock.class),
// Wall Sign (TODO: Not implemented yet, see issue
// https://github.com/westkevin12/MockMC/issues/1088)
// Wall Sign (Not implemented yet, see issue
// https://github.com/SecondLifeGaming/MockMC/issues/1088)
// Arguments.of(Material.OAK_WALL_SIGN,
// org.mockmc.mockmc.block.data.WallSignMock.class),
// Arguments.of(Material.SPRUCE_WALL_SIGN,
Expand All @@ -331,8 +331,8 @@ private static Stream<Arguments> getMaterialAndStates()
// org.mockmc.mockmc.block.state.WallSignMock.class),
// Arguments.of(Material.BAMBOO_WALL_SIGN,
// org.mockmc.mockmc.block.state.WallSignMock.class),
// Wall Hanging Sign (TODO: Not implemented yet, see issue
// https://github.com/westkevin12/MockMC/issues/1088)
// Wall Hanging Sign (Not implemented yet, see issue
// https://github.com/SecondLifeGaming/MockMC/issues/1088)
// Arguments.of(Material.OAK_WALL_HANGING_SIGN,
// org.mockmc.mockmc.block.state.WallHangingSignMock.class),
// Arguments.of(Material.SPRUCE_WALL_HANGING_SIGN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void givenAnyChangeExecutedInTheMirrorItem_ShouldBeAppliedInTheOriginal()
}

/*
* See: https://github.com/westkevin12/MockMC/issues/1449
* See: https://github.com/SecondLifeGaming/MockMC/issues/1449
*/
@Test
void fileSerializationAndDeserializationShouldSucceed(@TempDir Path tempDir) throws IOException
Expand Down
Loading