Skip to content

Commit

Permalink
Merge pull request #11 from AIDA64S/rewrite
Browse files Browse the repository at this point in the history
add build.bat; add useWithoutResult
  • Loading branch information
jonafanho authored Jun 27, 2024
2 parents 2b0fdef + f9888a9 commit 86b0b02
Show file tree
Hide file tree
Showing 15 changed files with 309 additions and 98 deletions.
39 changes: 39 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@echo Scan Minecraft classes
call gradlew test -x common:test --continue -Pgenerate=dryRun
@echo Generate holders
call gradlew test -x common:test --continue -Pgenerate=normal
@echo Search for mapped methods
call gradlew test -x common:test
@echo Analyze test results
call gradlew common:test
@echo Build common
call gradlew common:build -x test
@echo Build Fabric 1.16.5
call gradlew fabric:1.16.5-mapping:build -x test
@echo Build Fabric 1.17.1
call gradlew fabric:1.17.1-mapping:build -x test
@echo Build Fabric 1.18.2
call gradlew fabric:1.18.2-mapping:build -x test
@echo Build Fabric 1.19.2
call gradlew fabric:1.19.2-mapping:build -x test
@echo Build Fabric 1.19.4
call gradlew fabric:1.19.4-mapping:build -x test
@echo Build Fabric 1.20.1
call gradlew fabric:1.20.1-mapping:build -x test
@echo Build Fabric 1.20.4
call gradlew fabric:1.20.4-mapping:build -x test
@echo Build Forge 1.16.5
call gradlew forge:1.16.5-mapping:build -x test
@echo Build Forge 1.17.1
call gradlew forge:1.17.1-mapping:build -x test
@echo Build Forge 1.18.2
call gradlew forge:1.18.2-mapping:build -x test
@echo Build Forge 1.19.2
call gradlew forge:1.19.2-mapping:build -x test
@echo Build Forge 1.19.4
call gradlew forge:1.19.4-mapping:build -x test
@echo Build Forge 1.20.1
call gradlew forge:1.20.1-mapping:build -x test
@echo Build Forge 1.20.4
call gradlew forge:1.20.4-mapping:build -x test
pause
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.TypedActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final TypedActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package org.mtr.mapping.mapper;

import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final ActionResult<ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
package org.mtr.mapping.mapper;

import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
package org.mtr.mapping.mapper;

import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.mtr.mapping.annotation.MappedMethod;
import org.mtr.mapping.holder.Block;
import org.mtr.mapping.holder.BlockItemAbstractMapping;
import org.mtr.mapping.holder.ItemSettings;
import org.mtr.mapping.holder.*;

public class BlockItemExtension extends BlockItemAbstractMapping {

@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}
@MappedMethod
public BlockItemExtension(Block block, ItemSettings itemSettings) {
super(block, itemSettings);
}

@Deprecated
@Override
public final InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
useWithoutResult(new World(world), new PlayerEntity(user), Hand.convert(hand));
return super.use(world, user, hand);
}

@MappedMethod
public void useWithoutResult(World world, PlayerEntity user, Hand hand) {
}
}
Loading

0 comments on commit 86b0b02

Please sign in to comment.