-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*casually ports an entire forge class*
- Loading branch information
1 parent
203d976
commit 84b942f
Showing
18 changed files
with
635 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"files.autoSave": "off", | ||
"java.jdt.ls.java.home": "/usr/local/sdkman/candidates/java/current", | ||
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current" | ||
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current", | ||
"java.configuration.updateBuildConfiguration": "automatic" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
common/src/main/java/uwu/lopyluna/create_dd/access/AccessDyeColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package uwu.lopyluna.create_dd.access; | ||
|
||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Item; | ||
|
||
public interface AccessDyeColor { | ||
default TagKey<Item> getTag() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
538 changes: 538 additions & 0 deletions
538
common/src/main/java/uwu/lopyluna/create_dd/infrastructure/utility/ForgeTags.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
.../src/main/java/uwu/lopyluna/create_dd/infrastructure/world/DesiresPlacementModifiers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package uwu.lopyluna.create_dd.infrastructure.world; | ||
|
||
import com.simibubi.create.infrastructure.worldgen.ConfigDrivenPlacement; | ||
|
||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.world.level.levelgen.placement.PlacementModifierType; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import static uwu.lopyluna.create_dd.Desires.MOD_ID; | ||
|
||
public class DesiresPlacementModifiers { | ||
private static final DeferredRegister<PlacementModifierType<?>> REGISTER = DeferredRegister.create(Registry.PLACEMENT_MODIFIER_REGISTRY, MOD_ID); | ||
private static final DeferredRegister<PlacementModifierType<?>> REGISTER = DeferredRegister.create(MOD_ID, Registry.PLACEMENT_MODIFIER_REGISTRY); | ||
|
||
public static final RegistryObject<PlacementModifierType<? extends ConfigDrivenPlacement>> CONFIG_DRIVEN = REGISTER.register("config_driven", () -> () -> CDrivenPlacement.CODEC); | ||
public static final RegistrySupplier<PlacementModifierType<? extends ConfigDrivenPlacement>> CONFIG_DRIVEN = REGISTER.register("config_driven", () -> () -> CDrivenPlacement.CODEC); | ||
|
||
public static void register(IEventBus modEventBus) { | ||
REGISTER.register(modEventBus); | ||
public static void register() { | ||
REGISTER.register(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
common/src/main/java/uwu/lopyluna/create_dd/mixins/MixinDyeColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package uwu.lopyluna.create_dd.mixins; | ||
|
||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
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; | ||
|
||
import net.minecraft.core.Registry; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.DyeColor; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.material.MaterialColor; | ||
import uwu.lopyluna.create_dd.access.AccessDyeColor; | ||
|
||
@Mixin(DyeColor.class) | ||
public class MixinDyeColor implements AccessDyeColor { | ||
@Shadow | ||
@Final | ||
private String name; | ||
@Unique | ||
private TagKey<Item> tag; | ||
|
||
@Inject(method = "<init>", at = @At("TAIL")) | ||
public void addTag(String woolId, int id, int color, String mapColor, int fireworkColor, MaterialColor signColor, int j, int k, CallbackInfo ci) { | ||
tag = TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation("c", name + "_dyes")); | ||
} | ||
|
||
@Override | ||
public TagKey<Item> getTag() { | ||
return tag; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 5 additions & 11 deletions
16
common/src/main/java/uwu/lopyluna/create_dd/registry/DesiresEntityDataSerializers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
package uwu.lopyluna.create_dd.registry; | ||
|
||
import net.minecraft.network.syncher.EntityDataSerializer; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.ForgeRegistries; | ||
import uwu.lopyluna.create_dd.Desires; | ||
|
||
|
||
public class DesiresEntityDataSerializers { | ||
private static final DeferredRegister<EntityDataSerializer<?>> REGISTER = DeferredRegister.create(ForgeRegistries.Keys.ENTITY_DATA_SERIALIZERS, Desires.MOD_ID); | ||
// TODO - also, is this even used? | ||
// private static final DeferredRegister<EntityDataSerializer<?>> REGISTER = DeferredRegister.create(Desires.MOD_ID, Registry.Keys.ENTITY_DATA_SERIALIZERS); | ||
|
||
public static void register(IEventBus modEventBus) { | ||
REGISTER.register(modEventBus); | ||
} | ||
// public static void register(IEventBus modEventBus) { | ||
// REGISTER.register(modEventBus); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters