Skip to content

Commit

Permalink
update to 1.7.7.0_02
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerahuntley committed Sep 2, 2023
1 parent 452e95e commit 490fc9e
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 46 deletions.
44 changes: 40 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ loom {

repositories {
mavenCentral()
maven { url = "https://jitpack.io" }
maven {
name = 'Babric'
url = 'https://maven.glass-launcher.net/babric'
Expand All @@ -39,6 +40,22 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-bta-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://piston-data.mojang.com"
patternLayout {
Expand All @@ -47,20 +64,39 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
}

dependencies {
minecraft "bta-download-repo:bta:${project.bta_version}"
mappings loom.layered() {}

modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar
modImplementation "babric:fabric-loader:${project.loader_version}"
modImplementation "fabric-loader:fabric-loader:${project.loader_version}"

// Helper library
modImplementation "bta-halplibe:halplibe:${project.halplibe_version}"
// If you do not need Halplibe you can comment this line out or delete this line
modImplementation "com.github.Turnip-Labs:bta-halplibe:${project.halplibe_version}"

modImplementation "ModMenu:ModMenu:2.0.0"

implementation "org.slf4j:slf4j-api:1.8.0-beta4"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"

implementation 'com.google.guava:guava:30.0-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'

modImplementation "org.slf4j:slf4j-api:1.8.0-beta4"
modImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
var log4jVersion = "2.20.0"
implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}")
}

java {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
org.gradle.jvmargs=-Xmx2G

# BTA
bta_version=1.7.6.2_02
bta_version=1.7.7.0_02

# Loader
loader_version=0.14.19-babric.1
loader_version=0.14.19-babric.1-bta

# HalpLibe
halplibe_version=1.1.4
halplibe_version=2.1.6

# Mod
mod_version=1.1.1
mod_version=1.2.0
mod_group=youngsditch
mod_name=ancientlogistics
26 changes: 15 additions & 11 deletions src/main/java/youngsditch/ancientlogistics/AncientLogistics.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package youngsditch.ancientlogistics;

import turniplabs.halplibe.helper.*;
import net.minecraft.src.*;
import turniplabs.halplibe.helper.BlockBuilder;
import turniplabs.halplibe.helper.ItemHelper;
import turniplabs.halplibe.helper.RecipeHelper;
import net.minecraft.client.sound.block.BlockSounds;
import net.minecraft.core.block.Block;
import net.minecraft.core.item.Item;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -14,19 +18,19 @@ public class AncientLogistics implements ModInitializer {
public static final String MOD_ID = "ancientlogistics";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static final Config config = new Config(MOD_ID, new Properties() {{
put("gearID", "140");
put("gearboxID", "900");
put("geartrommelID", "901");
put("gearchestID", "902");
put("reinforcedgearboxID", "903");
put("gearID", "17000");
put("gearboxID", "905");
put("geartrommelID", "906");
put("gearchestID", "907");
put("reinforcedgearboxID", "908");
// More keys and values...
}});

public static final Item gear = ItemHelper.createItem(MOD_ID, new Item(config.getInt("gearID")), "gear", "gear.png");
public static final Block gearBlock = BlockHelper.createBlock(MOD_ID, new GearBox(config.getInt("gearboxID")), "gearbox", "gear_top.png", "gear_block.png", Block.soundMetalFootstep, 0.1f, 0.1f, 0.0f);
public static final Block reinforcedGearBlock = BlockHelper.createBlock(MOD_ID, new ReinforcedGearBox(config.getInt("reinforcedgearboxID")), "reinforcedgearbox", "gear_top.png", "reinf_gear_block.png", Block.soundMetalFootstep, 0.1f, 0.1f, 0.0f);
public static final Block gearTrommelBlock = BlockHelper.createBlock(MOD_ID, new GearTrommel(config.getInt("geartrommelID")), "geartrommel", "gear_top.png", "gear_trommel.png", Block.soundMetalFootstep, 0.1f, 0.1f, 0.0f);
public static final Block gearChestBlock = BlockHelper.createBlock(MOD_ID, new GearChestSorter(config.getInt("gearchestID")), "gearchest", "gear_top.png", "gear_chest.png", Block.soundWoodFootstep, 0.1f, 0.1f, 0.0f);
public static final Block gearBlock = new BlockBuilder(MOD_ID).setTextures("gear_block.png").setBlockSound(BlockSounds.METAL).build(new GearBox("gearbox", config.getInt("gearboxID")));
public static final Block reinforcedGearBlock = new BlockBuilder(MOD_ID).setTextures("reinf_gear_block.png").setBlockSound(BlockSounds.WOOD).build(new ReinforcedGearBox("reinforcedgearbox", config.getInt("reinforcedgearboxID")));
public static final Block gearTrommelBlock = new BlockBuilder(MOD_ID).setTextures("gear_trommel.png").setBlockSound(BlockSounds.METAL).build(new GearTrommel("geartrommel", config.getInt("geartrommelID")));
public static final Block gearChestBlock = new BlockBuilder(MOD_ID).setTextures("gear_chest.png").setBlockSound(BlockSounds.WOOD).build(new GearChestSorter("gearchest", config.getInt("gearchestID")));

@Override
public void onInitialize() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package youngsditch.ancientlogistics.gears;

import net.minecraft.src.*;
import net.minecraft.core.block.Block;
import net.minecraft.core.block.material.Material;

public class GearBlock extends Block {

protected static final int[][] NEIGHBORS = {{1, 0, 0}, {-1, 0, 0}, {0, 0, 1}, {0, 0, -1}};

public GearBlock(int id) {
super(id, Material.iron);
public GearBlock(String key, int id) {
super(key, id, Material.metal);
}
}
4 changes: 2 additions & 2 deletions src/main/java/youngsditch/ancientlogistics/gears/GearBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class GearBox extends GearGenerator {

public GearBox(int id) {
super(id);
public GearBox(String key, int id) {
super(key, id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
import java.util.ArrayList;
import java.util.Comparator;

import net.minecraft.src.*;
import net.minecraft.core.block.Block;
import net.minecraft.core.block.BlockChest;
import net.minecraft.core.block.entity.*;
import net.minecraft.core.entity.player.*;
import net.minecraft.core.world.World;
import net.minecraft.core.item.ItemStack;
import youngsditch.ancientlogistics.AncientLogistics;
import youngsditch.ancientlogistics.mixin.ChestAccessor;

public class GearChestSorter extends GearUsable {

public GearChestSorter(int id) {
super(id);
public GearChestSorter(String key, int id) {
super(key, id);
}

class ChestWithDistance {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package youngsditch.ancientlogistics.gears;

import net.minecraft.src.*;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.world.World;
import net.minecraft.core.block.Block;
import net.minecraft.core.item.Item;

import java.util.Random;

public class GearGenerator extends GearBlock {
private Random rand = new Random();
protected boolean canRunMultiple = false;

public GearGenerator(int id) {
super(id);
public GearGenerator(String key, int id) {
super(key, id);
this.rand = new Random();
}

Expand All @@ -18,7 +21,7 @@ public boolean isCovered(World world, int x, int y, int z) {
}

public boolean playerHasBone(EntityPlayer player) {
return player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().itemID == Item.bone.itemID;
return player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().itemID == Item.bone.id;
}

public boolean interactable(World world, int x, int y, int z, EntityPlayer player) {
Expand Down Expand Up @@ -77,7 +80,7 @@ public void showWorking(World world, int x, int y, int z, EntityPlayer player) {
(this.rand.nextFloat() - 0.5) / 100,
(this.rand.nextFloat() - 0.5) / 100);
}
player.worldObj.playSoundAtEntity(player, "mob.skeletonhurt", 0.25f, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2f + 1.0f)/2.0f);
player.world.playSoundAtEntity(player, "mob.skeletonhurt", 0.25f, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2f + 1.0f)/2.0f);
}

public void showNotWorking(World world, int x, int y, int z, EntityPlayer player) {
Expand All @@ -96,7 +99,7 @@ public void showNotWorking(World world, int x, int y, int z, EntityPlayer player
@Override
public boolean blockActivated(World world, int x, int y, int z, EntityPlayer player) {

if(world.isMultiplayerAndNotHost) {
if(world.isClientSide) {
return true;
}

Expand Down Expand Up @@ -140,7 +143,7 @@ public boolean blockActivated(World world, int x, int y, int z, EntityPlayer pla
for (int i = 0; i < value; i++) {
if (this.rand.nextInt(10) == 0) {
// log break
player.worldObj.playSoundAtEntity(player, "mob.skeletonhurt", 0.5f, 1.0f);
player.world.playSoundAtEntity(player, "mob.skeletonhurt", 0.5f, 1.0f);
if(playerHasBone(player) && player.getCurrentEquippedItem().stackSize > 0) {
player.getCurrentEquippedItem().consumeItem(player);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package youngsditch.ancientlogistics.gears;

import youngsditch.ancientlogistics.mixin.TrommelAccessor;
import net.minecraft.src.*;
import net.minecraft.core.block.Block;
import net.minecraft.core.block.entity.TileEntityTrommel;
import net.minecraft.core.world.World;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.block.BlockTrommel;

public class GearTrommel extends GearUsable {

public GearTrommel(int id) {
super(id);
public GearTrommel(String key, int id) {
super(key, id);
}

// returns true if a sieve is found
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package youngsditch.ancientlogistics.gears;

import java.util.ArrayList;
import net.minecraft.src.*;
import net.minecraft.core.world.World;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.block.Block;

public class GearUsable extends GearBlock {

public GearUsable(int id) {
super(id);
public GearUsable(String key, int id) {
super(key, id);
}

public int onGearUsed(World world, int x, int y, int z, EntityPlayer player, boolean canConnect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public class ReinforcedGearBox extends GearBox {

public ReinforcedGearBox(int id) {
super(id);
public ReinforcedGearBox(String key, int id) {
super(key, id);
this.canRunMultiple = true;
}
}
2 changes: 1 addition & 1 deletion src/main/java/youngsditch/ancientlogistics/items/Gear.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package youngsditch.ancientlogistics.items;

import net.minecraft.src.*;
import net.minecraft.core.item.Item;

public class Gear extends Item {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package youngsditch.ancientlogistics.items;

import net.minecraft.src.*;
import net.minecraft.core.item.Item;

public class GearBone extends Item {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package youngsditch.ancientlogistics.mixin;

import net.minecraft.src.*;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.block.entity.TileEntityChest;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package youngsditch.ancientlogistics.mixin;

import net.minecraft.src.*;
import net.minecraft.core.block.entity.TileEntityTrommel;
import net.minecraft.core.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
Expand Down

0 comments on commit 490fc9e

Please sign in to comment.