Skip to content

Commit

Permalink
3.4.1 Update
Browse files Browse the repository at this point in the history
- Re-enabled JEI plugin

- Fixed Exchanger range outline incorrectly rendering on liquid blocks

- Added initial support for the Ender IO 1.20 alpha, all recipes and textures are not final and are subjected to change in future versions
  • Loading branch information
JackyyTV committed Jul 8, 2023
1 parent 55c63d3 commit 81071ff
Show file tree
Hide file tree
Showing 58 changed files with 294 additions and 321 deletions.
73 changes: 26 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ minecraft {
mappings channel: mappings_channel, version: mappings_version
copyIdeResources = true
runs {
client {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {
property 'forge.enabledGameTestNamespaces', mod_id
if (project.hasProperty('mcUUID')) {
args '--uuid', project.getProperty('mcUUID')
Expand All @@ -33,44 +40,17 @@ minecraft {
if (project.hasProperty('mcAccessToken')) {
args '--accessToken', project.getProperty('mcAccessToken')
}
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', mod_id
mods {
"${mod_id}" {
source sourceSets.main
}
}
args '--nogui'
}
gameTestServer {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', mod_id
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
workingDirectory project.file('run-data')
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
}
}
Expand Down Expand Up @@ -101,12 +81,13 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"

//implementation fg.deobf("mezz.jei:jei-1.20-forge:+")
//implementation fg.deobf("curse.maven:jade-324717:")
//implementation fg.deobf("curse.maven:theoneprobe-245211:")
implementation fg.deobf("mezz.jei:jei-1.20.1-forge:+")
//implementation fg.deobf("curse.maven:jade-324717:4614153") //1.20-11.1.4
implementation fg.deobf("curse.maven:theoneprobe-245211:4629624") //1.20.1-10.0.1

implementation fg.deobf("curse.maven:gunpowderlib-356646:4573505") //1.20-2.2

runtimeOnly fg.deobf("curse.maven:ender_io-64578:4631517") //6.0.3-alpha
//runtimeOnly fg.deobf("curse.maven:mekanism-268560:")
//runtimeOnly fg.deobf("curse.maven:immersive_engineering-231951:")
//runtimeOnly fg.deobf("curse.maven:cofh_core-69162:")
Expand All @@ -115,21 +96,19 @@ dependencies {
//runtimeOnly fg.deobf("curse.maven:thermal_expansion-69163:")
}

def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta']
def replaceProperties = [
mc_version: mc_version, mc_version_range: mc_version_range,
forge_version: forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, jar_name: jar_name,
mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description
]

processResources {
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
mc_version: mc_version, mc_version_range: mc_version_range,
forge_version: forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, jar_name: jar_name,
mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description
]
inputs.properties replaceProperties
replaceProperties.put 'project', project
filesMatching(resourceTargets) {
expand replaceProperties

filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ mod_id=exchangers
jar_name=Exchangers
mod_name=Exchangers

mc_version=1.20
mc_version=1.20.1
mc_version_range=[1.20,1.21)

forge_version=46.0.1
forge_version=47.1.0
forge_version_range=[46,)
loader_version_range=[46,)

mappings_channel=official
mappings_version=1.20
mappings_version=1.20.1

mod_version=3.4
mod_version=3.4.1
mod_license=Jacky's Minecraft Mods License
mod_authors=Jackyy, TurkeyDev
mod_description=Block Exchangers.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
Expand Down Expand Up @@ -77,7 +78,7 @@ public void renderLevelStageEvent(RenderLevelStageEvent event) {
BlockPos pos = mouseOverBlock.getBlockPos();
BlockState state = world.getBlockState(pos);
ItemStack stack = player.getMainHandItem();
if (!stack.isEmpty() && stack.getItem() instanceof ItemExchangerBase && stack.getTag() != null && !state.isAir()) {
if (!stack.isEmpty() && stack.getItem() instanceof ItemExchangerBase && stack.getTag() != null && !state.isAir() && !(state.getBlock() instanceof LiquidBlock)) {
BlockState exState = NbtUtils.readBlockState(world.holderLookup(Registries.BLOCK), NBTHelper.getTag(stack).getCompound("blockstate"));
float blockHardness = state.getDestroySpeed(world, pos);
if (exState == state) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/jackyy/exchangers/integration/JEIPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package jackyy.exchangers.integration;

/*
TODO Fix JEI Plugin
import jackyy.exchangers.registry.ModItems;
import jackyy.exchangers.util.Reference;
import mezz.jei.api.IModPlugin;
Expand Down Expand Up @@ -55,4 +53,3 @@ public void registerItemSubtypes(ISubtypeRegistration registration) {
};

}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import jackyy.exchangers.util.Reference;
import net.minecraftforge.fml.ModList;

public class ItemConductiveIronExchanger extends ItemExchangerBasePowered {
public class ItemConductiveExchanger extends ItemExchangerBasePowered {

public ItemConductiveIronExchanger() {
public ItemConductiveExchanger() {
super(new Properties().rarity(Reference.RARITY_TIER1));
}

Expand Down Expand Up @@ -39,7 +39,7 @@ public int getMaxRange() {

@Override
public int getTier() {
return 1;
return 2;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,42 @@
import jackyy.exchangers.registry.ModConfigs;
import jackyy.exchangers.util.DefaultValues;
import jackyy.exchangers.util.Reference;
import net.minecraft.world.item.Rarity;
import net.minecraftforge.fml.ModList;

public class ItemElectricalSteelExchanger extends ItemExchangerBasePowered {
public class ItemCopperAlloyExchanger extends ItemExchangerBasePowered {

public ItemElectricalSteelExchanger() {
super(new Properties().rarity(Rarity.RARE));
public ItemCopperAlloyExchanger() {
super(new Properties().rarity(Reference.RARITY_TIER1));
}

@Override
public int getMaxEnergy() {
return ModConfigs.CONFIG.electricalSteelMaxEnergy.get();
return ModConfigs.CONFIG.copperAlloyMaxEnergy.get();
}

@Override
public int getPerBlockUse() {
return ModConfigs.CONFIG.electricalSteelPerBlockUse.get();
return ModConfigs.CONFIG.copperAlloyPerBlockUse.get();
}

@Override
public String getHarvestLevel() {
return ModConfigs.CONFIG.electricalSteelMaxHarvestLevel.get();
return ModConfigs.CONFIG.copperAlloyMaxHarvestLevel.get();
}

@Override
public String getDefaultHarvestLevel() {
return DefaultValues.electricalSteelMaxHarvestLevel;
return DefaultValues.copperAlloyMaxHarvestLevel;
}

@Override
public int getMaxRange() {
return ModConfigs.CONFIG.electricalSteelMaxRange.get();
return ModConfigs.CONFIG.copperAlloyMaxRange.get();
}

@Override
public int getTier() {
return 3;
return 1;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import jackyy.exchangers.registry.ModConfigs;
import jackyy.exchangers.util.DefaultValues;
import jackyy.exchangers.util.Reference;
import net.minecraft.world.item.Rarity;
import net.minecraftforge.fml.ModList;

public class ItemPulsatingIronExchanger extends ItemExchangerBasePowered {
public class ItemPulsatingExchanger extends ItemExchangerBasePowered {

public ItemPulsatingIronExchanger() {
super(new Properties().rarity(Reference.RARITY_TIER1));
public ItemPulsatingExchanger() {
super(new Properties().rarity(Rarity.RARE));
}

@Override
Expand Down Expand Up @@ -39,7 +40,7 @@ public int getMaxRange() {

@Override
public int getTier() {
return 2;
return 3;
}

@Override
Expand Down
76 changes: 38 additions & 38 deletions src/main/java/jackyy/exchangers/registry/ModConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public static class CommonConfig {
public final ForgeConfigSpec.ConfigValue<? extends String> endMaxHarvestLevel;
public final ForgeConfigSpec.IntValue endMaxRange;

public final ForgeConfigSpec.IntValue copperAlloyMaxEnergy;
public final ForgeConfigSpec.IntValue copperAlloyPerBlockUse;
public final ForgeConfigSpec.ConfigValue<? extends String> copperAlloyMaxHarvestLevel;
public final ForgeConfigSpec.IntValue copperAlloyMaxRange;
public final ForgeConfigSpec.IntValue conductiveMaxEnergy;
public final ForgeConfigSpec.IntValue conductivePerBlockUse;
public final ForgeConfigSpec.ConfigValue<? extends String> conductiveMaxHarvestLevel;
Expand All @@ -43,10 +47,6 @@ public static class CommonConfig {
public final ForgeConfigSpec.IntValue pulsatingPerBlockUse;
public final ForgeConfigSpec.ConfigValue<? extends String> pulsatingMaxHarvestLevel;
public final ForgeConfigSpec.IntValue pulsatingMaxRange;
public final ForgeConfigSpec.IntValue electricalSteelMaxEnergy;
public final ForgeConfigSpec.IntValue electricalSteelPerBlockUse;
public final ForgeConfigSpec.ConfigValue<? extends String> electricalSteelMaxHarvestLevel;
public final ForgeConfigSpec.IntValue electricalSteelMaxRange;
public final ForgeConfigSpec.IntValue energeticMaxEnergy;
public final ForgeConfigSpec.IntValue energeticPerBlockUse;
public final ForgeConfigSpec.ConfigValue<? extends String> energeticMaxHarvestLevel;
Expand Down Expand Up @@ -279,59 +279,59 @@ public static class CommonConfig {
builder.pop();

builder.push("ender_io_tweaks");
copperAlloyMaxEnergy = builder
.comment("Set the energy capacity for Copper Alloy Exchanger")
.defineInRange("copperAlloyMaxEnergy", DefaultValues.copperALloyMaxEnergy, 1000, Integer.MAX_VALUE);
copperAlloyPerBlockUse = builder
.comment("Set the energy consumption per block for Copper Alloy Exchanger")
.defineInRange("copperAlloyPerBlockUse", DefaultValues.copperAlloyPerBlockUse, 1, Integer.MAX_VALUE);
copperAlloyMaxHarvestLevel = builder
.comment(
"Set the max harvest level for Copper Alloy Exchanger",
"Valid Vanilla values are: minecraft:wood, minecraft:stone, minecraft:iron, minecraft:diamond, minecraft:netherite",
"For modded values, please check the tool tiers for the mod that you want to use",
"Entering an incorrect value will result in the Exchanger using the default value to prevent crashes"
)
.define("copperAlloyMaxHarvestLevel", DefaultValues.copperAlloyMaxHarvestLevel);
copperAlloyMaxRange = builder
.comment("Set the max range for Copper Alloy Exchanger")
.defineInRange("copperAlloyMaxRange", DefaultValues.copperALloyMaxRange, 0, 12);

conductiveMaxEnergy = builder
.comment("Set the energy capacity for Conductive Iron Exchanger")
.defineInRange("conductiveIronExchangerMaxEnergy", DefaultValues.conductiveMaxEnergy, 1000, Integer.MAX_VALUE);
.comment("Set the energy capacity for Conductive Exchanger")
.defineInRange("conductiveMaxEnergy", DefaultValues.conductiveMaxEnergy, 1000, Integer.MAX_VALUE);
conductivePerBlockUse = builder
.comment("Set the energy consumption per block for Conductive Iron Exchanger")
.defineInRange("conductiveIronExchangerPerBlockUse", DefaultValues.conductivePerBlockUse, 1, Integer.MAX_VALUE);
.comment("Set the energy consumption per block for Conductive Exchanger")
.defineInRange("conductivePerBlockUse", DefaultValues.conductivePerBlockUse, 1, Integer.MAX_VALUE);
conductiveMaxHarvestLevel = builder
.comment(
"Set the max harvest level for Conductive Iron Exchanger",
"Set the max harvest level for Conductive Exchanger",
"Valid Vanilla values are: minecraft:wood, minecraft:stone, minecraft:iron, minecraft:diamond, minecraft:netherite",
"For modded values, please check the tool tiers for the mod that you want to use",
"Entering an incorrect value will result in the Exchanger using the default value to prevent crashes"
)
.define("conductiveIronExchangerMaxHarvestLevel", DefaultValues.conductiveMaxHarvestLevel);
.define("conductiveMaxHarvestLevel", DefaultValues.conductiveMaxHarvestLevel);
conductiveMaxRange = builder
.comment("Set the max range for Conductive Iron Exchanger")
.defineInRange("conductiveIronExchangerMaxRange", DefaultValues.conductiveMaxRange, 0, 12);
.comment("Set the max range for Conductive Exchanger")
.defineInRange("conductiveMaxRange", DefaultValues.conductiveMaxRange, 0, 12);

pulsatingMaxEnergy = builder
.comment("Set the energy capacity for Pulsating Iron Exchanger")
.defineInRange("pulsatingIronExchangerMaxEnergy", DefaultValues.pulsatingMaxEnergy, 1000, Integer.MAX_VALUE);
.comment("Set the energy capacity for Pulsating Exchanger")
.defineInRange("pulsatingMaxEnergy", DefaultValues.pulsatingMaxEnergy, 1000, Integer.MAX_VALUE);
pulsatingPerBlockUse = builder
.comment("Set the energy consumption per block for Pulsating Iron Exchanger")
.defineInRange("pulsatingIronExchangerPerBlockUse", DefaultValues.pulsatingPerBlockUse, 1, Integer.MAX_VALUE);
.comment("Set the energy consumption per block for Pulsating Exchanger")
.defineInRange("pulsatingPerBlockUse", DefaultValues.pulsatingPerBlockUse, 1, Integer.MAX_VALUE);
pulsatingMaxHarvestLevel = builder
.comment(
"Set the max harvest level for Pulsating Iron Exchanger",
"Set the max harvest level for Pulsating Exchanger",
"Valid Vanilla values are: minecraft:wood, minecraft:stone, minecraft:iron, minecraft:diamond, minecraft:netherite",
"For modded values, please check the tool tiers for the mod that you want to use",
"Entering an incorrect value will result in the Exchanger using the default value to prevent crashes"
)
.define("pulsatingIronExchangerMaxHarvestLevel", DefaultValues.pulsatingMaxHarvestLevel);
.define("pulsatingMaxHarvestLevel", DefaultValues.pulsatingMaxHarvestLevel);
pulsatingMaxRange = builder
.comment("Set the max range for Pulsating Iron Exchanger")
.defineInRange("pulsatingIronExchangerMaxRange", DefaultValues.pulsatingMaxRange, 0, 12);

electricalSteelMaxEnergy = builder
.comment("Set the energy capacity for Electrical Steel Exchanger")
.defineInRange("electricalSteelExchangerMaxEnergy", DefaultValues.electricalSteelMaxEnergy, 1000, Integer.MAX_VALUE);
electricalSteelPerBlockUse = builder
.comment("Set the energy consumption per block for Electrical Steel Exchanger")
.defineInRange("electricalSteelExchangerPerBlockUse", DefaultValues.electricalSteelPerBlockUse, 1, Integer.MAX_VALUE);
electricalSteelMaxHarvestLevel = builder
.comment(
"Set the max harvest level for Electrical Steel Exchanger",
"Valid Vanilla values are: minecraft:wood, minecraft:stone, minecraft:iron, minecraft:diamond, minecraft:netherite",
"For modded values, please check the tool tiers for the mod that you want to use",
"Entering an incorrect value will result in the Exchanger using the default value to prevent crashes"
)
.define("electricalSteelExchangerMaxHarvestLevel", DefaultValues.electricalSteelMaxHarvestLevel);
electricalSteelMaxRange = builder
.comment("Set the max range for Electrical Steel Exchanger")
.defineInRange("electricalSteelExchangerMaxRange", DefaultValues.electricalSteelMaxRange, 0, 12);
.comment("Set the max range for Pulsating Exchanger")
.defineInRange("pulsatingMaxRange", DefaultValues.pulsatingMaxRange, 0, 12);

energeticMaxEnergy = builder
.comment("Set the energy capacity for Energetic Exchanger")
Expand Down
Loading

0 comments on commit 81071ff

Please sign in to comment.