Skip to content

Commit

Permalink
Update to 24w40a
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Oct 2, 2024
1 parent 9f61072 commit 3fc43bf
Show file tree
Hide file tree
Showing 45 changed files with 180 additions and 579 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx4G
# Fabric Properties
# check these on https://fabricmc.net/use

minecraft_version=24w36a
yarn_mappings=24w36a+build.6
minecraft_version=24w40a
yarn_mappings=24w40a+build.3
loader_version=0.16.4

# Fabric API
fabric_version=0.103.2+1.21.2
fabric_version=0.105.2+1.21.2

maven_group = eu.pb4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ public Optional<RegistryEntry.Reference<T>> getEntry(Identifier id) {
return getDefaultEntry();
}

@Override
public Optional<RegistryEntry.Reference<T>> getEntry(RegistryKey<T> key) {
return Optional.of(RegistryEntry.Reference.standAlone(this, key));
}

@Override
public RegistryEntry<T> getEntry(T value) {
return RegistryEntry.of(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static void addRegistry(FakeRegistry<?> registry) {
new BannerPattern(Identifier.of("polymer","fake_pattern"), "")));
addRegistry(new FakeRegistry<>(RegistryKeys.PAINTING_VARIANT,
Identifier.of("polymer","painting"),
new PaintingVariant(1, 1, Identifier.of("polymer","painting"))));
new PaintingVariant(1, 1, Identifier.of("polymer","painting"), Optional.empty(), Optional.empty())));
addRegistry(new FakeRegistry<>(RegistryKeys.WOLF_VARIANT,
Identifier.of("polymer","wolf"),
new WolfVariant(Identifier.of("polymer","wolf"), Identifier.of("polymer","wolf"),Identifier.of("polymer","wolf"), RegistryEntryList.empty())));
Expand Down Expand Up @@ -243,7 +243,6 @@ public int getTickCount() {
accessor.polymer$setBiomeAccess(new BiomeAccess(worldUnsafe, 1l));
accessor.polymer$setBorder(new WorldBorder());
accessor.polymer$setDebugWorld(true);
accessor.polymer$setProfiler(() -> new ProfilerSystem(() -> 0l, () -> 0, false));
accessor.polymer$setProperties(new FakeWorldProperties());
accessor.polymer$setRegistryKey(RegistryKey.of(RegistryKeys.WORLD, Identifier.of("polymer","fake_world")));
//accessor.polymer$setDimensionKey(DimensionTypes.OVERWORLD);
Expand All @@ -269,7 +268,6 @@ public int getTickCount() {
new FakeWorldProperties(),
RegistryKey.of(RegistryKeys.WORLD, Identifier.of("polymer", "fake_world")),
dimType,
() -> new ProfilerSystem(() -> 0l, () -> 0, false),
false,
true,
1
Expand All @@ -288,8 +286,8 @@ public int getTickCount() {

private TickManager tickManager = new TickManager();

protected FakeWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> dimensionType, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, FALLBACK_REGISTRY_MANAGER, dimensionType, profiler, isClient, debugWorld, seed, 0);
protected FakeWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> dimensionType, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, FALLBACK_REGISTRY_MANAGER, dimensionType, isClient, debugWorld, seed, 0);
}

@Override
Expand Down Expand Up @@ -491,10 +489,6 @@ public boolean isHardcore() {
return false;
}

@Override
public GameRules getGameRules() {
return new GameRules(FeatureSet.empty());
}

@Override
public Difficulty getDifficulty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import eu.pb4.polymer.common.impl.FakeWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.data.DataTracker;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.server.network.EntityTrackerEntry;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.World;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -22,6 +24,11 @@ private FakeEntity(EntityType<?> type, World world) {
@Override
protected void initDataTracker(DataTracker.Builder builder) {}

@Override
public boolean damage(ServerWorld world, DamageSource source, float amount) {
return false;
}

@Override
protected void readCustomDataFromNbt(NbtCompound nbt) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public interface WorldAccessor {
@Accessor("properties")
void polymer$setProperties(MutableWorldProperties properties);

@Mutable
@Accessor("profiler")
void polymer$setProfiler(Supplier<Profiler> profiler);

@Mutable
@Accessor("border")
void polymer$setBorder(WorldBorder border);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,6 @@ default void onEntityPacketSent(Consumer<Packet<?>> consumer, Packet<?> packet)
consumer.accept(packet);
}

/**
* This method allows to modify position of entity on client
* @param vec3d Real position
* @return Client-side position
*/
default Vec3d getClientSidePosition(Vec3d vec3d) {
return vec3d;
}

/**
* This method allows to modify yaw of entity on client
* @param yaw Real yaw stateValue
* @return Client-side yaw stateValue
*/
default float getClientSideYaw(float yaw) {
return yaw;
}

/**
* This method allows to modify head yaw of entity on client
* @param yaw Real yaw stateValue
* @return Client-side yaw stateValue
*/
default float getClientSideHeadYaw(float yaw) {
return yaw;
}

/**
* This method allows to modify pitch of entity on client
* @param pitch Real pitch stateValue
* @return Client-side pitch stateValue
*/
default float getClientSidePitch(float pitch) {
return pitch;
}

/**
* Allows disabling sending packets to player
* @param player
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class PolymerItemUtils {
DataComponentTypes.TOOL,
DataComponentTypes.MAX_STACK_SIZE,
DataComponentTypes.FOOD,
DataComponentTypes.FIRE_RESISTANT,
DataComponentTypes.DAMAGE_RESISTANT,
DataComponentTypes.FIREWORKS,
DataComponentTypes.FIREWORK_EXPLOSION,
DataComponentTypes.DAMAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,96 +15,9 @@
* Interface used for creation of server-side recipes
*/
public interface PolymerRecipe extends PolymerSyncedObject<Recipe<?>> {
/**
* Returns client-side recipe used on client for specific player
* This allows the client to still display Recipe Unlocked toast messages to the player.
*
* The provided methods for generating a recipe unsure that the
* recipe will not appear in the incorrect recipe book screen.
* @see PolymerRecipe#createBlastingRecipe(Recipe) - For a Blast Furnace Toast Icon
* @see PolymerRecipe#createCraftingRecipe(Recipe) - For a Crafting Table Toast Icon
* @see PolymerRecipe#createCampfireCookingRecipe(Recipe) - For a Campfire Toast Icon
* @see PolymerRecipe#createSmeltingRecipe(Recipe) - For a Furnace Toast Icon
* @see PolymerRecipe#createSmithingRecipe(Recipe) - For a Smithing Table Toast Icon
* @see PolymerRecipe#createSmokingRecipe(Recipe) - For a Smoker Toast Icon
* @see PolymerRecipe#createStonecuttingRecipe(Recipe) - For a Stonecutter Toast Icon
*
* @param player Player recipe is send to
* @return Vanilla (or other) Recipe instance, or null if the recipe is hidden from the client
*/
@Nullable
@Override
default Recipe<?> getPolymerReplacement(ServerPlayerEntity player) {
return null;
}

/**
* Make the client display as a {@link RecipeType#BLASTING}.
* Icon Used: {@link Items#BLAST_FURNACE}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createBlastingRecipe(Recipe<?> input) {
return new BlastingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0);
}

/**
* Make the client display as a {@link RecipeType#CRAFTING}.
* Icon Used: {@link Items#CRAFTING_TABLE}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createCraftingRecipe(Recipe<?> input) {
return new ShapelessRecipe("impossible", CraftingRecipeCategory.MISC, input.getResult(null), DefaultedList.of());
}

/**
* Make the client display as a {@link RecipeType#CAMPFIRE_COOKING}.
* Icon Used: {@link Items#CAMPFIRE}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createCampfireCookingRecipe(Recipe<?> input) {
return new CampfireCookingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0);
}

/**
* Make the client display as a {@link RecipeType#SMELTING}.
* Icon Used: {@link Items#FURNACE}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createSmeltingRecipe(Recipe<?> input) {
return new SmeltingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0);
}

/**
* Make the client display as a {@link RecipeType#SMITHING}.
* Icon Used: {@link Items#SMITHING_TABLE}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createSmithingRecipe(Recipe<?> input) {
return new SmithingTransformRecipe(Optional.empty(), Optional.empty(), Optional.empty(), input.getResult(null));
}

/**
* Make the client display as a {@link RecipeType#SMOKING}.
* Icon Used: {@link Items#SMOKER}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createSmokingRecipe(Recipe<?> input) {
return new SmokingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0);
}

/**
* Make the client display as a {@link RecipeType#STONECUTTING}.
* Icon Used: {@link Items#STONECUTTER}
* @param input the Modded recipe
* @return the Vanilla recipe
*/
static Recipe<?> createStonecuttingRecipe(Recipe<?> input) {
return new StonecuttingRecipe("impossible", Ingredient.ofItems(), input.getResult(null));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface PolymerStatusEffect extends PolymerSyncedObject<StatusEffect> {
default ItemStack getPolymerIcon(ServerPlayerEntity player) {
var icon = Items.POTION.getDefaultStack();
icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(),
Optional.of(((StatusEffect) this).getColor()), List.of() ));
Optional.of(((StatusEffect) this).getColor()), List.of(), Optional.empty()));
return icon;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package eu.pb4.polymer.core.impl.interfaces;

public interface SkipCheck {
void polymer$setSkipped();
boolean polymer$skipped();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void drawUi() {
}
} else {
icon = Items.POTION.getDefaultStack();
icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.of(effectInstance.getEffectType().value().getColor()), List.of()));
icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.of(effectInstance.getEffectType().value().getColor()), List.of(), Optional.empty()));
}
icon.set(DataComponentTypes.HIDE_ADDITIONAL_TOOLTIP, Unit.INSTANCE);
icon.set(DataComponentTypes.RARITY, Rarity.COMMON);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3fc43bf

Please sign in to comment.