Skip to content

Commit

Permalink
Do some cleanup and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
polarbub committed Jan 15, 2023
1 parent 253a8a8 commit 0847c4c
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 61 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ jar {
}
}

loom {
accessWidenerPath = file("src/main/resources/protosky.accesswidener")
}
loom {}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ org.gradle.jvmargs=-Xmx1G

minecraft_version=1.19.2
yarn_mappings=1.19.2+build.17
loader_version=0.14.9
fabric_version=0.61.0+1.19.2
loader_version=0.14.12
fabric_version=0.72.0+1.19.2

# Mod Properties
mod_version = 1.1.9
mod_version = 1.1.10
maven_group = protosky
archives_base_name = protosky
17 changes: 5 additions & 12 deletions src/main/java/protosky/WorldGenUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@
import net.minecraft.util.math.random.RandomSeed;
import net.minecraft.util.math.random.Xoroshiro128PlusPlusRandom;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.*;
import net.minecraft.world.Heightmap;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
import net.minecraft.world.chunk.PalettedContainer;
import net.minecraft.world.chunk.ProtoChunk;
import net.minecraft.world.chunk.ReadableContainer;
import protosky.stuctures.PillarHelper;
import protosky.stuctures.StructureHelper;
import net.minecraft.world.chunk.*;
import protosky.mixins.ProtoChunkAccessor;

import java.util.*;

import static protosky.ProtoSkySettings.LOGGER;
import java.util.Map;
import java.util.Optional;

public class WorldGenUtils
{
Expand Down Expand Up @@ -66,7 +60,6 @@ public static void clearEntities(ProtoChunk chunk, ServerWorld world) {
} else {
chunk.getEntities().removeIf(tag -> {
String id = tag.getString("id");
LOGGER.info(id);
return !id.equals("minecraft:end_crystal") && !id.equals("minecraft:shulker") && !id.equals("minecraft:item_frame");
});
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/protosky/mixins/ChunkStatusMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import net.minecraft.structure.StructureTemplateManager;
import net.minecraft.world.ChunkRegion;
import net.minecraft.world.Heightmap;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.ProtoChunk;
import net.minecraft.world.gen.chunk.Blender;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -19,7 +19,6 @@
import protosky.WorldGenUtils;
import protosky.stuctures.PillarHelper;
import protosky.stuctures.StructureHelper;
import net.minecraft.world.World;

import java.util.EnumSet;
import java.util.List;
Expand Down Expand Up @@ -76,12 +75,10 @@ private static void HEIGHTMAPS(ChunkStatus targetStatus, ServerWorld world, Chun
ci.cancel();
}

/*@Inject(method = "method_17033", at = @At("HEAD"), cancellable = true)
@Inject(method = "method_17033", at = @At("HEAD"), cancellable = true)
//This is under ChunkStatus SPAWN. To find the inject method you need to read the bytecode.
//Spawning entities should be skipped here
private static void SPAWN(ChunkStatus targetStatus, ServerWorld world, ChunkGenerator generator, List chunks, Chunk chunk, CallbackInfo ci) {
ci.cancel();
}
*/

}
8 changes: 0 additions & 8 deletions src/main/java/protosky/mixins/EnderDragonFightMixin.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
package protosky.mixins;

import net.minecraft.block.pattern.BlockPattern;
import net.minecraft.entity.boss.dragon.EnderDragonFight;
import net.minecraft.util.math.BlockPos;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import protosky.ProtoSkySettings;

@Mixin(EnderDragonFight.class)
public class EnderDragonFightMixin
{
@Shadow
private BlockPos exitPortalLocation;


@Shadow @Final private static Logger LOGGER;

@Inject(method = "generateEndPortal(Z)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/gen/feature/EndPortalFeature;generateIfValid(Lnet/minecraft/world/gen/feature/FeatureConfig;Lnet/minecraft/world/StructureWorldAccess;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/util/math/BlockPos;)Z", shift = At.Shift.BEFORE))
//@Inject(method = "generateEndPortal(Z)V", at = @At("HEAD"))
private void adjustExitPortalLocation(boolean open, CallbackInfo ci) {
LOGGER.info("ran");
//if (this.exitPortalLocation.getY() < 2)
//exitPortalLocation = exitPortalLocation.up(2 - exitPortalLocation.getY());
//exitPortalLocation = new BlockPos(exitPortalLocation.getX(), 2, exitPortalLocation.getZ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ void generate(StructureWorldAccess world, StructureAccessor structureAccessor, C
SwampHutGenerator This = ((SwampHutGenerator)(Object)this);
ShiftableStructurePieceInvoker shiftableStructurePieceInvoker = ((ShiftableStructurePieceInvoker) This);

if (shiftableStructurePieceInvoker.invokeAdjustToAverageHeight(world, chunkBox, 0)) {
System.out.println("hi");
}

shiftableStructurePieceInvoker.invokeAdjustToAverageHeight(world, chunkBox, 0);
ci.cancel();
}
}
28 changes: 9 additions & 19 deletions src/main/java/protosky/stuctures/StructureHelper.java
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
package protosky.stuctures;

import com.google.common.collect.ImmutableMap;
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
import net.minecraft.SharedConstants;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.EndPortalFrameBlock;
import net.minecraft.fluid.FluidState;
import net.minecraft.loot.LootTables;
import net.minecraft.structure.*;
import net.minecraft.structure.processor.BlockIgnoreStructureProcessor;
import net.minecraft.structure.processor.BlockRotStructureProcessor;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.FluidTags;
import net.minecraft.util.BlockMirror;
import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.*;
import net.minecraft.world.*;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
import net.minecraft.SharedConstants;
import net.minecraft.util.Identifier;
import net.minecraft.util.crash.CrashException;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.math.*;
import net.minecraft.util.math.random.ChunkRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.math.random.RandomSeed;
import net.minecraft.util.math.random.Xoroshiro128PlusPlusRandom;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.Heightmap;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.PlacedFeature;
import net.minecraft.world.gen.feature.util.PlacedFeatureIndexer;
import net.minecraft.world.gen.structure.Structure;
import protosky.mixins.StructureHelperInvokers.ChunkGeneratorInvoker;
import protosky.mixins.StructureHelperInvokers.ShiftableStructurePieceInvoker;
import protosky.mixins.StructureHelperInvokers.StructurePieceInvoker;
import protosky.mixins.StructureHelperInvokers.StructureStartInvoker;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
import protosky.mixins.StructureHelperInvokers.*;
import protosky.mixins.StructurePieceAccessor;
import protosky.mixins.StructureHelperInvokers.IglooGeneratorPieceInvoker;
import protosky.mixins.StructureHelperInvokers.SimpleStructurePieceInvoker;
import protosky.mixins.StructureHelperInvokers.ShipwreckGeneratorPieceInvoker;
import protosky.mixins.StructureHelperInvokers.OceanRuinGeneratorPieceInvoker;

import java.util.*;
import java.util.function.Supplier;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/protosky/testing/findMovedStructure.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package protosky.testing;

import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.command.argument.RegistryKeyArgumentType;
Expand Down
Binary file added src/main/resources/assets/protosky/protoIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
},

"license": "CC0-1.0",
"icon": "assets/protosky/icon.png",

"icon": "assets/protosky/protoIcon.png",
"environment": "*",
"accessWidener": "protosky.accesswidener",
"entrypoints": {
"main": [
"protosky.fixWorldLoads"
Expand All @@ -34,7 +32,7 @@

"depends": {
"minecraft": ">=1.19.2",
"fabricloader": ">=0.14.9",
"fabricloader": ">=0.14.12",
"fabric-api": "*",
"java": ">=17"
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/protosky.accesswidener

This file was deleted.

0 comments on commit 0847c4c

Please sign in to comment.