Skip to content

Commit

Permalink
more porting (thanks makamys for the remapped code)
Browse files Browse the repository at this point in the history
  • Loading branch information
unix-supremacist committed Mar 6, 2024
1 parent ab30e70 commit e839323
Show file tree
Hide file tree
Showing 60 changed files with 410 additions and 1,871 deletions.
1,607 changes: 2 additions & 1,605 deletions build.gradle

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ dependencies {

testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'

compile("com.github.GTNewHorizons:NotEnoughItems:2.5.23-GTNH:dev")
compile("com.github.GTNewHorizons:CodeChickenLib:1.2.1:dev")
compile("com.github.GTNewHorizons:waila:1.7.1:dev")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
modName = Alchemist
modName = \u00A7c\u00A7l\u00A7oAlchemist\u00A7r

# This is a case-sensitive string to identify your mod. Convention is to use lower case.
modId = alchemist
Expand Down
15 changes: 4 additions & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle")
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
Expand All @@ -17,12 +17,5 @@ pluginManagement {
}

plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}

blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.2')
//devLocal '.' // Use this when testing config updates locally
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15'
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package io.github.unix_supremacist.alchemist;

import com.myname.mymodid.CommonProxy;
import io.github.unix_supremacist.alchemist.content.AlchemistBlocks;
import io.github.unix_supremacist.alchemist.content.AlchemistItems;
import io.github.unix_supremacist.alchemist.content.AlchemistSplashes;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand All @@ -24,6 +27,10 @@ public class Alchemist {
// GameRegistry." (Remove if not needed)
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit(event);

AlchemistSplashes.init();
AlchemistBlocks.values(); //force the enum to load
AlchemistItems.values(); //force the enum to load
}

@Mod.EventHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
package io.github.unix_supremacist.alchemist.block;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.github.unix_supremacist.alchemist.Tags;
import io.github.unix_supremacist.alchemist.interfaces.TransmuteEntity;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import java.util.List;

public class TransmutionCircleBlock extends Block implements TransmuteEntity {
@SideOnly(Side.CLIENT)
public IIcon icon;
public String name;

public TransmutionCircleBlock(Material material) {
super(material);
name = "transmutation_circle";
}

@Override
Expand Down Expand Up @@ -55,4 +65,21 @@ public boolean isOpaqueCube() {
public boolean renderAsNormalBlock() {
return false;
}

@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
return icon;
}

@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {

}

@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
super.registerBlockIcons(iconRegister);
this.icon = iconRegister.registerIcon(Tags.MODID+":"+name.toLowerCase());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
import lombok.Getter;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;

public enum AlchemistItems {
alchemical_coal(25600),
aeternalis_fuel(1638400),
//black_hole_band,
catalytic_lens(new DestructionItem(3, 10, 5).setMaxStackSize(1)),
chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock()).setMaxDamage(64)),
//chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock()).setMaxDamage(64)),
coal_coke(3200),
dark_matter,
//dark_matter_pickaxe,
Expand All @@ -23,7 +24,7 @@ public enum AlchemistItems {
//dark_matter_shears,
//dark_matter_hammer(new AlchemistHammerItem(Tiers.NETHERITE, 1, -2.8f, new Properties())),
destruction_catalyst(new DestructionItem(3, 5, 1).setMaxStackSize(16)),
evertide_amulet(new AlchemistBlockItem(Blocks.water).setMaxStackSize(1)),
//evertide_amulet(new AlchemistBlockItem(Blocks.water).setMaxStackSize(1)),
//gem_of_eternal_density,
//harvest_goddess_band,
//hyperkinetic_lens,
Expand All @@ -32,35 +33,27 @@ public enum AlchemistItems {
philosophers_stone(new PhilosophersStoneItem().setMaxStackSize(1)),
red_matter,
swiftwolfs_rending_gale(new GaleItem().setMaxStackSize(1)),
volcanite_amulet(new AlchemistBlockItem(Blocks.lava).setMaxDamage(64)),
//volcanite_amulet(new AlchemistBlockItem(Blocks.lava).setMaxDamage(64)),
;
@Getter Item item;
AlchemistItems(){
this(0);
}

AlchemistItems(int burntime){
//this(new Properties(), burntime);
}

AlchemistItems(Properties properties){
//this(new Item(properties), 0);
}

AlchemistItems(Properties properties, int burntime){
//this(new Item(properties), burntime);
this(new Item(), burntime);
}

AlchemistItems(Item item){
//this(item, 0);
this(item, 0);
}

AlchemistItems(Item item, int burntime){
this.item = item;
FuelRegistry.INSTANCE.add(item, burntime);
//FuelRegistry.INSTANCE.add(item, burntime);
GameRegistry.registerItem(item, this.name());
ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Tags.MODID, "tab"))).register(content -> {
content.accept(item);
});
//ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Tags.MODID, "tab"))).register(content -> {
// content.accept(item);
//});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.unix_supremacist.alchemist.content;

public class AlchemistSplashes {
public class AlchemistSplashes {
public static String[] splashes = {
"Welcome to the World of Alchemy!"
};
Expand Down
137 changes: 66 additions & 71 deletions src/main/java/io/github/unix_supremacist/alchemist/data/BlockTag.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package io.github.unix_supremacist.alchemist.data;

import io.github.unix_supremacist.Alchemist;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import io.github.unix_supremacist.alchemist.Alchemist;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.CompletableFuture;

public class BlockTag extends FabricTagProvider.BlockTagProvider {
public class BlockTag /*extends FabricTagProvider.BlockTagProvider*/ {
public static HashSet<ArrayList<Block>> exchanges = new HashSet<>();
public static TagKey<Block> terratag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra"));
/*public static TagKey<Block> terratag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra"));
public static TagKey<Block> woodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "wood"));
public static TagKey<Block> netherwoodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood"));
public static TagKey<Block> leavetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave"));
Expand Down Expand Up @@ -47,78 +42,78 @@ public static void init(){
@Override
protected void addTags(HolderLookup.Provider arg) {
FabricTagBuilder terra = getOrCreateTagBuilder(terratag);
terra.add(Blocks.GRASS_BLOCK);
terra.add(Blocks.DIRT);
terra.add(Blocks.COARSE_DIRT);
terra.add(Blocks.COBBLESTONE);
terra.add(Blocks.MOSSY_COBBLESTONE);
terra.add(Blocks.COBBLED_DEEPSLATE);
terra.add(Blocks.STONE);
terra.add(Blocks.DEEPSLATE);
terra.add(Blocks.SAND);
terra.add(Blocks.RED_SAND);
terra.add(Blocks.GRAVEL);
terra.add(Blocks.grass);
terra.add(Blocks.dirt);
//terra.add(Blocks.COARSE_DIRT);
terra.add(Blocks.cobblestone);
terra.add(Blocks.mossy_cobblestone);
//terra.add(Blocks.COBBLED_DEEPSLATE);
terra.add(Blocks.stone);
//terra.add(Blocks.DEEPSLATE);
terra.add(Blocks.sand);
//terra.add(Blocks.RED_SAND);
terra.add(Blocks.gravel);
FabricTagBuilder wood = getOrCreateTagBuilder(woodtag);
wood.add(Blocks.OAK_LOG);
wood.add(Blocks.ACACIA_LOG);
wood.add(Blocks.BIRCH_LOG);
wood.add(Blocks.CHERRY_LOG);
wood.add(Blocks.JUNGLE_LOG);
wood.add(Blocks.DARK_OAK_LOG);
wood.add(Blocks.MANGROVE_LOG);
wood.add(Blocks.SPRUCE_LOG);
wood.add(Blocks.STRIPPED_OAK_LOG);
wood.add(Blocks.STRIPPED_ACACIA_LOG);
wood.add(Blocks.STRIPPED_BIRCH_LOG);
wood.add(Blocks.STRIPPED_CHERRY_LOG);
wood.add(Blocks.STRIPPED_JUNGLE_LOG);
wood.add(Blocks.STRIPPED_DARK_OAK_LOG);
wood.add(Blocks.STRIPPED_MANGROVE_LOG);
wood.add(Blocks.STRIPPED_SPRUCE_LOG);
wood.add(Blocks.OAK_WOOD);
wood.add(Blocks.ACACIA_LOG);
wood.add(Blocks.BIRCH_LOG);
wood.add(Blocks.CHERRY_LOG);
wood.add(Blocks.JUNGLE_LOG);
wood.add(Blocks.DARK_OAK_LOG);
wood.add(Blocks.MANGROVE_LOG);
wood.add(Blocks.SPRUCE_LOG);
//wood.add(Blocks.OAK_LOG);
//wood.add(Blocks.ACACIA_LOG);
//wood.add(Blocks.BIRCH_LOG);
//wood.add(Blocks.CHERRY_LOG);
//wood.add(Blocks.JUNGLE_LOG);
//wood.add(Blocks.DARK_OAK_LOG);
//wood.add(Blocks.MANGROVE_LOG);
//wood.add(Blocks.SPRUCE_LOG);
//wood.add(Blocks.STRIPPED_OAK_LOG);
//wood.add(Blocks.STRIPPED_ACACIA_LOG);
//wood.add(Blocks.STRIPPED_BIRCH_LOG);
//wood.add(Blocks.STRIPPED_CHERRY_LOG);
//wood.add(Blocks.STRIPPED_JUNGLE_LOG);
//wood.add(Blocks.STRIPPED_DARK_OAK_LOG);
//wood.add(Blocks.STRIPPED_MANGROVE_LOG);
//wood.add(Blocks.STRIPPED_SPRUCE_LOG);
//wood.add(Blocks.OAK_WOOD);
//wood.add(Blocks.ACACIA_LOG);
//wood.add(Blocks.BIRCH_LOG);
//wood.add(Blocks.CHERRY_LOG);
//wood.add(Blocks.JUNGLE_LOG);
//wood.add(Blocks.DARK_OAK_LOG);
//wood.add(Blocks.MANGROVE_LOG);
//wood.add(Blocks.SPRUCE_LOG);
FabricTagBuilder netherwood = getOrCreateTagBuilder(netherwoodtag);
netherwood.add(Blocks.CRIMSON_STEM);
netherwood.add(Blocks.WARPED_STEM);
netherwood.add(Blocks.STRIPPED_CRIMSON_STEM);
netherwood.add(Blocks.STRIPPED_WARPED_STEM);
//netherwood.add(Blocks.CRIMSON_STEM);
//netherwood.add(Blocks.WARPED_STEM);
//netherwood.add(Blocks.STRIPPED_CRIMSON_STEM);
//netherwood.add(Blocks.STRIPPED_WARPED_STEM);
FabricTagBuilder leave = getOrCreateTagBuilder(leavetag);
leave.add(Blocks.OAK_LEAVES);
leave.add(Blocks.ACACIA_LEAVES);
leave.add(Blocks.BIRCH_LEAVES);
leave.add(Blocks.CHERRY_LEAVES);
leave.add(Blocks.JUNGLE_LEAVES);
leave.add(Blocks.DARK_OAK_LEAVES);
leave.add(Blocks.MANGROVE_LEAVES);
leave.add(Blocks.SPRUCE_LEAVES);
leave.add(Blocks.NETHER_WART_BLOCK);
leave.add(Blocks.WARPED_WART_BLOCK);
//leave.add(Blocks.OAK_LEAVES);
//leave.add(Blocks.ACACIA_LEAVES);
//leave.add(Blocks.BIRCH_LEAVES);
//leave.add(Blocks.CHERRY_LEAVES);
//leave.add(Blocks.JUNGLE_LEAVES);
//leave.add(Blocks.DARK_OAK_LEAVES);
//leave.add(Blocks.MANGROVE_LEAVES);
//leave.add(Blocks.SPRUCE_LEAVES);
//leave.add(Blocks.NETHER_WART_BLOCK);
//leave.add(Blocks.WARPED_WART_BLOCK);
FabricTagBuilder stone = getOrCreateTagBuilder(stonetag);
stone.add(Blocks.ANDESITE);
stone.add(Blocks.DIORITE);
stone.add(Blocks.GRANITE);
stone.add(Blocks.SANDSTONE);
stone.add(Blocks.RED_SANDSTONE);
stone.add(Blocks.CLAY);
//stone.add(Blocks.ANDESITE);
//stone.add(Blocks.DIORITE);
//stone.add(Blocks.GRANITE);
stone.add(Blocks.sandstone);
//stone.add(Blocks.RED_SANDSTONE);
stone.add(Blocks.clay);
FabricTagBuilder obsidian = getOrCreateTagBuilder(obsidiantag);
obsidian.add(Blocks.OBSIDIAN);
obsidian.add(Blocks.CRYING_OBSIDIAN);
obsidian.add(Blocks.obsidian);
//obsidian.add(Blocks.CRYING_OBSIDIAN);
FabricTagBuilder stonebricks = getOrCreateTagBuilder(stonebrickstag);
stonebricks.add(Blocks.STONE_BRICKS);
stonebricks.add(Blocks.MOSSY_STONE_BRICKS);
}
stonebricks.add(Blocks.stonebrick);
//stonebricks.add(Blocks.MOSSY_STONE_BRICKS);
}*/

public static Block getBlockWithOffset(Block b, ArrayList<Block> exchange, int o){
int id = exchange.indexOf(b);
Expand Down

This file was deleted.

Loading

0 comments on commit e839323

Please sign in to comment.