Skip to content

Commit

Permalink
more fiexeds
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 13, 2024
1 parent f14a131 commit fd23ce8
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public class BlockRegistration {

@SafeVarargs
public static <V extends Block> V add(String id, V block, Consumer<Block>... additionalActions) {
return Registry.register(Registries.BLOCK, locate(id), block);
var registeredBlock = Registry.register(Registries.BLOCK, locate(id), block);
for (var action : additionalActions) {
action.accept(registeredBlock);
}
return registeredBlock;
}

static class ParadiseLostFarmlandBlock extends FarmlandBlock {
Expand All @@ -49,7 +53,7 @@ static class ParadiseLostStairsBlock extends StairsBlock {
// WOOD BLOCK SET

public static WoodBlockSet registerWoodBlockSet(WoodType woodType, BlockSetType blockSetType, SaplingGenerator saplingGenerator, MapColor woodColor, MapColor barkColor, MapColor leafColor) {
var id = woodType.name();
var id = woodType.name().split(":")[1];
return registerWoodBlockSet(
woodType, blockSetType,
id + "_sapling", "potted_" + id + "_sapling",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ private static Settings permafrost() {
return copy(Blocks.DIRT).strength(2f).sounds(BlockSoundGroup.GILDED_BLACKSTONE);
}

public static final FarmlandBlock FARMLAND = add("farmland", new ParadiseLostFarmlandBlock(copy(Blocks.FARMLAND)));
public static final ParadiseLostDirtPathBlock DIRT_PATH = add("grass_path", new ParadiseLostDirtPathBlock(copy(Blocks.DIRT_PATH), () -> ParadiseLostBlocks.DIRT));
public static final ParadiseLostDirtPathBlock PERMAFROST_PATH = add("frozen_path", new ParadiseLostDirtPathBlock(permafrost(), () -> ParadiseLostBlocks.PERMAFROST));
public static final ParadiseLostGrassBlock HIGHLANDS_GRASS = add("highlands_grass", new ParadiseLostGrassBlock(grassBlock()), cutoutMippedRenderLayer, tillable(), flattenable(ParadiseLostBlocks.DIRT_PATH));
Expand All @@ -46,7 +47,6 @@ private static Settings permafrost() {
public static final Block COARSE_DIRT = add("coarse_dirt", new Block(copy(Blocks.DIRT).strength(0.3f)), coarseTillable(), flattenable(ParadiseLostBlocks.DIRT_PATH));
public static final FloatingBlock LEVITA = add("levita", new FloatingBlock(false, copy(Blocks.GRAVEL).strength(0.3f)));
public static final Block PERMAFROST = add("permafrost", new Block(permafrost()), flattenable(ParadiseLostBlocks.PERMAFROST_PATH));
public static final FarmlandBlock FARMLAND = add("farmland", new ParadiseLostFarmlandBlock(copy(Blocks.FARMLAND)));
public static final Block PACKED_SWEDROOT = add("packed_swedroot", new Block(of(Material.WOOD).strength(2f).sounds(BlockSoundGroup.SHROOMLIGHT)));

// Glass Blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void render(MatrixStack matrixStack, float delta) {
} else if (stack.getItem() instanceof OlviteBloodstoneItem) {
renderOlvite(matrixStack, client, capturedData);
} else if (stack.getItem() instanceof SurtrumBloodstoneItem) {
renderGravitite(matrixStack, client, capturedData);
renderSurtrum(matrixStack, client, capturedData);
} else if (stack.getItem() instanceof AbstentineBloodstoneItem) {
renderAbstentine(matrixStack, client, capturedData);
}
Expand Down Expand Up @@ -85,9 +85,9 @@ private static void renderCherine(MatrixStack matrixStack, MinecraftClient clien

private static void renderOlvite(MatrixStack matrixStack, MinecraftClient client, BloodstoneCapturedData bloodstoneCapturedData) {
StatusEffectSpriteManager statusEffectSpriteManager = client.getStatusEffectSpriteManager();
var effectAtlas = client.getSpriteAtlas(new Identifier("textures/atlas/mob_effects.png"));
Sprite affinitySprite = effectAtlas.apply(ParadiseLost.locate("affinity"));
Sprite raceSprite = effectAtlas.apply(ParadiseLost.locate("race"));
var effectAtlas = client.getSpriteAtlas(new Identifier("textures/atlas/blocks.png"));
Sprite affinitySprite = effectAtlas.apply(ParadiseLost.locate("item/icons/affinity"));
Sprite raceSprite = effectAtlas.apply(ParadiseLost.locate("item/icons/race"));

renderRing(matrixStack, 0, 0);
renderText(matrixStack, client, bloodstoneCapturedData.name, 0, -80);
Expand All @@ -98,7 +98,7 @@ private static void renderOlvite(MatrixStack matrixStack, MinecraftClient client
renderIconWText(matrixStack, client, raceSprite, Text.translatable(bloodstoneCapturedData.Race), -76, -25);
}

private static void renderGravitite(MatrixStack matrixStack, MinecraftClient client, BloodstoneCapturedData bloodstoneCapturedData) {
private static void renderSurtrum(MatrixStack matrixStack, MinecraftClient client, BloodstoneCapturedData bloodstoneCapturedData) {
renderRing(matrixStack, 0, 0);
renderText(matrixStack, client, bloodstoneCapturedData.name, 0, -80);
renderText(matrixStack, client, Text.translatable("moa.attribute.ground_speed").append(": ").append(bloodstoneCapturedData.getRatingWithColor(bloodstoneCapturedData.GROUND_SPEED)), 63, -50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ private static <V extends EntityType<?>> V add(String id, V type, Consumer<? sup

@SafeVarargs
private static <E extends Entity> EntityType<E> add(String id, FabricEntityTypeBuilder<E> builder, Consumer<? super EntityType<E>>... additionalActions) {
return add(id, builder.build(), additionalActions);
var ent = add(id, builder.build(), additionalActions);
for (var action : additionalActions) {
action.accept(ent);
}
return ent;
}

public static <T extends Entity> FabricEntityTypeBuilder<T> of(EntityType.EntityFactory<T> factory, SpawnGroup spawnGroup, EntityDimensions dimensions, int trackingRange) {
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/net/id/paradiselost/items/ParadiseLostItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,6 @@ private static FabricItemSettings decoration() {
public static final BlockItem ORANGE_PRESSURE_PLATE = add("orange_pressure_plate", ParadiseLostBlocks.ORANGE_WOODSTUFF.pressurePlate(), decoration);
public static final BlockItem WISTERIA_PRESSURE_PLATE = add("wisteria_pressure_plate", ParadiseLostBlocks.WISTERIA_WOODSTUFF.pressurePlate(), decoration);

//TODO: Implement dungeon switch block
// public static final BlockItem DUNGEON_SWITCH = add("dungeonswitch", ParadiseLostBlocks.DUNGEON_SWITCH, decoration);

public static final BoatSet AUREL_BOATS = addBoatItems("aurel", ParadiseLostBlocks.AUREL_WOODSTUFF.plank());
public static final BoatSet MOTHER_AUREL_BOATS = addBoatItems("mother_aurel", ParadiseLostBlocks.MOTHER_AUREL_WOODSTUFF.plank());
public static final BoatSet ORANGE_BOATS = addBoatItems("orange", ParadiseLostBlocks.ORANGE_WOODSTUFF.plank());
Expand All @@ -446,9 +443,11 @@ public static void init() {}

@SafeVarargs
private static <V extends Item> V add(String id, V item, Consumer<ItemConvertible>... additionalActions) {
if (id.equals("grass"))
ParadiseLost.LOG.error("id");
return Registry.register(Registries.ITEM, locate(id), item);
var registeredItem = Registry.register(Registries.ITEM, locate(id), item);
for (var action : additionalActions) {
action.accept(registeredItem);
}
return registeredItem;
}

@SafeVarargs
Expand All @@ -465,7 +464,7 @@ private static BlockItem add(String id, Block block, Settings settings, Consumer
private static BoatSet addBoatItems(String woodId, Block plankBlock) {
String boatId = (MOD_ID + "_" + woodId);

BoatEntity.Type boatType = EnumExtender.add(BoatEntity.Type.class, boatId.toUpperCase(Locale.ROOT), plankBlock, boatId);
BoatEntity.Type boatType = EnumExtender.add(BoatEntity.Type.class, boatId, plankBlock, boatId);

BoatItem boat = add(woodId + "_boat", new BoatItem(false, boatType, decoration().maxCount(1)));
BoatItem chestBoat = add(woodId + "_chest_boat", new BoatItem(true, boatType, decoration().maxCount(1)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@Environment(EnvType.CLIENT)
public class ClientWorldPropertiesMixin {

@Inject(method = "getSkyDarknessHeight", at = @At("HEAD"))
@Inject(method = "getSkyDarknessHeight", at = @At("HEAD"), cancellable = true)
private void getSkyDarknessHeight(HeightLimitView world, CallbackInfoReturnable<Double> ci) {
if (((ClientWorld) world).getRegistryKey() == ParadiseLostDimension.PARADISE_LOST_WORLD_KEY) {
ci.setReturnValue(0.0D);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PlayerManagerMixin {
method = "createPlayer",
at = @At("RETURN")
)
private void createPlayer(GameProfile profile, @Nullable PlayerPublicKey publicKey, CallbackInfoReturnable<ServerPlayerEntity> cir) {
private void createPlayer(GameProfile profile, CallbackInfoReturnable<ServerPlayerEntity> cir) {
if (FabricLoader.getInstance().isDevelopmentEnvironment()) {
cir.getReturnValue().giveItemStack(new ItemStack(ParadiseLostItems.PARADISE_LOST_PORTAL));
}
Expand Down
20 changes: 10 additions & 10 deletions src/main/resources/assets/paradise_lost/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,16 @@

"moa.egg.adult": "pre-grown",

"moa.race.paradise_lost.fallback" : "Exceptional %1$s",
"moa.race.paradise_lost.foxtrot": "Foxtrot %1$s",
"moa.race.paradise_lost.goldenrod": "Goldenrod %1$s",
"moa.race.paradise_lost.highlands_blue": "Common Blue %1$s",
"moa.race.paradise_lost.mintgrass": "Mintgrass %1$s",
"moa.race.paradise_lost.moonstruck": "Moonstruck %1$s",
"moa.race.paradise_lost.redhood": "Lil' Redhood %1$s",
"moa.race.paradise_lost.scarlet": "Scarlet %1$s",
"moa.race.paradise_lost.strawberry_wistar": "Strawberry Wistar %1$s",
"moa.race.paradise_lost.tangerine": "Tangerine %1$s",
"moa.race.paradise_lost.fallback" : "Exceptional",
"moa.race.paradise_lost.foxtrot": "Foxtrot",
"moa.race.paradise_lost.goldenrod": "Goldenrod",
"moa.race.paradise_lost.highlands_blue": "Common Blue",
"moa.race.paradise_lost.mintgrass": "Mintgrass",
"moa.race.paradise_lost.moonstruck": "Moonstruck",
"moa.race.paradise_lost.redhood": "Lil' Redhood",
"moa.race.paradise_lost.scarlet": "Scarlet",
"moa.race.paradise_lost.strawberry_wistar": "Strawberry Wistar",
"moa.race.paradise_lost.tangerine": "Tangerine",

"moa.attribute.ground_speed": "Running Speed",
"moa.attribute.gliding_speed": "Flying Speed",
Expand Down
10 changes: 0 additions & 10 deletions src/main/resources/data/minecraft/tags/fluids/water.json

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"values": [
"paradise_lost:cold_cloud",
"paradise_lost:blue_cloud",
"paradise_lost:pink_cloud",
"paradise_lost:golden_cloud"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"values": [
"paradise_lost:cold_cloud",
"paradise_lost:blue_cloud",
"paradise_lost:pink_cloud",
"paradise_lost:golden_cloud"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"replace": false,
"values": [
"paradise_lost:orange",
"#c:raw_meat",
"#c:cooked_meat"
"minecraft:beef",
"minecraft:porkchop",
"minecraft:chicken",
"minecraft:rabbit",
"minecraft:mutton"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"paradise_lost:natural_swedroot",
"paradise_lost:thicket_fallen_log",
"paradise_lost:patch_grass",
"paradise_lost:fallen_leaves",
"paradise_lost:patch_brown_sporecap_common",
"paradise_lost:patch_tall_grass",
"paradise_lost:patch_dense_bush",
"paradise_lost:trees_sparse"
"paradise_lost:trees_sparse",
"paradise_lost:fallen_leaves"
],
[
"minecraft:freeze_top_layer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
"paradise_lost:patch_brown_sporecap",
"paradise_lost:patch_pink_sporecap",
"paradise_lost:natural_swedroot",
"paradise_lost:patch_grass",
"paradise_lost:patch_thicket_shamrock",
"paradise_lost:patch_thicket_liverwort_carpet",
"paradise_lost:patch_grass",
"paradise_lost:fallen_leaves",
"paradise_lost:patch_tall_grass",
"paradise_lost:patch_dense_bush",
"paradise_lost:trees_thicket",
"paradise_lost:trees_thicket_mother_aurel"
"paradise_lost:trees_thicket_mother_aurel",
"paradise_lost:fallen_leaves"
],
[
"minecraft:freeze_top_layer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,22 @@
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
"type": "minecraft:all_of",
"predicates": [
{
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
},
{
"type": "minecraft:matching_blocks",
"blocks": "paradise_lost:highlands_grass",
"offset": [
0,
-1,
0
]
}
]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,22 @@
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
"type": "minecraft:all_of",
"predicates": [
{
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
},
{
"type": "minecraft:matching_blocks",
"blocks": "paradise_lost:highlands_grass",
"offset": [
0,
-1,
0
]
}
]
}
}
]
Expand Down

0 comments on commit fd23ce8

Please sign in to comment.