Skip to content

Commit

Permalink
Update to Minecraft Snapshot 20w14a
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Apr 2, 2020
1 parent d96bf18 commit fc05731
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 132 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=20w13b
yarn_mappings=20w13b+build.7
loader_version=0.7.8+build.189
minecraft_version=20w14a
yarn_mappings=20w14a+build.1
loader_version=0.7.9+build.190

# Mod Properties
fabric_asm_version=v2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public static class EntityConfig {
public boolean useBlockAtFeetCaching = true;
}

@Category("region")
public static class RegionConfig {
@Option("reduce_session_lock_checks")
public boolean reduceSessionLockChecks = true;
}

@Category("chunk")
public static class ChunkConfig {
@Option("use_optimized_hash_palette")
Expand Down Expand Up @@ -131,11 +125,6 @@ public static class RedstoneConfig {
public boolean useRedstoneDustOptimizations = false;
}

@Category("other")
public static class OtherConfig {
@Option("use_small_tag_array_optimization")
public boolean useSmallTagArrayOptimization = true;
}

public AiConfig ai = new AiConfig();
public PoiConfig poi = new PoiConfig();
Expand All @@ -144,8 +133,6 @@ public static class OtherConfig {
public EntityConfig entity = new EntityConfig();
public ChunkConfig chunk = new ChunkConfig();
public ClientConfig client = new ClientConfig();
public OtherConfig other = new OtherConfig();
public RegionConfig region = new RegionConfig();
public RedstoneConfig redstone = new RedstoneConfig();
public WorldConfig world = new WorldConfig();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

Expand Down Expand Up @@ -138,7 +139,7 @@ public static boolean isBoxFullyWithinWorldBorder(WorldBorder border, Box box) {
* Re-implements the function named above without stream code or unnecessary allocations. This can provide a small
* boost in some situations (such as heavy entity crowding) and reduces the allocation rate significantly.
*/
public static Stream<VoxelShape> getEntityCollisions(EntityView view, Entity entity, Box box, Set<Entity> excluded) {
public static Stream<VoxelShape> getEntityCollisions(EntityView view, Entity entity, Box box, Predicate<Entity> predicate) {
if (box.getAverageSideLength() < 1.0E-7D) {
return Stream.empty();
}
Expand All @@ -149,7 +150,7 @@ public static Stream<VoxelShape> getEntityCollisions(EntityView view, Entity ent
List<VoxelShape> shapes = new ArrayList<>();

for (Entity otherEntity : entities) {
if (!excluded.isEmpty() && excluded.contains(otherEntity)) {
if (!predicate.test(otherEntity)) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ private void setupMixins(LithiumConfig config) {
this.enableIf("entity.streamless_entity_retrieval", config.entity.useStreamlessEntityRetrieval);
this.enableIf("math.fast_util", config.general.useFastMathUtilityLogic);
this.enableIf("redstone", config.redstone.useRedstoneDustOptimizations);
this.enableIf("region.fast_session_lock", config.region.reduceSessionLockChecks);
this.enableIf("small_tag_arrays", config.other.useSmallTagArrayOptimization);
this.enableIf("voxelshape.block_shape_cache", config.physics.extendBlockShapeCache);
this.enableIf("voxelshape.fast_shape_comparisons", config.physics.useFastShapeComparisons);
this.enableIf("voxelshape.precompute_shape_arrays", config.physics.alwaysUnpackBlockShapes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.spongepowered.asm.mixin.Overwrite;

import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Stream;

/**
Expand All @@ -21,7 +22,7 @@ public interface MixinEntityView {
* @author JellySquid
*/
@Overwrite
default Stream<VoxelShape> getEntityCollisions(Entity entity, Box box, Set<Entity> excluded) {
return LithiumEntityCollisions.getEntityCollisions((EntityView) this, entity, box, excluded);
default Stream<VoxelShape> getEntityCollisions(Entity entity, Box box, Predicate<Entity> predicate) {
return LithiumEntityCollisions.getEntityCollisions((EntityView) this, entity, box, predicate);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.jellysquid.mods.lithium.mixin.poi.fast_init;

import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.Dynamic;
import me.jellysquid.mods.lithium.common.world.interests.PointOfInterestTypeHelper;
import net.minecraft.datafixer.DataFixTypes;
import net.minecraft.util.math.BlockPos;
Expand All @@ -18,13 +17,11 @@

import java.io.File;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;

@Mixin(PointOfInterestStorage.class)
public abstract class MixinPointOfInterestStorage extends SerializingRegionBasedStorage<PointOfInterestSet> {
public MixinPointOfInterestStorage(File file, BiFunction<Runnable, Dynamic<?>, PointOfInterestSet> deserializer, Function<Runnable, PointOfInterestSet> factory, DataFixer fixer, DataFixTypes type) {
super(file, deserializer, factory, fixer, type);
public MixinPointOfInterestStorage(File file, DataFixer fixer, boolean flag) {
super(file, PointOfInterestSet::serialize, PointOfInterestSet::new, PointOfInterestSet::new, fixer, DataFixTypes.POI_CHUNK, flag);
}

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

@Mixin(PointOfInterestStorage.class)
public abstract class MixinPointOfInterestStorage extends SerializingRegionBasedStorage<PointOfInterestSet> {
public MixinPointOfInterestStorage(File file, BiFunction<Runnable, Dynamic<?>, PointOfInterestSet> deserializer, Function<Runnable, PointOfInterestSet> factory, DataFixer fixer, DataFixTypes type) {
super(file, deserializer, factory, fixer, type);
public MixinPointOfInterestStorage(File file, DataFixer fixer, boolean flag) {
super(file, PointOfInterestSet::serialize, PointOfInterestSet::new, PointOfInterestSet::new, fixer, DataFixTypes.POI_CHUNK, flag);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import me.jellysquid.mods.lithium.common.world.interests.ExtendedRegionBasedStorage;
import me.jellysquid.mods.lithium.common.util.Collector;
import me.jellysquid.mods.lithium.common.util.ListeningLong2ObjectOpenHashMap;
import net.minecraft.class_5128;
import net.minecraft.datafixer.DataFixTypes;
import net.minecraft.util.dynamic.DynamicSerializable;
import net.minecraft.util.math.ChunkPos;
Expand Down Expand Up @@ -45,7 +46,7 @@ public abstract class MixinSerializingRegionBasedStorage<R extends DynamicSerial
private Long2ObjectOpenHashMap<BitSet> columns;

@Inject(method = "<init>", at = @At("RETURN"))
private void init(File file_1, BiFunction<Runnable, Dynamic<?>, R> serializer, Function<Runnable, R> factory, DataFixer fixer, DataFixTypes type, CallbackInfo ci) {
private void init(File file, class_5128<R> class_5128_1, BiFunction<Runnable, Dynamic<?>, R> serializer, Function<Runnable, R> deserializer, DataFixer fixer, DataFixTypes type, boolean sync, CallbackInfo ci) {
this.columns = new Long2ObjectOpenHashMap<>();
this.loadedElements = new ListeningLong2ObjectOpenHashMap<>(this::onEntryAdded, this::onEntryRemoved);
}
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
],
"depends": {
"fabricloader": ">=0.4.0",
"minecraft": "1.16-alpha.20.13.b"
"minecraft": "1.16-alpha.20.14.a"
}
}
2 changes: 0 additions & 2 deletions src/main/resources/lithium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
"math.fast_util.MixinDirection",
"redstone.MixinRedstoneWireBlock",
"redstone.MixinWorld",
"region.fast_session_lock.MixinThreadedAnvilChunkStorage",
"small_tag_arrays.MixinTag",
"poi.fast_retrieval.MixinPointOfInterestSet",
"poi.fast_retrieval.MixinPointOfInterestStorage",
"poi.fast_retrieval.MixinSerializingRegionBasedStorage",
Expand Down

0 comments on commit fc05731

Please sign in to comment.