Skip to content

Commit

Permalink
Inital 1.13.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTroble committed Aug 5, 2021
1 parent 79ca2f4 commit b46a5fb
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 187 deletions.
14 changes: 2 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ archivesBaseName = 'GIRC-Redstone'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
mappings channel: 'snapshot', version: '20180921-1.13'

runs {
client {
Expand All @@ -56,7 +56,7 @@ minecraft {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854'
minecraft 'net.minecraftforge:forge:1.13.2-25.0.219'
}

jar {
Expand All @@ -73,16 +73,6 @@ jar {
}
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
expand "version":System.getenv("APPVEYOR_BUILD_VERSION")
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}

jar.finalizedBy('reobfJar')
publishing {
publications {
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## 1.13.2 release

## [Fix] 07.28.2021 - 1
* Fixed issues with server sided translation keys

Expand Down
23 changes: 5 additions & 18 deletions src/main/java/eu/gir/gircredstone/GIRCRedstoneMain.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
package eu.gir.gircredstone;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import eu.gir.gircredstone.proxy.CommonProxy;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = GIRCRedstoneMain.MODID)
public class GIRCRedstoneMain
{
public static final String MODID = "gircredstone";
@Mod(GIRCRedstoneMain.MODID)
public class GIRCRedstoneMain {

public static Logger logger;
public static final Logger LOGGER = LogManager.getLogger();

@SidedProxy(serverSide = "eu.gir.gircredstone.proxy.CommonProxy", clientSide = "eu.gir.gircredstone.proxy.ClientProxy")
public static CommonProxy PROXY;

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();
PROXY.preinit();
}
public static final String MODID = "gircredstone";

}
5 changes: 1 addition & 4 deletions src/main/java/eu/gir/gircredstone/block/BlockBasic.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
import eu.gir.gircredstone.GIRCRedstoneMain;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class BlockBasic extends Block {

public BlockBasic(final String name) {
super(Material.CIRCUITS);
super(Properties.create(Material.CIRCUITS));
this.setRegistryName(GIRCRedstoneMain.MODID, name);
this.setCreativeTab(CreativeTabs.REDSTONE);
this.setUnlocalizedName(name);
}

}
46 changes: 18 additions & 28 deletions src/main/java/eu/gir/gircredstone/block/BlockRedstoneAcceptor.java
Original file line number Diff line number Diff line change
@@ -1,50 +1,40 @@
package eu.gir.gircredstone.block;

import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer.Builder;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IBlockReader;

public class BlockRedstoneAcceptor extends BlockBasic {

public static final PropertyBool POWER = PropertyBool.create("power");
public static final BooleanProperty POWER = BooleanProperty.create("power");

public BlockRedstoneAcceptor() {
super("acceptor");
this.setDefaultState(getDefaultState().withProperty(POWER, false));
this.setDefaultState(getDefaultState().with(POWER, false));
}

@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(POWER) ? 0:1;
public boolean canProvidePower(IBlockState state) {
return true;
}

@Override
public boolean canProvidePower(IBlockState state) {
return true;
public int getWeakPower(IBlockState blockState, IBlockReader blockAccess, BlockPos pos, EnumFacing side) {
return this.getStrongPower(blockState, blockAccess, pos, side);
}

public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return getStrongPower(blockState, blockAccess, pos, side);
@Override
public int getStrongPower(IBlockState blockState, IBlockReader blockAccess, BlockPos pos, EnumFacing side) {
return blockState.get(POWER) ? 15:0;
}

public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return blockState.getValue(POWER) ? 15:0;
@Override
protected void fillStateContainer(Builder<Block, IBlockState> builder) {
builder.add(POWER);
}

@Override
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(POWER, meta == 1);
}

@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] { POWER });
}


}
23 changes: 16 additions & 7 deletions src/main/java/eu/gir/gircredstone/block/BlockRedstoneEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;

@SuppressWarnings("deprecation")
public class BlockRedstoneEmitter extends BlockBasic implements ITileEntityProvider {

public BlockRedstoneEmitter() {
super("emitter");
}

@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileRedstoneEmitter();
public TileEntity createTileEntity(IBlockState state, IBlockReader world) {
return createNewTileEntity(world);
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(IBlockState state, World world, BlockPos pos, EntityPlayer player, EnumHand hand,
EnumFacing side, float hitX, float hitY, float hitZ) {
if (world.isRemote)
return true;
if(player.getHeldItem(hand).getItem().equals(GIRCInit.RS_LINKER))
if (player.getHeldItem(hand).getItem().equals(GIRCInit.RS_LINKER))
return false;
final TileEntity entity = world.getTileEntity(pos);
if (entity instanceof TileRedstoneEmitter) {
Expand All @@ -40,9 +42,11 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
} else {
if (player.isSneaking()) {
emitter.unlink();
player.sendMessage(new TextComponentTranslation("em.unlink", linkedpos.getX(), linkedpos.getY(), linkedpos.getZ()));
player.sendMessage(new TextComponentTranslation("em.unlink", linkedpos.getX(), linkedpos.getY(),
linkedpos.getZ()));
} else {
player.sendMessage(new TextComponentTranslation("lt.linkedpos", linkedpos.getX(), linkedpos.getY(), linkedpos.getZ()));
player.sendMessage(new TextComponentTranslation("lt.linkedpos", linkedpos.getX(), linkedpos.getY(),
linkedpos.getZ()));
}
}
return true;
Expand All @@ -60,4 +64,9 @@ public void neighborChanged(IBlockState state, World world, BlockPos pos, Block
emitter.redstoneUpdate(world.isBlockPowered(pos));
}
}

@Override
public TileEntity createNewTileEntity(IBlockReader worldIn) {
return new TileRedstoneEmitter();
}
}
28 changes: 23 additions & 5 deletions src/main/java/eu/gir/gircredstone/init/GIRCInit.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
package eu.gir.gircredstone.init;

import eu.gir.gircredstone.GIRCRedstoneMain;
import eu.gir.gircredstone.block.BlockRedstoneAcceptor;
import eu.gir.gircredstone.block.BlockRedstoneEmitter;
import eu.gir.gircredstone.item.Linkingtool;
import eu.gir.gircredstone.tile.TileRedstoneEmitter;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.Item.Properties;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemGroup;
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.IForgeRegistry;

@Mod.EventBusSubscriber(bus=Bus.MOD, modid = GIRCRedstoneMain.MODID)
public class GIRCInit {

public static final Block RS_ACCEPTOR = new BlockRedstoneAcceptor();
public static final Block RS_EMITTER = new BlockRedstoneEmitter();

public static final Item RS_LINKER = new Linkingtool();

@SubscribeEvent
public static void registerBlock(RegistryEvent.Register<Block> event) {
IForgeRegistry<Block> registry = event.getRegistry();
registry.register(RS_ACCEPTOR);
registry.register(RS_EMITTER);
GIRCRedstoneMain.LOGGER.info("Hello!000000000000=========================================000000");
}

@SubscribeEvent
public static void registerItem(RegistryEvent.Register<Item> event) {
IForgeRegistry<Item> registry = event.getRegistry();
registry.register(new ItemBlock(RS_ACCEPTOR).setRegistryName(RS_ACCEPTOR.getRegistryName()));
registry.register(new ItemBlock(RS_ACCEPTOR, new Properties().group(ItemGroup.REDSTONE))
.setRegistryName(RS_ACCEPTOR.getRegistryName()));
registry.register(RS_LINKER);
registry.register(new ItemBlock(RS_EMITTER).setRegistryName(RS_EMITTER.getRegistryName()));
registry.register(new ItemBlock(RS_EMITTER, new Properties().group(ItemGroup.REDSTONE))
.setRegistryName(RS_EMITTER.getRegistryName()));
}

public static final TileEntityType<?> EMITER_TILE = TileEntityType.Builder.create(TileRedstoneEmitter::new).build(null);

@SubscribeEvent
public static void registerTE(RegistryEvent.Register<TileEntityType<?>> evt) {
EMITER_TILE.setRegistryName(GIRCRedstoneMain.MODID, "emitter");
evt.getRegistry().register(EMITER_TILE);
}


}
Loading

0 comments on commit b46a5fb

Please sign in to comment.