Skip to content

Commit

Permalink
MC 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Slexom committed Dec 9, 2023
1 parent b2a0ce6 commit c8cb479
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 8 deletions.
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ subprojects {
// The following line declares the mojmap mappings, you may use other mappings as well
// mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

mappings loom.layered() {
it.mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
it.mappings file("../mappings-patch-temp/yarnpatch.tiny")
}


// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package slexom.animal_feeding_trough.platform.common.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
Expand All @@ -24,12 +25,16 @@
public class FeedingTroughBlock extends BlockWithEntity {
public static final IntProperty LEVEL = IntProperty.of("level", 0, 4);
private static final VoxelShape SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 9.0D, 16.0D);
public static final MapCodec<FeedingTroughBlock> CODEC = createCodec(FeedingTroughBlock::new);

public FeedingTroughBlock(Settings settings) {
super(settings);
this.setDefaultState(this.stateManager.getDefaultState().with(LEVEL, 0));
}

public MapCodec<FeedingTroughBlock> getCodec() {
return CODEC;
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
stateManager.add(LEVEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.recipe.Ingredient;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand All @@ -21,6 +22,7 @@

@Mixin(AnimalEntity.class)
public class AnimalEntityMixin extends MobEntity {
@Unique
private static final ItemStack[] FORBIDDEN_ITEMS = Arrays.stream(new Item[]{Items.CARROT_ON_A_STICK, Items.WARPED_FUNGUS_ON_A_STICK}).map(ItemStack::new).toArray(ItemStack[]::new);

protected AnimalEntityMixin(EntityType<? extends MobEntity> entityType, World world) {
Expand Down
12 changes: 11 additions & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.github.johnrengelman.shadow" version "7.1.2"
}

architectury {
Expand Down Expand Up @@ -67,6 +67,16 @@ jar {
archiveClassifier.set("dev")
}

// Merge the resources and classes into the same directory.
// This is done because java expects modules to be in a single directory.
// And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem
// This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later.
sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slexom.vf.animal_feeding_trough.forge;
package slexom.vf.animal_feeding_trough.platform.forge;

import dev.architectury.platform.forge.EventBuses;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ maven_group=slexom.vf
archives_base_name=animal_feeding_trough

# Architectury
architectury_version=11.0.7
architectury_version=11.0.8
enabled_platforms=fabric,forge,neoforge
#,quilt

# Fabric
fabric_loader_version=0.15.0
fabric_api_version=0.91.1+1.20.4
fabric_loader_version=0.15.1
fabric_api_version=0.91.2+1.20.4

# Forge
forge_version=49.0.3
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions mappings-patch-temp/yarnpatch.tiny
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tiny 2 0 intermediary named
c net/minecraft/class_1927 net/minecraft/world/explosion/Explosion
m ()Lnet/minecraft/class_243; method_55109 getPositionYarn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package slexom.vf.animal_feeding_trough.neoforge;
package slexom.vf.animal_feeding_trough.platform.neoforge;

import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.neoforged.api.distmarker.Dist;
Expand Down

0 comments on commit c8cb479

Please sign in to comment.